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 'rubygems' | |
require 'mechanize' | |
require 'uri' | |
url = "http://instagr.am/p/WOkyj" | |
@mech = Mechanize.new | |
@page = @mech.get(url) |
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
=begin | |
The Kindle clippings are each accompanied with a lot of useful information. However, when you're scanning over them it can get annoying to keep seeing them formatted as such: | |
the mystical process of extracting value (money) from idle IP assets | |
========== | |
Essentials of Licensing Intellectual Property (Alexander I. Poltorak, Paul J. Lerner) | |
- Highlight on Page 16 | Added on Friday, 25 November 11 10:42:19 Greenwich Mean Time | |
The script below is a tiny bit of ruby that will strip out all the dross and leave behind: |
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
if text.reply <= 1 hour | |
girl.interested = true | |
elsif text.reply.include? '?' | |
girl.interested = true | |
elsif | |
girl.interested = false | |
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
source 'http://rubygems.org' | |
gem 'rails', '3.1.1' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
gem 'execjs' | |
gem 'therubyracer' |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/HTML" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en" xml:lang="en"> | |
<head> | |
<!-- | |
mm `7MM | |
MM MM | |
,pP"Ybd mmMMmm ,6"Yb. `7Mb,od8 MM ,MP'`7MMpMMMb. .gP"Ya ,pP"Ybd ,pP"Ybd | |
8I `" MM 8) MM MM' "' MM ;Y MM MM ,M' Yb 8I `" 8I `" | |
`YMMMa. MM ,pm9MM MM MM;Mm MM MM 8M"""""" `YMMMa. `YMMMa. |
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 AnalyticsController < ApplicationController | |
def download | |
consumer = OAuth::Consumer.new('******.apps.googleusercontent.com', '******', | |
{:site => 'https://www.google.com', | |
:request_token_path => '/accounts/OAuthGetRequestToken', | |
:access_token_path => '/accounts/OAuthGetAccessToken', | |
:authorize_path => '/accounts/OAuthAuthorizeToken'} |
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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :check_auth | |
def check_auth | |
@client = Google::APIClient.new | |
@client.authorization.client_id = '************.apps.googleusercontent.com' | |
@client.authorization.client_secret = '***************' |
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.create_deal(title, value) | |
post("/deals/title=#{title}&value=#{value}") | |
end | |
#threw this error: // #<HTTParty::Response:0x10f4cbf98 parsed_response={"success"=>false, "error"=>"Internal Server Error occurred. Pipedrive staff was notified about this."}, @response=#<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>, @headers={"connection"=>["close"], "server"=>["nginx/0.7.67"], "access-control-allow-origin"=>["*"], "content-type"=>["application/json, charset=UTF-8"], "content-length"=>["100"], "x-powered-by"=>["PHP/5.3.3-7+squeeze8"], "date"=>["Tue, 25 Sep 2012 08:09:34 GMT"]}> |
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 Test | |
attr_reader :state | |
def initialize(state) | |
@state = state | |
end | |
private | |
def update_state(state) | |
@state = state |
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
%w(a b c d e f).map(&:to_s) # => ["a", "b", "c", "d", "e", "f"] | |
%w(a b c d e f).pop # => "f" | |
%w(a b c d e f).fetch(3) # => "d" | |
%w(a b c d e f).join(', ') # => "a, b, c, d, e, f" |
OlderNewer