curl https://gist.github.com/raw/970438/caff9a09ed2d223b1123a69ede17cb19ad352af9/build.sh | sh
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
# Everything is an Expression | |
-> | |
greeting = 'Hi CoffeeScripter' | |
# Expect it's undefined | |
-> | |
greeting = 'Hi CoffeeScripter' | |
return undefined |
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 ActiveRecord | |
# Allows embedding of ActiveRecord models. | |
# | |
# Embedding other ActiveRecord models is a composition of the two | |
# and leads to the following behaviour: | |
# | |
# - Nested attributes are accepted on the parent without the _attributes suffix | |
# - Mass assignment security allows the embedded attributes | |
# - Embedded models are destroyed with the parent when not appearing in an update again |
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
require 'siren' | |
# The JsonHelper adds a possibility to query JSON data with a simple query language. | |
# Read more about the Siren JSONQuery implementation at: https://github.com/jcoglan/siren | |
# | |
# @author Michael Kessler | |
# | |
module JsonHelper | |
def json(query) |
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 RSpec::Rails | |
module WidgetExampleGroup | |
extend ActiveSupport::Concern | |
extend RSpec::Rails::ModuleInclusion | |
include RSpec::Rails::RailsExampleGroup | |
include ActionView::TestCase::Behavior | |
include RSpec::Rails::ViewAssigns | |
include RSpec::Rails::Matchers::RenderTemplate | |
include RSpec::Rails::BrowserSimulators |
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
# | |
# Calls a function that is defined as a String | |
# | |
# 'ws.extranett.subdomain_for'.call('argument1', 'argument2') | |
# | |
# Will call the function subdomain_for bound on the object extranett | |
# with arguments 'argument1' and 'argument2' | |
# | |
String::call = (args...) -> |
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
#!/usr/bin/env ruby | |
# | |
# Upload events organized by year and event name to Flickr. | |
# | |
# Your directory structure must be: year/event/... and it can contain many subdirectories and media files. | |
# | |
# The script will upload all fotos from an event with a title "Event name Year". The photo will get its | |
# tags from the filename, except the last token, e.g. | |
# band_famous_concert_12.jpg will be tagged with band, famous and concert. | |
# |
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
this.addMatchers({ | |
toBe: (selector) -> $(@actual).is(selector) | |
toBeA: (clazz) -> @actual.constructor == clazz | |
toBeAn: (clazz) -> @actual.constructor == clazz | |
toBeAnimated: -> $(@actual).queue.length > 0 | |
toBeAnInstanceOf: (instance) -> @actual instanceof instance | |
toBeChecked: -> $(@actual).is ':checked' | |
toBeDisabled: -> $(@actual).attr 'disabled' | |
toBeElement: (element) -> $(@actual).get(0).tagName == element.toUpperCase() | |
toBeEmpty: -> @actual == '' || @actual.length == 0 |
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
# | |
# Rake task for generating the different jspec run configuration from | |
# a single, central configuration file that supports file globbing | |
# | |
# Author: Michael Kessler aka. netzpirat | |
# License: MIT | |
# | |
namespace :jspec do | |
desc 'Generate the run configurations for all environments' |
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
gem install ruby-debug19 -- --with-ruby-include=/home/michi/.rvm/src/ruby-1.9.2-preview3 |