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 QueryNode.Literal | |
constructor: (@arg)-> | |
toJSON:()-> | |
switch typeof(@arg) | |
when 'string' then "\"#{@arg}\"" | |
when 'number', 'boolean' then @arg | |
when 'object' | |
if @arg == null | |
@arg | |
else |
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 MyDumbPresenter | |
attr_accessor :the_thing, :something | |
attr_writer :the_rest | |
def initialize(*all_the_things) | |
self.the_thing, self.something, self.the_rest = all_the_things | |
end | |
def has_the_thing? | |
if the_thing.present? |
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 A | |
def foo(a = 'foo', &b) | |
puts a | |
yield if block_given? | |
end | |
end | |
class B < A | |
def foo(a, &b) | |
puts a |
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
[{:id=>"190498", :recordtype=>"inventoryitem", :columns=>{:internalid=>{:name=>"190498", :internalid=>"190498"}, :vendor=>{:name=>"J Tillman", :internalid=>"130669"}, :displayname=>"JT-864-L-GOLD", :custitem22=>10000, :quantitybackordered=>20, :preferredstocklevel=>0, :reorderpoint=>0, :reordermultiple=>6, :custentity_po_transmission_method=>{:name=>"fax", :internalid=>"2"}, :custentity_drop_ship_all=>false, :custentity_min_order_amount=>100, :upccode=>"608134086404", :cost=>9.6, :custentity_automate_po=>true}}, {:id=>"190501", :recordtype=>"inventoryitem", :columns=>{:internalid=>{:name=>"190501", :internalid=>"190501"}, :vendor=>{:name=>"J Tillman", :internalid=>"130669"}, :displayname=>"JT-864-XL-GOLD", :custitem22=>10000, :quantitybackordered=>14, :preferredstocklevel=>0, :reorderpoint=>0, :reordermultiple=>6, :custentity_po_transmission_method=>{:name=>"fax", :internalid=>"2"}, :custentity_drop_ship_all=>false, :custentity_min_order_amount=>100, :upccode=>"608134086442", :cost=>9.6, :custentity_automate_ |
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
#!/bin/bash | |
# Instead of editing a file with <<<< ==== >>> conflict markers, this opens | |
# each "side" of the conflict markers in a two-way vimdiff window. | |
# | |
# Layout: | |
# | |
# Tab1 is a two-way diff of the conflicts. | |
# +--------------------------------+ | |
# | LCONFL | RCONFL | | |
# +--------------------------------+ |
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
{ | |
"user": { | |
"status": "errors", | |
"errors": {}, | |
"id": 7, | |
"wp_id": 6, | |
"name": "Lysanne Rodriguez", | |
"email": "[email protected]", | |
"birthdate": "1960-05-14", | |
"address1": "505 Dave Court", |
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
# gem install sqlite3 | |
# | |
# Ensure the SQLite 3 gem is defined in your Gemfile | |
# gem 'sqlite3' | |
#legacy: | |
# adapter: mysql2 | |
# database: Sofab_DW | |
# user: coll02sa | |
# password: hbZhGM1uvV7toebV | |
# host: localhost |
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
host_add() { | |
sudo echo "${2} ${1}" >> /etc/hosts | |
sudo killall -HUP mDNSResponder | |
dscacheutil -q host -a name $1 | |
} | |
host_del() { | |
sed "/$1/d" /etc/hosts > /tmp/tmp-host | |
sudo mv /tmp/tmp-host /etc/hosts | |
sudo killall -HUP mDNSResponder |
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
<div class="controls controls-row"> | |
<input id="user_birthdate_2i" name="party[start_time(2i)]" type="hidden" value="4"> | |
<input id="user_birthdate_3i" name="party[start_time(3i)]" type="hidden" value="12"> | |
<input id="user_birthdate_4i" name="party[start_time(4i)]" type="hidden" value="0"> | |
<input id="user_birthdate_5i" name="party[start_time(5i)]" type="hidden" value="0"> | |
</div> |
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
[47] pry(#<Class>)> RSpec::Core::Example.new(self,"whatever",{}, Proc.new { raise "hello" } ) | |
=> #<RSpec::Core::Example:0x007f9282327c08 | |
@example_block=nil, | |
@example_group_class=nil, | |
@exception=nil, | |
@metadata=nil, | |
@options=nil, | |
@pending_declared_in_example=nil> |