This file contains hidden or 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
class Array | |
def method_missing(method_sym, *arguments, &block) | |
if method_sym.to_s =~ /^((pen)+)ultimate$/ | |
pen_index = 1 + ($1.length/3) | |
self[-pen_index] | |
else | |
super | |
end | |
end | |
end |
This file contains hidden or 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
Paste solutions in the comments below. Don't forget to make it code using GitHub markdown. |
This file contains hidden or 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
// Removed the HTML for readability | |
<?php | |
$Directory = opendir("../"); | |
while($entryName = readdir($Directory)) { | |
$dirArray[] = $entryName; | |
} | |
closedir($Directory); |
This file contains hidden or 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
# https://github.com/rtomayko/tilt/blob/master/lib/tilt.rb | |
# Try each of the classes until one succeeds. If all of them fails, | |
# we'll raise the error of the first class. | |
first_failure = nil | |
klasses.each do |klass| | |
begin | |
klass.new { '' } | |
rescue Exception => ex |
This file contains hidden or 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
Hey Tom (and others), | |
At the moment ordering of links on EmberWatch is strictly | |
chronological, and for the different content types chronological is | |
defined thus: | |
- Talks: date of delivery | |
(when the talk was given, not when it was posted online) | |
- Tutorials, Screencasts: date of publication |
This file contains hidden or 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
$options['joins'] = array( | |
array('table' => 'images_news_articles', | |
'alias' => 'ImagesNewsArticle', | |
'type' => 'left outer', | |
'conditions' => array( | |
'NewsArticle.id = ImagesNewsArticle.news_article_id' | |
) | |
), | |
array('table' => 'images', | |
'alias' => 'Image', |
This file contains hidden or 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
source 'https://rubygems.org' | |
gem 'rake-pipeline', github: 'livingsocial/rake-pipeline' | |
gem 'rake-pipeline-web-filters', github: 'wycats/rake-pipeline-web-filters' | |
gem 'uglifier' |
This file contains hidden or 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 'koala' | |
client = Koala::Facebook::API.new(user_access_token) | |
picture_response = client.get_object('me', fields: "picture.width(200).height(200)") | |
# { "id"=>"37100599", | |
# "picture" => { | |
# "data"=> { | |
# "url"=>"https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash4/c205.44.551.551/s200x200/314850_740167411782_1416727952_n.jpg", | |
# "width"=>200, | |
# "height"=>200, |
This file contains hidden or 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
Issue about better documentation: | |
https://github.com/emberjs/ember.js/issues/2319 | |
Handlebars PreCompiler, Barber: | |
https://github.com/tchak/barber | |
SO Question about PreCompilation with Rake::Pipeline: | |
http://stackoverflow.com/questions/8558062/setting-up-rake-pipeline-for-use-with-handlebars-alongside-google-app-engine | |
Blog Post about Barber Handlebars precompilation: |
This file contains hidden or 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 Pipeline with MiniSpade | |
http://www.javascriptturnsmeon.com/javascript-build-process-rake-pipeline-with-minispade/ | |
# Minispade | |
https://github.com/wycats/minispade | |
OlderNewer