a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| module Scraper::BookingCom | |
| class RoomBot < BotBase | |
| include Scraper::ScrapingCommon | |
| HTTP_RESPONSE_VALIDATORS = [ | |
| :nil_response, :status_404, :status_200, :html, | |
| ->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") } | |
| ] | |
| def scrape |
| module Scraper::BookingCom | |
| class RoomBot < BotBase | |
| include Scraper::ScrapingCommon | |
| HTTP_RESPONSE_VALIDATORS = [ | |
| :nil_response, :status_404, :status_200, :html, | |
| ->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") } | |
| ] | |
| def scrape |
| module Main where | |
| import System.Environment | |
| import System.IO (hFlush, stdout) | |
| ask :: (Show a, Read b) => a -> IO b | |
| ask question = do | |
| putStr $ show question | |
| hFlush stdout | |
| answer <- getLine |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| calculatePadding :: Int -> Int | |
| calculatePadding = ceiling . log . fromIntegral | |
| Defaulting the following constraint(s) to type ‘Double’ | |
| (RealFrac b0) | |
| arising from a use of ‘ceiling’ at src/Cat/Decorators.hs:21:22-28 | |
| (Num b0) | |
| arising from a use of ‘fromIntegral’ | |
| at src/Cat/Decorators.hs:21:38-49 |
| def foo | |
| def bar | |
| puts "bar" | |
| end | |
| end |
| def foo | |
| def bar | |
| puts "bar" | |
| end | |
| end |
| #!/usr/bin/env ruby | |
| def installed?(gem_name) | |
| require gem_name | |
| true | |
| rescue LoadError | |
| false | |
| end | |
| def required_gems(file_name) |
| require 'mechanize' | |
| require 'json' | |
| agent = Mechanize.new | |
| headers = { | |
| 'X-Requested-With' => 'XMLHttpRequest', | |
| 'Content-Type' => 'application/x-www-form-urlencoded', | |
| 'Accept' => '*/*', | |
| 'Cookie' => 'removed' | |
| } |
| function active-window-id { | |
| echo `xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'` | |
| } | |
| # end and compare timer, notify-send if needed | |
| function notifyosd-precmd() { | |
| if [ ! -z "$cmd" ]; then | |
| cmd_end=`date +%s` | |
| ((cmd_time=$cmd_end - $cmd_start)) | |
| fi |