This is the code that powers the parallax effect on codetunes.com.
I think it’s quite chaotic at the moment and waits for being released as open source when it’s cleaned up.
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) | |
#clojure | |
(filter #(even? % ) [1 2 3 4]) |
# Consider the following | |
class ApplicationController < ActionController::Base | |
helper_method :current_filter | |
private | |
def current_filter | |
ActiveSupport::StringInquirer.new(params[:filter] || '') | |
end | |
end |
This is the code that powers the parallax effect on codetunes.com.
I think it’s quite chaotic at the moment and waits for being released as open source when it’s cleaned up.
<?php | |
header("Content-Disposition: binary/data"); | |
preg_match('/([^\/]+)\/favicon.ico/', $_SERVER['REQUEST_URI'], $matches); | |
echo (file_exists(getenv('cachedir').'/'.$matches[1]) ? file_put_contents(getenv('cachedir').'/'.$matches[1], file_get_contents('http://'.$matches[1].'/favicon.ico')) : file_get_contents(getenv('cachedir').'/'.$matches[1])); | |
// see that. thats fucking magestic is what it is. |
default_run_options[:pty] = true # Must be set for the password prompt from git to work | |
set :ssh_options, { :forward_agent => true } | |
set :user, "smash" | |
set :application, "SMASH! Join Us" | |
set :domain, "linode.smash.org.au" | |
set :deploy_to, "/var/www/smash.org.au/2014-staff-call" | |
set :shared_path, "#{deploy_to}/shared" | |
set :use_sudo, false | |
-- | |
-- Copyright © 2013-2014 Anchor Systems, Pty Ltd and Others | |
-- | |
-- The code in this file, and the program it is a part of, is | |
-- made available to you by its authors as open source software: | |
-- you can redistribute it and/or modify it under the terms of | |
-- the 3-clause BSD licence. | |
-- | |
module Main where |
data Person = Person { | |
firstName :: String | |
, lastName :: String | |
} | |
data Person' = Person' { | |
firstName' :: !String | |
, lastName' :: String | |
} |
func coalesceMaps(args ...map[string]interface{}) map[string]interface{} { | |
var m map[string]interface{} | |
if len(args) > 1 { | |
m = make(map[string]interface{}) | |
for _, arg := range args { | |
m = clobberMerge(m, arg) | |
} | |
} else { |
require 'rspec' | |
require 'rspec/autorun' | |
module Foo | |
end | |
RSpec.describe Foo do | |
it "tests" do | |
expect(subject.class).to eq(Foo) | |
end |
# GitHub::SQL - a helping hand for SQL in a rails app. | |
# | |
# Built for MySQL, adaptations and updates welcome. | |
# | |
# Authors/maintainers: @jbarnette, @zerowidth, et. al. | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 GitHub, Inc. | |
# |