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
def momo(a, b) | |
a+b | |
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
container = WAZ::Blobs::Container.find('copy-test') | |
container.nil?.should == false | |
container.store('blob', 'payload', 'plain/text') | |
container.public_access = true | |
container.public_access?.should == true | |
blob = container['blob'] | |
blob.nil?.should == false |
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 'rubygems' | |
require 'sinatra' | |
require 'rack/auth/wrap' | |
use Rack::Auth::WRAP, :shared_secret => "NjkzNTczOTAtMDA2MC0wMTJkLTQ1M2YtMDAyMzMyYjFmYWY4\n", | |
:audiences => "http://localhost:4567", | |
:trusted_issuers => "urn:demo-issuer" | |
get "/" do | |
if @env["REMOTE_USER"] |
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 'rubygems' | |
require 'cgi' | |
require 'base64' | |
require 'restclient' | |
require 'hmac/sha2' | |
SHARED_SECRET = "NjkzNTczOTAtMDA2MC0wMTJkLTQ1M2YtMDAyMzMyYjFmYWY4\n" | |
simple_web_token = {'Audience' => "http://localhost:4567", | |
'Issuer' => "urn:demo-issuer", |
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
function capitalize { | |
$result = "" | |
$args[0].trim().split(" ") | %{ ($_.trim()[0].toString().toUpper()) + $_.substring(1)} | %{ $result += $_ + " "} | |
return $result.trim() | |
} | |
function namify { | |
$currentName = $args[0].name -replace [regex]"(wWw.*|notv|hdtv.*).avi", [String]::Empty | |
$segments = ([regex]"(.*).[s|S](\d+)[e|E](\d+).*").matches($currentName) | |
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
ls | %{ mv $_.FullName ([regex]::replace($_.Name, "(.*).(\d)(\d{2}).avi", '$1.s0$2e$3.avi')) } |
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
# Adds a new host entry on the hosts file as shown: | |
# | |
# add-host www.southworks.net 127.0.0.1 [optional $true|$false] | |
# | |
# the third parameter indicates whether if exists it should be overwritten | |
function add-host { | |
# map parameters | |
$hostname, $address, $override = $args[0], $args[1], ($args[2] -eq $true) | |
# generte some basics |
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
$INTIAL_SPACE = 5 | |
# On the hosts file use the same spa cing between entries using | |
# 7 as the constant spaces between "words" but compensating length | |
function tabulate { | |
$longest, $source = 1, $args[0] | |
$contents = (gc $source) | |
#find the longest word | |
clear-content $source |
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
public static class AzureTableStringHelpers | |
{ | |
public static string AsEncodedKey(this string key) | |
{ | |
if (key == null) | |
{ | |
return null; | |
} | |
return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(key)); |
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/sh | |
# Fetch and install the latest Chromium mac nightly build, but only | |
# if it's different from the currently installed version. An existing | |
# Chromium.app is backed up to .Chromium.app in the same directory. | |
# | |
# Install with: | |
# $ curl -L http://bit.ly/night-chrome > ~/bin/nightly-chromium | |
# $ chmod +x ~/bin/nightly-chromium | |
# | |
# To upgrade to latest chromium version: |
OlderNewer