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 FactoryGirl::Syntax::Methods | |
def find_or_create(name, attributes = {}, &block) | |
factory = FactoryGirl.factory_by_name(name) | |
klass = factory.build_class | |
factory_attributes = FactoryGirl.attributes_for(name) | |
attributes = factory_attributes.merge(attributes) | |
result = klass.find_by(attributes, &block) |
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
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb | |
/Users/watts/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError) | |
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb | |
/Users/watts/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError) | |
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb | |
/Users/watts/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError) | |
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.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
class Person | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
end | |
def shout_name | |
@name.upcase | |
end |
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 | |
# | |
# This script is an astonishing feat of top notch | |
# rockstar craftsmanship. It totally uses artificial | |
# intelligence to extract colors out of tmTheme and | |
# build an itermcolors scheme file for iTerm2. | |
# | |
# I know this sounds crazy, but it actually knows | |
# approximately what colors should be used in the | |
# ANSI list, and tries to find nearest colors from |
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
session: | |
name: "rails" | |
windows: | |
- name: "CODE" | |
layout: 8590,178x45,0,0{114x45,0,0,3,63x45,115,0,4} | |
panes: | |
- cmd: "vim" | |
focus: true | |
- cmd: "guard" | |
- name: "SERVER" |
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
tell application "System Events" | |
set activeApp to name of first process whose frontmost is true | |
end tell | |
if application "Slack" is running and activeApp is not equal to "Slack" then | |
tell application "Notifications Scripting" | |
# set show event handler results to true | |
set event handlers script path to (path to me) | |
display notification "Slack is running" message "Are you waiting on an @mention?" action button "No" other button "Yes" |
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 file will be used in the snippet below. | |
-- This is the name of your local database | |
USE local_db | |
-- Replacing all instances of your production URL with your local URL | |
UPDATE wp_options SET option_value = replace(option_value, 'http://sitename.com', 'http://sitename.local') | |
WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://sitename.com', 'http://sitename.local'); | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://sitename.com', 'http://sitename.local'); |
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 "roles/config" | |
module Adam | |
class Roles | |
end | |
end |
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
<?php if ( ! defined('EXT') ) exit('Invalid file request'); | |
/** FINAL | |
* LDAP Authentication | |
* | |
* ### EE 2.1 version ### | |
* | |
* Based on: NCE LDAP | |
* http://code.google.com/p/ee-ldap-extension/ | |
* License: "if you've used this module and found that it needed something then please hand it back so that it can be shared with the world" | |
* Site: http://code.google.com/p/ee-ldap-extension/wiki/Introduction |
NewerOlder