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
solveRPN :: String -> Double | |
solveRPN [] = 0 | |
solveRPN s = head $ foldl solveRPN' [] $ words s | |
solveRPN' :: [Double] -> String -> [Double] | |
solveRPN' (x2:x1:stack) "+" = (x1 + x2):stack | |
solveRPN' (x2:x1:stack) "-" = (x1 - x2):stack | |
solveRPN' (x2:x1:stack) "*" = (x1 * x2):stack | |
solveRPN' stack num = (read num):stack |
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
import Control.Monad | |
-- Compiles | |
loadPaths :: FilePath -> IO [Int] | |
loadPaths filename = do strings <- liftM lines $ readFile filename | |
return (map read strings) | |
-- Doesn't Compile | |
loadPaths :: FilePath -> IO [Int] |
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 'nokogiri' | |
require 'open-uri' | |
require 'date' | |
require "awesome_print" | |
def clean_whitespace(a) | |
a.gsub(/[\r\n\t]/, ' ').squeeze(" ").strip | |
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
require 'nokogiri' | |
require 'open-uri' | |
require 'date' | |
require "awesome_print" | |
url = "http://www.hobartcity.com.au/go/AdvertisedApps/output.html" | |
doc = Nokogiri::HTML(open(url)) | |
table = doc.at_css('table') |
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 'mechanize' | |
require 'date' | |
require "awesome_print" | |
base_url = "https://eservices.knox.vic.gov.au/ePathway/Production/Web/generalenquiry/" | |
url = "#{base_url}enquirylists.aspx" | |
agent = Mechanize.new | |
first_page = agent.get url |
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 'nokogiri' | |
require 'open-uri' | |
require 'date' | |
require "awesome_print" | |
url = "http://doc.shoalhaven.nsw.gov.au/RSS/SCCRSS.aspx?ID=OpenApps" | |
doc = Nokogiri::XML(open(url)) | |
comment_url = 'TODO' |
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
" Disable toolbar | |
if has("gui_running") | |
set guioptions=egmrt | |
endif | |
color rootwater | |
set guifont=Monaco:h12 | |
set spell |
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
function multipleChar(theChar, times){ | |
var result = ""; | |
for(var i = 0;i < times;i++){ | |
result += theChar; | |
} | |
return result; | |
} | |
CHAR_LOOKUP = [ | |
{ |
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 'mechanize' | |
require 'cgi' | |
require 'json' | |
PINTERST_EMAIL = "...." | |
PINTERST_PASSWORD = "...." | |
PINTERST_BOARD_ID = "264375509314468871" | |
FLICKR_API_KEY = "3fffd0917fa897e24bd5a442018df29a" | |
FLICKR_PHOTOSET = "72157625277593652" | |
ALREADY_POSTED_FILE = "already_posted.txt" |
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 'mechanize' | |
require 'json' | |
require 'awesome_print' | |
require 'twitter' | |
require 'base58' | |
require 'net/http' | |
require 'tempfile' | |
require 'uri' | |
FLICKR_API_KEY = "3fffd0917fa897e24bd5a442018df29a" |