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
Module Module1 | |
Sub Main() | |
Dim intNumber1, intNumber2 as Integer | |
Dim strOperator As String | |
Do | |
strOperator = InputBox("Please choose an operator to use: +, -, *. Or type Q to quit.") | |
If strOperator = "Q" Then Exit | |
intNumber1 = InputBox("Please Enter The Value For The First Number") |
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
# 1 Copy the .framework files to your vendor folder e.g. vendor/RobotUIKit.framework | |
# 2 Copy the .bundle file to your resources folder e.g. resources/RobotUIKit.bundle | |
# 3 Add this to your Rakefile | |
app.libs << "-lstdc++ -all_load -ObjC -lsqlite3" | |
app.frameworks << 'ExternalAccessory' | |
app.frameworks << 'CoreMotion' | |
app.vendor_project('vendor/RobotUIKit.framework', :static, |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
describe "#get" do | |
it "adds an auth token to the params when given" do | |
stub_request(:get, "http://fcp.dev/api/?auth_token=token"). | |
to_return(body: "{\"Hello\":\"World\"}", content_type: "application/json") | |
@body = nil | |
@server.auth_token = 'token' | |
@server.get('http://fcp.dev/api/') do |body| | |
@body = body | |
resume |
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
The flow: | |
POST a form to braintree with customer details (our payment forms do this) | |
Braintree redirects to a URL we provided in the form | |
On this URL we ask braintree to confirm the result they give us | |
We create a customer | |
We set up the charges (different per payment plan) | |
The problem: | |
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
>> Unit('1 g') >> 'ounce' | |
=> 160000045359237 oz | |
>> Unit('1 ounce') >> 'g' | |
=> 453592371600000 g | |
>> Unit('1 mm').convert_to 'cm' | |
=> 110 cm | |
>> Unit('10 ounce') >> 'g' | |
=> 45359237160000 g | |
>> Unit('100 ounce') >> 'g' | |
=> 4535923716000 g |
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
it 'should sign up and redirect' do | |
user = Fabricate.build(:user) | |
visit signup_path | |
fill_in "Email", with: user.email | |
fill_in "Password", with: user.password | |
fill_in "Confirmation", with: user.password_confirmation | |
fill_in "Company name", with: user.company.name | |
click_button "Sign Up" | |
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
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" end |
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
# I run this script to install brew, git and rbenv. At this point I can run my chef | |
# cookbooks to set up the rest of my base applications. | |
# | |
# Remote Login turned on in System Preferences -> Sharing | |
echo "Installing zsh" | |
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh | |
echo "Done" | |
echo 'Force zsh as the new $SHELL' |
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
require 'net/ssh' | |
class Host | |
def initialize(host, user, options={}) | |
@ssh = Net::SSH.start(host, user, options) | |
end | |
def close | |
@ssh.close | |
end |