Skip to content

Instantly share code, notes, and snippets.

@antris
antris / application.js
Created Apr 21, 2015
IntelliJ IDEA "go to definiton" bug
View application.js
var {functionA, functionB} = require('./module')
functionA() // hitting cmd+B does not go to the definition
View gist:a39554e01ccdc243f17c
var React = require('react')
var Immutable = require('immutable')
var Bacon = require('baconjs')
var NextPiecesView = require('./views/nextPiecesView')
var {worldStream} = require('./playField')
var PlayField = require('./views/playFieldView')
var input = require('./input')
var history = Immutable.List.of()
View gist:5502548
# No more templates: the power of abstraction in CoffeeScript and Underscore
## Terse syntax for creating DOM elements
$('div') # Find div elements in DOM
$('<div>') # Create a div element, detached from DOM
## Creating DOM trees
$('<article>').append(
$('<h1>').text('My blog post'),
$('<p>').text("
@antris
antris / .profile
Created Jan 18, 2012
Show git or Mercurial branch in command prompt
View .profile
hg_branch() {
test -e .hg/branch && echo " hg:$(cat .hg/branch)"
}
git_branch() {
test -e .git && git branch | grep \* | awk '{ printf " git:" substr($0, index($0,$2)) }'
}
export PS1='\h:\w$(hg_branch)$(git_branch) $ '
@antris
antris / gist:1369797
Created Nov 16, 2011
JavaScript Date comparisons are WEIRD
View gist:1369797
new Date() > new Date() // false
new Date() < new Date() // false
new Date() == new Date() // false
new Date() >= new Date() // true
new Date() <= new Date() // true