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 | |
# processing options and parameters with getopts | |
while getopts :ab:cd opt | |
do | |
case "$opt" in | |
a) echo "Found the -a option";; | |
b) echo "Found the -b option, with value $OPTARG";; | |
c) echo "Found the -c option";; | |
d) echo "Found the -d option";; |
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
for i in 0..9999 | |
if(i % 9 == 0) | |
printf("%04d \n", i) | |
else | |
printf("%04d \t", i) | |
end | |
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
function p(a){return (5+a+"").slice(-5)};for(i=0;i<=9999;i++){i%9?process.stdout.write(p(i+"\t")):process.stdout.write(p(i+"\n"))} | |
function z(g){process.stdout.write(g)}function p(a){return (5+a+"").slice(-5)};for(i=0;i<=9999;i++){i%9?z(p(i+"\t")):z(p(i+"\n"))} |
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
sudo apt-get update | |
sudo apt-get upgrade | |
sudo reboot | |
sudo apt-get install nvidia-current | |
sudo reboot | |
sudo apt-get install ubuntu-restricted-extras | |
sudo apt-get install mercurial | |
hg clone https://vim.googlecode.com/hg/ ~/vim | |
cd ~/vim/src | |
sudo apt-get install ncurses-term |
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 schonfinkelize(fn) { | |
var slice = Array.prototype.slice, | |
storedArgs = slice.call(arguments, 1); | |
return function () { | |
var newArgs = slice.call(arguments), | |
args = storedArgs.concat(newArgs); | |
return fn.apply(null, args); | |
}; | |
} |
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 MYAPP = MYAPP || {}; | |
MYAPP.namespace = function (ns_string) { | |
var parts = ns_string.split('.'), | |
parent = MYAPP, | |
i; | |
// strip redundant leading global | |
if (parts[0] === "MYAPP") { | |
parts = parts.slice(1); | |
} |
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
result = {} | |
parts = message.split(' ') | |
result[:prefix] = parts.shift.gsub(/^:/, "") if parts[0] =~ /^:/ | |
result[:command] = parts.shift | |
result[:params] = parts.take_while { |x| x[0] != ":" } | |
if result[:params].size < parts.size | |
full_string = parts.slice(result[:params].size..-1).join(" ") | |
full_string.gsub!(/^:/, "") |
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 'eventmachine' | |
module Mplayer | |
def receive_data(data) | |
end | |
end | |
class Player | |
def initialize | |
@io = EM.popen("mplayer -noconsolecontrols -nolirc -idle -slave", Mplayer) |
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 "eventmachine" | |
require "highline/import" | |
def get_user_input | |
input = HighLine.new | |
c = ask('') { |q| q.character = true; q.echo = false } | |
# Do something | |
print c | |
get_user_input | |
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
git submodule -q foreach git pull -q origin master |
OlderNewer