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
| Oct 10 17:12:57 Nervous-Energy.local apsd[115]: Unrecognized leaf certificate | |
| Oct 10 17:12:57 Nervous-Energy.local apsd[115]: Illegal subject name missing 'courier.push.apple.com' (2.5.4.3): ({ | |
| label = "2.5.4.6"; | |
| "localized label" = "2.5.4.6"; | |
| type = string; | |
| value = US; | |
| }, { | |
| label = "2.5.4.8"; | |
| "localized label" = "2.5.4.8"; | |
| type = string; |
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
| HTTP/1.1 302 Found | |
| Server: nginx/1.8.0 | |
| Date: Sat, 13 Jun 2015 12:50:10 GMT | |
| Content-Type: text/html; charset=utf-8 | |
| Transfer-Encoding: chunked | |
| Connection: keep-alive | |
| Status: 302 Found | |
| cache-control: no-cache | |
| x-xss-protection: 1; mode=block | |
| x-request-id: 54fa26a0-60fa-4fa0-9191-f0af3ba8844e |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.ozbargains</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/Users/{username}/bin/ozb.rb</string> |
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 'open-uri' | |
| require 'nokogiri' | |
| baseCurrency='AUD' | |
| settlementDate=(Date.today - 4).strftime("%m/%d/%Y") | |
| finalCurrency='USD' | |
| url="https://www.mastercard.com/psder/eu/callPsder.do?service=getExchngRateDetails&baseCurrency=#{baseCurrency}&settlementDate=#{settlementDate}" | |
| doc = Nokogiri::HTML(open(url)) | |
| rate = doc.xpath("//transaction_currency_dtl/alpha_curency_code[text()='#{finalCurrency}']/following-sibling::conversion_rate").text |
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
| # From https://github.com/ruby/ruby/blob/trunk/lib/webrick/ssl.rb | |
| require 'openssl' | |
| def create_self_signed_cert(bits, cn, comment) | |
| rsa = OpenSSL::PKey::RSA.new(bits){|p, n| | |
| case p | |
| when 0; $stderr.putc "." # BN_generate_prime | |
| when 1; $stderr.putc "+" # BN_generate_prime | |
| when 2; $stderr.putc "*" # searching good prime, | |
| # n = #of try, |
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 | |
| # Originally from: https://coderwall.com/p/ftn1la/markdown-preview-using-ruby-and-sinatra-simple-script | |
| # gem install sinatra redcarpet rouge --no-document | |
| require 'sinatra' | |
| require 'redcarpet' | |
| require 'rouge' | |
| require 'rouge/plugins/redcarpet' | |
| set :port, 3001 |
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 | |
| # Original http://code.activestate.com/recipes/576590-fallout-3-terminal-hacking-minigame-cracker/ | |
| ## Get all available words | |
| words = [] | |
| loop do | |
| print "word> " | |
| line = gets.chomp |
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
| The pixel format from the camera is 422 ( https://en.wikipedia.org/wiki/YUV ). FFMpeg can convert it to the more standard 420. | |
| Additionally, I've added faststart to enable the video to play from the web prior to downloading the entire file | |
| ffmpeg -i /Volumes/Untitled/VIDEO/MOVI0004.avi -movflags faststart -pix_fmt yuv420p ~/Movies/MOVI0004.mp4 |
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 Fixnum | |
| def to_pretty_time | |
| a = self | |
| case a | |
| when 0 then 'just now' | |
| when 1 then 'a second ago' | |
| when 2..59 then a.to_s+' seconds ago' | |
| when 60..119 then 'a minute ago' #120 = 2 minutes | |
| when 120..3540 then (a/60).to_i.to_s+' minutes ago' | |
| when 3541..7100 then 'an hour ago' # 3600 = 1 hour |