This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kata description: http://codingdojo.org/cgi-bin/index.pl?KataTennis | |
module Tennis | |
class Player | |
attr_reader :name, :points_won | |
def initialize(name) | |
@name = name | |
@points_won = 0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: { | |
jobs: 'app.jsx' | |
}, | |
output: { | |
filename: "[name].bundle.js", | |
chunkFilename: "[id].bundle.js" | |
}, | |
module: { | |
loaders: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
html(lang='en') | |
head | |
title Title | |
script(type='text/javascript', src='javascripts/jquery.js') | |
script(type='text/javascript', src='http://jashkenas.github.com/coffee-script/extras/coffee-script.js') | |
:coffeescript | |
$(document).ready -> alert 'Hello World' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Asset Packer | |
# ------------ | |
# Packs all CSS, JS and HTML assets declared in the ss.client.define() call to be sent upon initial connection | |
# Other code modules can still be served asynchronously later on | |
log = console.log | |
require('colors') | |
fs = require('fs') | |
pathlib = require('path') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReactDOM = require 'react/lib/ReactDOM' | |
ReactElement = require 'react/lib/ReactElement' | |
ReactElementValidator = require 'react/lib/ReactElementValidator' | |
SVGDOMPropertyConfig = require 'react/lib/SVGDOMPropertyConfig' | |
MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE | |
createFactory = if __DEV__ | |
ReactElementValidator.createFactory | |
else | |
ReactElement.createFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- sets all fields for a hash from a dictionary | |
local hmset = function (key, dict) | |
if next(dict) == nil then return nil end | |
local bulk = {} | |
for k, v in pairs(dict) do | |
table.insert(bulk, k) | |
table.insert(bulk, v) | |
end | |
return redis.call('HMSET', key, unpack(bulk)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
passport = require('passport'), | |
LocalStrategy = require('passport-local').Strategy, | |
connect = require('connect'), | |
http = require('http'), | |
path = require('path'), | |
util = require('util'), | |
fs = require('fs'), | |
redis = require('redis'), | |
cookie = require('cookie'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-glade2 python-appindicator | |
git clone https://github.com/Kilian/f.lux-indicator-applet.git | |
cd f.lux-indicator-applet | |
chmod +x setup.py | |
sudo ./setup.py install | |
fluxgui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- gets all fields from a hash as a dictionary | |
local hgetall = function (key) | |
local bulk = redis.call('HGETALL', key) | |
local result = {} | |
local nextkey | |
for i, v in ipairs(bulk) do | |
if i % 2 == 1 then | |
nextkey = v | |
else | |
result[nextkey] = v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- a little flame in a functional style | |
function particle(step, style, t) | |
local newStyle = step(style, t) | |
return { | |
style = newStyle, | |
next = function() | |
return particle(step, newStyle, t + 1) | |
end | |
} |
OlderNewer