This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:
- Hulu / HuluPlus
- CBS
- ABC
- MTV
- theWB
- CW TV
- Crackle
- NBC
| #!/usr/bin/env ruby | |
| # API Documentation at http://api.wikia.com/wiki/LyricWiki_API | |
| require 'open-uri' | |
| require 'json' | |
| require 'tmpdir' | |
| ARTIST = "Johnny Cash" |
This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:
| require "rubygems" | |
| require "awesome_print" | |
| Pry.print = proc { |output, value| output.puts value.ai } |
| <link rel="canonical" href="{{ canonical_url }}" /> | |
| {% assign maxmeta = 155 %} | |
| {% if template contains 'product' %} | |
| {% assign mf = product.metafields.meta_data %} | |
| {% unless mf == empty %} | |
| {% for mf in product.metafields.meta_data' %} | |
| {% capture key %}{{ mf | first }}{% endcapture %} | |
| {% if key == 'title' %} | |
| <title>{{mf | last}}</title> | |
| <meta name="title" content="{{mf | last}}" /> |
| require 'csv' | |
| require 'haddock' | |
| require 'mechanize' | |
| # codes = [] | |
| # Haddock::Password.diction = "words" | |
| # 500.times do |x| | |
| # code = Haddock::Password.generate(8) | |
| # codes << code unless codes.include?(code) | |
| # end |
| class Hash | |
| # Returns the value at the specified path. | |
| # For example, [:foo, :bar, :baz] as a path would return the | |
| # value at self[:foo][:bar][:baz]. If self doesn't contain one of | |
| # the keys specified in path, nil is returned. | |
| # | |
| # This method is useful as it simplifies statements such as: | |
| # value = h[:a][:b][:c][:d] if h[:a] && h[:a][:b] && h[:a][:b][:c] | |
| # to | |
| # value = h.value_at_path(:a, :b, :c, :d) |
| Collection indicators: | |
| '? ' : Key indicator. | |
| ': ' : Value indicator. | |
| '- ' : Nested series entry indicator. | |
| ', ' : Separate in-line branch entries. | |
| '[]' : Surround in-line series branch. | |
| '{}' : Surround in-line keyed branch. | |
| Scalar indicators: | |
| '''' : Surround in-line unescaped scalar ('' escaped '). | |
| '"' : Surround in-line escaped scalar (see escape codes below). |
| # coding: utf-8 | |
| require 'sinatra' | |
| set server: 'thin', connections: [] | |
| get '/' do | |
| halt erb(:login) unless params[:user] | |
| erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
| end | |
| get '/stream', provides: 'text/event-stream' do |
| #!/usr/bin/env ruby | |
| # A simply utility to show character counts for each line of input and | |
| # highlight lines longer than 80 characters. | |
| # | |
| # Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html | |
| # | |
| # Examples: | |
| # | |
| # $ hilong Gemfile |
| module Delayed | |
| class Worker | |
| def start | |
| say "Starting job worker" | |
| trap('TERM') { $exit = true; raise SignalException.new("TERM")} | |
| trap('INT') { say 'Exiting...'; $exit = true } | |
| loop do | |
| result = nil |