Skip to content

Instantly share code, notes, and snippets.

<x-physics-boundry constant-acceleration-x="1000">
<x-physics-body fix-y>
<div class="menu">All your menu stuff</div>
</ul>
</x-physics-boundry>
module.exports = function(grunt) {
grunt.registerMultiTask('write-component', 'write new files to component.json file list', function() {
var componentFile = grunt.file.readJSON('component.json')
componentFile.scripts = this.files[0].src
grunt.file.write('component.json', JSON.stringify(componentFile, null, 2))
})
grunt.initConfig({
"write-component": {
select-left () {
tmux select-pane -L
}
select-right () {
tmux select-pane -R
}
select-up () {
tmux select-pane -U
}
func! MoveWithTmux(keypressed,direction)
let k = a:keypressed
let d = a:direction
" get the old window number
let oldw = winnr()
exec "wincmd " . k
let neww = winnr()
" If we are in the same split, we must be at a boundary so tell tmux to switch split
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="biranorvm"
# Example aliases
@xcoderzach
xcoderzach / awaitApples.coffee
Created December 23, 2011 23:56
Awaiting Apples
# this is what it would look like,
# Every language feature that isn't a function has to be turned into one :-(
awaitWhile {apples: []}, ({apples}) -> numThatAreTasty(apples) < 10
, (await) ->
await (defer) -> getAnApple defer "apples[]"
, ({apples}) ->
console.log apples
awaitWhile {apples: [], numTasty:0}, ({numTasty}) -> numTasty < 10
@xcoderzach
xcoderzach / recommender.coffee
Created December 20, 2011 23:15 — forked from malgorithms/recommender.coffee
Fake Recommender class for CoffeeScript/tame discussion
```coffeescript
class Recommender
getRecommendations: (search_params, cb) ->
# Do 2 things at once:
# - check if we have a logged in user, get their info
# - fire off distributed requests for search queries
# ------------------------------------------------------------------------
require('fibers')
function sleep(ms) {
var fiber = Fiber.current;
setTimeout(function() {
fiber.run()
}, ms)
yield()
}

this erb

  <ul class = "blogPosts">
    <% blogPosts.each |blogPost| %>
    <li class = "blogPost">
      <div class = "title"><%= blogPost.title %></div>
      <div class = "content"><%= blogPost.content %></div>
      <ul class = "comments">
        <% blogPost.comments.each |comment| %>
var http = require('http')
, io = require('socket.io') // for npm, otherwise use require('./path/to/socket.io')
, clients = {}
, server = http.createServer(function(req, res){
// your normal server code
})
server.listen(80)
function sendToClient(id, message) {