Skip to content

Instantly share code, notes, and snippets.

View StanAngeloff's full-sized avatar

Stan Angeloff StanAngeloff

View GitHub Profile
var Account, Model;
var __extends = function(child, parent) {
var ctor = function(){};
ctor.prototype = parent.prototype;
child.prototype = new ctor();
child.prototype.constructor = child;
if (typeof parent.extended === "function") parent.extended(child);
child.__superClass__ = parent.prototype;
};
Model = function() {};
class A
constructor: -> alert 'A'
A::constructor = -> alert 'B'
new A
StringScanner = null
( ->
setState = (target, matches, values) ->
target.head = values?.head ? target.head
target.last = values?.last ? target.last
target.captures = matches.slice 1
target.match = matches[0]
class StringScanner
constructor: (source) ->
; AutoHotkey script, download from:
; http://www.autohotkey.com/
; NOTE: Save this file with Windows line endings i.e. \r\n
;
cmd_line := "C:\bin\cygwin\bin\mintty.exe /bin/zsh --login"
wnd_class := "ahk_class mintty"
#c::
options or= {}
target = "export/#{options.environment or 'production'}"
scripts = []
appContents = fs.readFileSync "#{target}/app-debug.html", 'utf8'
appContents = appContents.replace /[ \t]*<script type="text\/javascript" src="([^"]+)"><\/script>\n?/g, (line, filePath) ->
filePath = "lib/languages/#{options.language or 'en-GB'}/strings.js" if isLanguage = helpers.starts filePath, 'lib/languages/'
scripts.push fs.readFileSync "#{target}/#{filePath}", 'utf8'
return line.replace(filePath, "#{filePath}?#{timestamp}") if filePath is 'lib/app.js'
return ''
fs.writeFileSync "#{target}/app-debug.html", appContents, 'utf8'
ZSH_BOOKMARKS="$HOME/.zsh/cdbookmarks"
function cdb_edit() {
$EDITOR "$ZSH_BOOKMARKS"
}
function cdb() {
local index
local entry
index=0
@StanAngeloff
StanAngeloff / growl_windows.coffee
Created August 30, 2010 22:38
Cygwin, CoffeeScript & Growl for Windows integration
{ exec } = require 'child_process'
icon = null
require('fs').realpath "#{__dirname}/icon-coffee-cup.png", (exception, path) ->
exec "cygpath -w '#{path}'", (exception, stdout) ->
icon = stdout
process()
queue = []
process = ->
@StanAngeloff
StanAngeloff / reload_stylesheet.js
Created August 30, 2010 22:39
Styling XUL applications like web pages
(function() {
for (var child, i = 0, length = document.childNodes.length; i < length && (child = document.childNodes[i]); i ++) {
if (child.nodeType === 7) {
if (child.nodeValue.indexOf('aero') > 0) { /* UPDATE: 'aero' with a keyword from your file name */
child.nodeValue = 'discard="discard"';
document.removeChild(child);
}
}
}
@StanAngeloff
StanAngeloff / tools.sh
Created August 30, 2010 22:40
Get my Coffee, Compass and web server in the background, please
#!/bin/bash
stop()
{
echo "Shutting down..."
if [[ $SERVER_PID ]]; then kill -HUP $SERVER_PID; fi;
if [[ $COMPASS_PID ]]; then kill -HUP $COMPASS_PID; fi;
if [[ $COFFEE_PID ]]; then kill -HUP $COFFEE_PID; fi;
@StanAngeloff
StanAngeloff / mintty.ahk
Created September 11, 2010 20:27
MinTTY at your fingertips
; AutoHotkey script, download from:
; http://www.autohotkey.com/
; NOTE: Save this file with Windows line endings i.e. \r\n
;
cmd_line := "C:\bin\cygwin\bin\mintty.exe /bin/zsh --login"
wnd_class := "ahk_class mintty"
#c::