Author: Robert Virding (Co-inventor of Erlang)
Slides: pdf
Video: youtube
function! SyntaxCheckers_chef_foodcritic_IsAvailable() | |
return executable('foodcritic') | |
endfunction | |
function! SyntaxCheckers_chef_foodcritic_GetLocList() | |
" let exe = expand(g:syntastic_ruby_exec) | |
" if !has('win32') | |
" let exe = 'RUBYOPT= ' . exe | |
" endif |
require 'connection_pool' | |
require 'redis' | |
require 'metriks' | |
class RedisClientWrapper | |
def initialize(options) | |
@options = options.delete(:pool) | |
@pool = ConnectionPool.new(@options) do | |
::Redis.new(options) | |
end |
PersonApp = Ember.Application.create(); | |
PersonApp.SearchField = Ember.TextField.extend({ | |
keyUp: function(e) { | |
var search = this.get('value'); | |
this.get('controller.target').send('searchUsers', {match:search}); | |
} | |
}); | |
PersonApp.PersonView = Ember.View.extend({ | |
templateName: 'person', |
local function scale(x, min1, max1, min2, max2) | |
return min2 + ((x - min1) / (max1 - min1)) * (max2 - min2) | |
end | |
local function distance(x1, y1, x2, y2) | |
return math.sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2) | |
end | |
function radialGradient(radius) | |
local data = love.image.newImageData(radius * 2, radius * 2) |
var get = Ember.get; | |
/** | |
* @extends Ember.Mixin | |
* | |
* Implements common filter / sort / pagination behavior for array controllers | |
* */ | |
Ember.FilterSortSliceMixin = Ember.Mixin.create({ | |
filterBy: '', |
# Usage: redis-cli publish message hello | |
require 'sinatra' | |
require 'redis' | |
conns = [] | |
get '/' do | |
erb :index | |
end |
#!/bin/bash | |
# Open iPhone Simulator on default location for XCode 4.3 if found | |
[[ -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/ ]] && | |
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app | |
# Open iPhone Simulator on default location for XCode 4.2 if found | |
[[ -d /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/ ]] && | |
open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app |
(defun web-reload-iphonesimulator () | |
"Reload a page on iPhone Simulator. Run process associated to the *Messages* buffer" | |
(interactive) | |
(start-process-shell-command | |
"iphonesimulator-process" | |
"*Messages*" | |
"osascript -e 'tell application \"System Events\"' -e 'tell process \"iPhone Simulator\"' -e 'click button \"Reload\" of window 1' -e 'end tell' -e 'end tell'")) |
%% @doc Uses SAX to convert an XML document into a simple nested-tuple | |
%% structure. Ignores namespaces. | |
-module(xmlsimple). | |
-export([file/1, | |
string/1, | |
emit/1, | |
emit_file/2]). | |
-include_lib("xmerl/include/xmerl.hrl"). |