Skip to content

Instantly share code, notes, and snippets.

View sbruchmann's full-sized avatar

Steffen Bruchmann sbruchmann

View GitHub Profile
@sbruchmann
sbruchmann / stdout.txt
Last active August 29, 2015 14:21
Mysterious npm ETIMEDOUT
$ npm --verbose --save install babel-core
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli '/Users/sbruchmann/.npm-packages/bin/npm',
npm verb cli '--verbose',
npm verb cli '--save',
npm verb cli 'install',
npm verb cli 'babel-core' ]
npm info using npm@2.9.1
npm info using node@v0.12.3
@sbruchmann
sbruchmann / split.css
Last active August 29, 2015 14:20 — forked from jpnelson/split.css
* {
box-sizing: border-box;
}
*::before,
*::after {
box-sizing: inherit;
}
.container {
@sbruchmann
sbruchmann / main.js
Created July 13, 2014 14:35
Working with modal dialogs in Brackets extensions
define(function (require) {
"use strict";
var AppInit = brackets.getModule("utils/AppInit");
var DefaultDialogs = brackets.getModule("widgets/DefaultDialogs");
var Dialogs = brackets.getModule("widgets/Dialogs");
AppInit.appReady(function _onAppReady() {
var myDialog = Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_INFO,
@sbruchmann
sbruchmann / main.js
Last active August 29, 2015 14:03
Tutorial: Add a top-level menu entry at a specific position
define(function () {
"use strict";
var CommandManager = brackets.getModule("command/CommandManager"),
Commands = brackets.getModule("command/Commands"),
Menus = brackets.getModule("command/Menus");
var MY_COMMAND_ID = "PDFEXPORT";
function exportAsPDF() {
@sbruchmann
sbruchmann / README.md
Last active August 29, 2015 14:03
Restart a node-webkit app
@sbruchmann
sbruchmann / main.js
Last active August 29, 2015 14:03
Writing files in Brackets extensions
define(function () {
"use strict";
var AppInit = brackets.getModule("utils/AppInit"),
FileSystem = brackets.getModule("filesystem/FileSystem"),
ProjectManager = brackets.getModule("project/ProjectManager");
AppInit.appReady(function () {
var filename = ProjectManager.getProjectRoot().fullPath + "hello-world.txt";
FileSystem.getFileForPath(filename).write("Hello world!\n");
@sbruchmann
sbruchmann / main.js
Created June 27, 2014 07:31
Hide Toolbar in Brackets
define(function () {
"use strict";
$("#main-toolbar").hide();
});
@sbruchmann
sbruchmann / pubsub.js
Created June 12, 2014 18:25
Minimal PubSub solution
// Original code by David Walsh: http://davidwalsh.name/pubsub-javascript
var events = (function(){
var topics = {};
return {
subscribe: function(topic, listener) {
// Create the topic's object if not yet created
if(!topics[topic]) topics[topic] = { queue: [] };
// Add the listener to queue
@sbruchmann
sbruchmann / app.js
Created June 5, 2014 04:05
Feathers.js bug: Service#create gets called twice
'use strict';
var feathers = require('feathers');
var rubberduck = require('rubberduck');
var tasks = [];
var emitter = rubberduck.emitter(tasks).punch('push');
emitter.on('beforePush', function(args, instance) {
console.log(new Date(), 'About to push ' + args[0]);
/* Based on http://goldengridsystem.com */
.col {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: left;
padding-left: 0.75em;
padding-right: 0.75em;
}