Skip to content

Instantly share code, notes, and snippets.

View aredridel's full-sized avatar
💭
See my social media for status.

Aria Stewart aredridel

💭
See my social media for status.
View GitHub Profile
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming"
// blog article:
// http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
var $ = require('NodObjC')
$.import('Cocoa')
$.import('WebKit')
var pool = $.NSAutoreleasePool('alloc')('init')
, app = $.NSApplication('sharedApplication')
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming"
// blog article:
// http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
var $ = require('NodObjC')
$.import('Cocoa')
$.import('WebKit')
var pool = $.NSAutoreleasePool('alloc')('init')
, app = $.NSApplication('sharedApplication')
class MyClass {
function __construct() { echo "global"; }
}
@aredridel
aredridel / config.json
Created October 21, 2012 15:20
Example of configuration injection in node.js
{
"value": "config value here"
}
var repl = require('repl')
, rl;
rl = repl.start({
prompt: '>>> '
, input: process.stdin
, output: process.stdout
});
rl.on('close', function () {
@aredridel
aredridel / vagrant.org
Created November 9, 2012 17:23 — forked from akiatoji/vagrant.org
CentOS 6.2 Box for Vagrant

Installing CentOS

Download net install iso:

  • CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
@aredridel
aredridel / logsubprocess.sh
Created November 15, 2012 05:41
Execute a logger as a subprocess and exec, leaving only the two child processes without using bash 4.0
#!/bin/bash
tmp=/tmp/$$.pipe
mkfifo $tmp
logger -p local6.debug < $tmp &
exec > $tmp
@aredridel
aredridel / gist:5427526
Created April 20, 2013 21:36
conversation on dependencies
17:17 judofyr: hey folks
17:17 judofyr: what's up?
17:17 Aria: Not too much.
17:17 Aria: Grumbling about managing ruby dependencies with RPM.
17:17 judofyr: RPM?
17:18 Aria: It's become so damn hard. So much versioning hell out there.
17:18 judofyr: why would you do that?
17:18 judofyr: bundler it up
17:18 Aria: I'm the OS integrator. We're trying to package apps out there for installation.
17:19 judofyr: hm
@aredridel
aredridel / demo.js
Last active December 16, 2015 18:58
Tiny backbone.js hints
var RowView = Backbone.View.extend({
initialize: function () {
this.model.on('change', this.handleChange, this);
},
handleChange: function () {
this.model.save();
},
render: function () {
this.setElement($('<tr>'));
this.$el.append("<td>" + this.model.get('id') + "</td><td>" + this.model.get('field1') + "</td>");
/usr/img/lib/imgadm.js:1124
for (var j = 0; j < imageSet.length; j++) {
^
TypeError: Cannot read property 'length' of undefined
at done (/usr/img/lib/imgadm.js:1124:45)
at async.forEach (/usr/img/node_modules/async/lib/async.js:88:21)
at IMGADM.sourcesList.async.forEach.err (/usr/img/lib/imgadm.js:1102:21)
at IMGADM.clientFromSource (/usr/img/lib/imgadm.js:744:13)
at Source.getResolvedUrl (/usr/img/lib/imgadm.js:361:13)
at /usr/img/lib/imgadm.js:98:13