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
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ] ; then | |
source "$rvm_path/scripts/rvm" | |
rvm use `cat .ruby-version`@`cat .ruby-gemset` | |
fi | |
if [ -f "~/.oh-my-zsh/custom/openssl.zsh" ] ; then | |
source "~/.oh-my-zsh/custom/openssl.zsh" | |
fi |
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
class Obj | |
def self.new_method(name, options = {}) | |
define_method(name) { options } | |
end | |
end | |
o = Obj.new | |
options = { one: :two } | |
Obj.new_method('baz', options) |
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
//// | |
// Makes a div appear to be a stacked like 3 sheets of paper with each | |
// sheet offset by a given amount. | |
// | |
// Example: @include stacked(5px); | |
@mixin stacked($offset) { | |
border: 1px solid #494949; | |
&:after, &:before { | |
background: inherit; |
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
var _ = require('lodash'); | |
var Q = require('q'); | |
var AWS = require('aws-sdk-q'); | |
function SnsPublisher(topic, options) { | |
var topicOptions = { | |
params: { | |
TopicArn: topic | |
} | |
}; |
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_relative './upload_store' | |
class PhotoClaimer | |
attr_writer :photo_source | |
attr_writer :upload_storage_source | |
class FileNotFound < RuntimeError; end | |
def initialize(user_id, file_name) | |
@user_id = user_id |
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 Categories | |
ALL = [ | |
:BUSINESS, | |
:CALL, | |
:CONTACT, | |
:KNOWLEDGE, | |
:ENTERTAINMENT, | |
:EMAIL, | |
:HELP, | |
:TRAVEL, |
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
class Price | |
include Comparable | |
attr_reader :amount | |
def initialize(amount) | |
@amount = amount | |
end | |
def <=>(obj) |
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
➜ ~ rvm install jruby-1.6.3 | |
jruby-1.6.3 - #downloading jruby-bin-1.6.3, this may take a while depending on your connection... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 14.7M 100 14.7M 0 0 459k 0 0:00:32 0:00:32 --:--:-- 410k | |
jruby-1.6.3 - #extracting jruby-bin-1.6.3 to /Users/brschaefer/.rvm/src/jruby-1.6.3 | |
jruby-1.6.3 - #extracted to /Users/brschaefer/.rvm/src/jruby-1.6.3 | |
Building Nailgun | |
jruby-1.6.3 - #installing to /Users/brschaefer/.rvm/rubies/jruby-1.6.3 | |
jruby-1.6.3 - adjusting #shebangs for (jrubyc jirb_swing jirb jgem rdoc ri spec autospec testrb ast generate_yaml_index.rb). |
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
// Question: Can you do something like this without using interface-based injection? | |
@RunWith(SpringJUnit4ClassRunner.class) | |
@ActiveProfiles("test") | |
public class FakeDownloadUtilTest extends BaseTest { | |
@Autowired | |
DownloadUtil downloadUtil; | |
@Test | |
public void testFaked() { |
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
#!/bin/zsh | |
for file in $(awk 'FNR == 1 && !/^#\!/ { print FILENAME; nextfile }' **/*.rb); do | |
echo $file | |
sed -i 1i'# encoding: utf-8' $file | |
done |