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 | |
# encoding: UTF-8 | |
# - Poker - | |
# A library to rank and compare poker hands. | |
module Poker | |
ACE = 14 | |
KING = 13 | |
QUEEN = 12 |
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 python | |
import random | |
def MillerRabinPT(n,k=100): | |
n = int(n) | |
if n<2: return False | |
if n==2 or n==3: return True | |
if not n%2: return False |
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 python | |
# Number to name convertion. | |
import sys | |
n = (sys.argv[1] if sys.argv[1].isdigit() else 0) if len(sys.argv)>1 else 0 | |
if len(n)>30: | |
print("Error: Number too large.") | |
sys.exit(1) |
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 | |
$drives = { | |
:a => 'Example 1.', | |
:b => 'abcdefghijklmnopqrstuvwxyz', | |
:c => '0123456789', | |
:d => '3.14159265', | |
:parity => '' | |
} |
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
#!/bin/bash | |
[ ! "$1" ] && { | |
echo "Usage: matrix <pts-number>" | |
echo "Grabs control of a terminal and sends the Matrix message." | |
echo | |
echo "Choose a pts number:" | |
echo -e "Number\tUser\tName" | |
ps aux | awk '/pts\// && /bash/ {print $7":\t("$1")\t"$11}' | |
exit | |
} |
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 | |
# Define: a Google Dictionary API tool | |
require "rubygems" | |
require "net/http" | |
require "json" | |
if not ARGV[0]; exit; end | |
query = ARGV.join("+").gsub(" ","+") |
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/python | |
import curses, random | |
screen = curses.initscr() | |
width = screen.getmaxyx()[1] | |
height = screen.getmaxyx()[0] | |
size = width*height | |
char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"] | |
b = [] |
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
#!/bin/bash | |
declare -i f=75 s=13 r=2000 t=0 c=1 n=0 l=0 | |
declare -ir w=$(tput cols) h=$(tput lines) | |
declare -i x=$((w/2)) y=$((h/2)) | |
declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93" | |
[10]="\x9b" [11]="\x81" [12]="\x93" | |
[21]="\x97" [22]="\x83" [23]="\x9b" | |
[30]="\x97" [32]="\x8f" [33]="\x81" ) | |
OPTIND=1 |
NewerOlder