Skip to content

Instantly share code, notes, and snippets.

View StanAngeloff's full-sized avatar

Stan Angeloff StanAngeloff

View GitHub Profile
% sass page.scss page.css
Errno::ENOENT: No such file or directory - page.scss
Use --trace for backtrace.
fn = ->
return
fn2 = ->
if false
return
alert fn()
alert fn2()
<jashkenas> StanAngeloff: I was wrong about it in the first place. The last version of JavaScript that had problems with switch was JavaScript 1.3 ....
<jashkenas> Around IE5 days, I think ...
<jashkenas> Since then, switch has been reliable on any expression ... I thought there were still browsers around that couldn't handle it.
<jashkenas> mea culpa.
--- viKeyBinder.js.original 2010-09-16 13:14:16.198295100 +0300
+++ viKeyBinder.js 2010-09-16 13:12:20.045651500 +0300
@@ -744,6 +744,44 @@
'cmd_delete': 'cmd_vim_cutChar'
};
+// List of commands that the '.' can repeat. If a command is not mentioned in
+// here, executing it while in Insert mode resets the buffer
+var repeatableCommands = [
+ 'cmd_back', 'cmd_backSmart', 'cmd_beginningOfWord',
@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::
@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 / 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 / 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 = ->
ZSH_BOOKMARKS="$HOME/.zsh/cdbookmarks"
function cdb_edit() {
$EDITOR "$ZSH_BOOKMARKS"
}
function cdb() {
local index
local entry
index=0
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'