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
awk 'function wl() {\ | |
rate=64000; \ | |
return (rate/160)*(0.87055^(int(rand()*10)))}; \ | |
BEGIN {\ | |
srand(); \ | |
wla=wl(); \ | |
while(1) {\ | |
wlb=wla; \ | |
wla=wl(); \ | |
if (wla==wlb) \ |
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
var dickbar = function() { | |
var opts = { | |
"symbol" : "✪", | |
"font-size": "64px", | |
"color": "#eee", | |
"time": 3000 | |
}; | |
if(window.dickbar && window.dickbarOptions) { | |
var d = window.dickbarOptions; | |
if(d["font-size"]) opts["font-size"] = d["font-size"]; |
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 | |
# | |
# | |
# Usage: <old logfile> <new logfile> [ optional pids ] | |
# ./swap.sh /var/log/logfile /tmp/logfile [pids] | |
# | |
# Author: Robert McKay <[email protected]> | |
# Date: Tue Aug 14 13:36:35 BST 2007 | |
# url: http://bit.ly/eEYfp5 |
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 | |
# | |
# Author: Josh Frye <joshfng> | |
# Licence: MIT | |
# | |
# Contributions from: Wayne E. Seguin <[email protected]> | |
# | |
# To run: | |
# sudo apt-get -y install curl && curl https://github.com/joshfng/railsready/raw/master/railsready.sh >> railsready.sh && chmod a+x railsready.sh && ./railsready.sh | |
# The script will ask if you want to build Ruby from source or install RVM |
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/env bash | |
RESULT=`curl -ipost -s http://service.com/api/users -pname=Jhon+Doe -pid=12` | |
if [[ $RESULT =~ 'jhon-doe' ]] | |
echo "Test Create: Success. Got: $result" | |
else | |
echo "Test Create: Failure. Got: $result" | |
endif |
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
# Config for installing | |
# https://github.com/vargolo/ruby-libnotify.git | |
prefix=/home/jpablobr/.rvm/rubies/ruby-1.9.2-p136@app | |
site-ruby=$prefix/lib/ruby/site_ruby/1.9.1 | |
ruby-prog=$prefix/bin/ruby | |
ruby-path=$prefix/bin/ruby | |
make-prog=make | |
site-ruby-common=$prefix/lib/ruby/site_ruby |
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
var MyClass = (function () { | |
// private static | |
var fooBar = 1; | |
// constructor | |
var cls = function () { | |
// private | |
var id = fooBar++; | |
var name = 'baz'; |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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 | |
scp ~/.ssh/id_rsa.pub $1:~ | |
ssh $1 "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod -R 600 ~/.ssh/* && cat ~/id_rsa.pub >> ~/.ssh/authorized_keys && rm ~/id_rsa.pub" |
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 | |
# To install: | |
# about:config | |
# create a new boolean network.protocol-handler.external.txmt with value true | |
# create a new string network.protocol-handler.app.txmt with value path to the script | |
require 'rubygems' | |
require 'cgi' | |
require 'uri' |