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 'rest_client' | |
require 'digest/sha1' | |
require 'base64' | |
require 'xmlsimple' | |
##time | |
time = Time.new | |
month = time.month | |
day = time.day | |
hour = time.hour |
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
my $file_contents = do { | |
local $/; | |
local @ARGV = ( $filename ); | |
<> | |
}; |
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 | |
require 'httparty' | |
require 'pp' | |
require 'nokogiri' | |
require 'mail' | |
options = { :address => "smtp.gmail.com", | |
:port => 587, | |
:user_name => 'seancvolusion', |
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 Employee(object): | |
def __init__(self, name): | |
self.name = name | |
def greet(self, other): | |
print "Hello, %s" % other.name | |
class CEO(Employee): | |
def greet(self, other): | |
print "Get back to work, %s!" % other.name |
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 Triangle(object): | |
number_of_sides = 3 | |
def __init__(self, angle1, angle2, angle3): | |
angle1 = self.angle1 | |
angle2 = self.angle2 | |
angle3 = self.angle3 | |
def check_angles(self): | |
if self.angle1 + self.angle2 + self.angle3 == 180: | |
return 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
--- | |
some_attribute: | |
describes_more: | |
- blue | |
- green | |
- other_thing_nested: | |
-round | |
-offer | |
second_thing: | |
- more shit |
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
GIT | |
remote: git://github.com/kalleth/spree_gift_card.git | |
revision: 8247fe88732f263049ac73c3bd13ee1b13030299 | |
branch: 2-4-stable-initforthe | |
specs: | |
spree_gift_card (1.0.0.beta) | |
durable_decorator (~> 0.2.0) | |
spree_api (~> 2.4.0) | |
spree_backend (~> 2.4.0) | |
spree_core (~> 2.4.0) |
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
[email protected] | |
1:18 oh | |
1:18 i work at a company called Indeed. | |
Petie | |
1:19 i know, my brain just wasn't fully operational | |
[email protected] | |
1:19 You want this, dont you? | |
1:19 I can FEEL your anger |
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
Dir.glob('/var/local/project/logs/**').delete_if{|item| item.match(/\.gz/)}.each do |file| | |
if File.stat(file).size / 1048576 > 100 | |
last_lines = IO.readlines(file).last(1000).join | |
File.open(file, 'w') {|f| f.write(last_lines); f.close} | |
end | |
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
One of the great mysteries of Christianity is the concept of the Trinity. While there is only one God in Christianity, there are three "persons" (Father, Son, Holy Spirit) that still add up to one God. | |
Create a God class whose instances always add up to 1. This isn't as easy as it sounds! If you get stuck on a Fixnum coersion error, here's some good reading: | |
http://www.mutuallyhuman.com/blog/2011/01/25/class-coercion-in-ruby/ |