Skip to content

Instantly share code, notes, and snippets.

View aaronj1335's full-sized avatar
🤠

Aaron Stacy aaronj1335

🤠
View GitHub Profile
@aaronj1335
aaronj1335 / README.md
Created May 11, 2012 15:09
relative paths in AMD

Given a project with the files below and a directory structure as follows:

$ tree --charset ascii
.
|-- index.html
|-- js
|   |-- components
|   |   `-- vendor
|   |       |-- jquery-1.7.2.js

| | |-- jquery.js

@aaronj1335
aaronj1335 / commands.sh
Created May 18, 2012 22:19
npm link issue
[me@laptop:code/] $ cd A
[me@laptop:code/A] $ npm link # this works as i expect (and want)
[me@laptop:code/A] $ ll /usr/local/lib/node_modules
...
lrwxr-xr-x 1 me admin 22 May 18 16:59 /usr/local/lib/node_modules/A -> /Users/me/code/A
...
[me@laptop:code/A] $ cd ../B
[me@laptop:code/B] $ cat package.json
...
"dependencies": {
@aaronj1335
aaronj1335 / ip
Created June 22, 2012 21:04
cmd line ip checker
#!/bin/bash
# handy script to check your laptop's ip
if ! which ip &>/dev/null; then
function ip {
local addr='\d{1,3}(\.\d{1,3}){3}'
# if the argumetn was '-' echo the external ip
if [ "$1" = '-' ]; then
@aaronj1335
aaronj1335 / run_in_mingw.sh
Created June 27, 2012 14:39
improper handling of command line arguments in node 0.8.0
echo 'console.log(process.argv);' > test.js
node test.js /static
# prints out ['C\\:Program Files\\nodejs\\node.exe', 'C:\\Users\\astacy\\code\\daft\\test.js', 'C:/Program Files/Git/static']
@aaronj1335
aaronj1335 / index.html
Created July 19, 2012 03:00
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodePen &middot; Pen</title>
<!--
Copyright (c) 2012 Mahroof Ali, http://codepen.io/anon
Permission is hereby granted, free of charge, to any person obtaining
@aaronj1335
aaronj1335 / noderepl
Created August 10, 2012 20:18
node.js repl
#!/usr/bin/env node
var repl = require('repl'),
fs = require('fs'),
path = require('path'),
vm = require('vm');
var myrepl = repl.start('> ');
var stup = path.join(process.env.HOME, '.noderc');
@aaronj1335
aaronj1335 / maximize_without_resizing_quickfix.vim
Created August 13, 2012 20:56
vimscript that maximizes the current window without resizing the quickfix window
" this just sets the current window to the specified number
"
" i think this is what really slows things down
function SetCurWinNr(tot, nr)
exe a:tot . ' winc k'
if a:nr > 1
exe (a:nr-1) . ' winc j'
endif
endfunction
@aaronj1335
aaronj1335 / README.md
Created August 22, 2012 21:54
bootstrapping mr
We couldn’t find that file to show.
@aaronj1335
aaronj1335 / test.js
Created October 23, 2012 02:39
optionally returning a deferred
something.then(function() {
if (config.somethingElse) {
return somethingElse();
}
});
@aaronj1335
aaronj1335 / discussion.md
Created October 24, 2012 18:46
gloss framework stuff

powergrid

todos

  • make Column.prototype.columnClass correctly handle names containing '.'
  • column methods for getting/formatting a table cell's value (see below)
  • add an Grid.prototype._isFiltered method that is used to determine whether the grid adds a filtered class. default behavior should be something like:

_isFiltered: function() {