Skip to content

Instantly share code, notes, and snippets.

View kulicuu's full-sized avatar

J Wylie Кулик kulicuu

View GitHub Profile
# 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
@zackify
zackify / gist:861d6ed399f2ffa55c7d
Created May 12, 2015 04:53
ES6 classes and module loading is too easy with webpack:)
module.exports = {
entry: {
jobs: 'app.jsx'
},
output: {
filename: "[name].bundle.js",
chunkFilename: "[id].bundle.js"
},
module: {
loaders: [
@AnsonT
AnsonT / coffee-jquery.jade
Created July 29, 2011 18:04
Client-side Coffeescript with Jade and JQuery
!!! 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'
@leostera
leostera / pack.coffee
Created September 13, 2012 16:01
SocketStream Asset Packager with Event Triggering
# 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')
@akre54
akre54 / react-svg-patch.coffee
Last active November 23, 2015 18:02
React SVG element monkeypatch
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
@lykmapipo
lykmapipo / gist:6a8f56aec23fda81796530ae87b13ec8
Created April 27, 2016 11:59 — forked from klovadis/gist:5170485
A Lua script for Redis that allows you to set hash values based on a dictionary table
-- 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
@durango
durango / app.js
Created December 3, 2012 15:41 — forked from katanacrimson/app.js
nodejs app - expressjs 3.0 + socket.io v9 + passport + redis
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'),
@robertmarsal
robertmarsal / gist:9feaa9150926efa4175a
Created December 17, 2014 21:09
Install f.lux on Ubuntu 14.10
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
@klovadis
klovadis / gist:5170446
Created March 15, 2013 14:59
Two Lua scripts for Redis to turn HGETALL and HMGET into dictionary tables
-- 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
@joshski
joshski / flame.lua
Created April 21, 2013 10:52
Generates a little flame. Works in Codea.
-- 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
}