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
#!/usr/bin/env ruby | |
# http://stackoverflow.com/questions/12836847/how-to-establish-a-ssl-enabled-tcp-ip-connection-in-ruby | |
require 'socket' | |
require 'openssl' | |
socket = TCPSocket.open('crew-access-data.ual.com', 34135) | |
ssl_context = OpenSSL::SSL::SSLContext.new | |
ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context) | |
ssl_socket.sync_close = true |
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
u = User.create | |
id = u.id | |
# The above should and does essentially do u.sessions.create() | |
# I expect after initializing this for it to test !session_valid? == false && !new_record? == false | |
u = User.find(id) | |
# I expect after initializing this for it to test !session_valid? == false && !new_record? == false |
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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
#ruby-gemset=railstutorial_rails_4_0 | |
gem 'rails', '4.0.4' | |
group :development do | |
gem 'sqlite3', '1.3.8' | |
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
NoMethodError in OrderitemsController#create | |
undefined method `stringify_keys' for #<Order:0x2c630a0> | |
Application Trace | Framework Trace | Full Trace | |
app/controllers/orderitems_controller.rb:11:in `create' | |
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
<cfoutput> | |
<table border="1" width="100%" height="100%"> | |
<tr> | |
<cfloop index="x" from="1" to="7"> | |
<th>#dayOfWeekAsString(x)#</th> | |
</cfloop> | |
</tr> | |
</cfoutput> | |
<cfset firstOfTheMonth = createDate(year(now()), month(now()), 1)> |
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
// Place all the styles related to the home controller here. | |
// They will automatically be included in application.css. | |
// You can use Sass (SCSS) here: http://sass-lang.com/ | |
#monthName { | |
text-align: center; | |
position: absolute; | |
top: 0; | |
display: inline; | |
a { | |
text-decoration: none; |
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 | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
appify v3.0.0 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
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
#!/usr/bin/env ruby | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points | |
# | |
# * A set of three numbers (other than ones) is worth 100 times the |
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
[myxml] | |
<item> | |
<title>Book1</title> | |
<author>Bob</author> | |
<link>http://url1.com</link> | |
</item> | |
<item> | |
<title>Book2</title> | |
<author>Bob</author> | |
<link>http://url1.com</link> |