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
# Configuration dotfiles for various command line tools. |
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
#JOSHDO: ${1:"do something"} (`date "+%m/%d/%y"`) | |
$2 |
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
function updateButtonState(){ | |
browsed && enable(UPLOAD); | |
selected && enable(SELECT); | |
(browsed && selected) && enable(REPLACE); | |
function enable(i){ | |
buttons.eq(i).removeAttr("disabled"); | |
} | |
} |
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 Object | |
def nil_or | |
self | |
end | |
def not_nil? | |
true | |
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
<script> | |
Event.observe(window, "load", function(){ | |
$("payment_type_id").value = ""; | |
}); | |
</script> |
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
def self.assessment_note_value_for(company, question) | |
if self.assessment_question_value_for(company, question).not_nil? | |
if(set = company.question_set) | |
if(CUSTOM_QQ_NOTES[set]) | |
return CUSTOM_QQ_NOTES[set][question.dss_version][question.number] | |
end | |
end | |
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
-(IBAction)show:(id)sender{ | |
CGRect frame = [aView frame]; | |
frame.origin.y = [[self view] bounds].size.height; | |
[aView setFrame:frame]; | |
[[self view] addSubview:aView]; | |
[UIView beginAnimations:@"slide up" context:NULL]; | |
frame.origin.y = [[self view] bounds].size.height - frame.size.height; | |
[aView setFrame:frame]; | |
[UIView commitAnimations]; |
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 Foo | |
module Bar | |
class Baz | |
def self.quux | |
puts "hello, world" end end end end | |
Foo::Bar::Baz.quux() | |
module Fred |
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 'bundler/setup' | |
Bundler.require(:default) | |
module Fred; module Barny; module Wilma; def self.betty; "hello, bedrock!" end end end end | |
app = proc do |env| [200, { 'Content-Type' => 'text/html' }, Fred::Barny::Wilma.betty()]; end | |
run app |
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
def self.with_memory_db | |
old_db_config = ActiveRecord::Base.connection_config | |
ActiveRecord::Base.establish_connection :adapter=>"sqlite3", :database=>":memory:" | |
yield(ActiveRecord::Base.connection) if block_given? | |
ensure | |
ActiveRecord::Base.establish_connection old_db_config | |
end |
OlderNewer