Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
http://pubnub.a.ssl.fastly.net/pubnub-3.4.6.min.js | |
http://storage.googleapis.com/calvin166-test/pubnub-3.4.6.min.js | |
http://s3.amazonaws.com/test.icco.me/pubnub-3.4.6.min.js | |
http://d1cq9hp03zvonx.cloudfront.net/pubnub-3.4.6.min.js |
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
#! /usr/bin/env ruby | |
require 'benchmark' | |
require 'open-uri' | |
n = 50 | |
Benchmark.bm(12) do |x| | |
x.report("base:") { 1.upto(n) { a = "1" } } | |
x.report("fastly:") { 1.upto(n) { open("http://pubnub.a.ssl.fastly.net/pubnub-3.4.6.min.js") } } | |
x.report("gcs:") { 1.upto(n) { open("http://storage.googleapis.com/calvin166-test/pubnub-3.4.6.min.js") } } |
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 'xmlsimple' | |
Dir.glob('*/*.nfo').each {|f| xs = XmlSimple.new; config = xs.xml_in(f); config.delete 'fileinfo'; p xs.xml_out(config); break } |
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 'fileutils' | |
Dir.glob('/Volumes/Downloads/torrents/Naruto Shippuuden Season 13 720p/*mkv').sort.each do |f| | |
episode = (File.basename(f).scan /\d\d\d/).first | |
file_name = "/Volumes/TV/Naruto Shippuuden/Naruto Shippuuden 13x#{episode.to_i - 260}.mkv" | |
puts "#{episode}: #{f.inspect} => #{file_name.inspect}" | |
FileUtils.cp f, file_name | |
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
[ Mon May 20 10:39:52 ] | |
[ natwelch@MobileNat ~ ]$ irb | |
1.9.2p290 :001 > a = (0...10).to_a | |
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
1.9.2p290 :002 > n = 4 | |
=> 4 | |
1.9.2p290 :003 > a[n..-1] | |
=> [4, 5, 6, 7, 8, 9] |
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 'https://rubygems.org' | |
gem 'sinatra' |
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> | |
<head> | |
<title>A Message</title> | |
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'> | |
<style> | |
h1 { | |
font-family: 'Arvo', serif; | |
font-weight: 700; | |
text-align: center; |
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
#!/bin/bash | |
clear; | |
while true; do | |
for i in $(ls /); do | |
code=${code}`dd bs=1 count=32 if=/dev/urandom 2> /dev/null | md5 | grep -o '\w*'`; | |
done; | |
echo $code; | |
code=0; | |
done; |
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
# <Niket Desai 2:36> define a method | |
# <Niket Desai 2:36> that when given (assumed) > 0 integer value | |
# <Niket Desai 2:36> will return a random string of alphabet characters | |
# <Niket Desai 2:36> where alphabet chars CAN be reused | |
# Niket | |
def alphabet(num) | |
alpha_array = [] | |
(1..num).each { |i| alpha_array[i] = ('a'..'z').to_a.shuffle[0] } |