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 | |
################################################################# | |
## For author info, scroll to the end of this file. | |
################################################################# | |
################################################################# | |
## Load Modules | |
require "pp" | |
################################################################# |
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
command "req-verbose", "Requires gem(s). No need for quotes! (If the gem isn't installed, it will ask if you want to install it.)" do |*gems| | |
def tree_to_array(hash, indent=0) | |
result = [] | |
dent = " " * indent | |
hash.each do |key,val| | |
result << dent+key | |
result += tree_to_array(val, indent+1) if val.any? | |
end | |
result |
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
$ ls -lS hellos* | |
-rw-r--r-- 1 epi users 500001 Dec 17 01:49 hellos | |
-rw-r--r-- 1 epi users 770 Dec 17 01:50 hellos.gz | |
-rw-r--r-- 1 epi users 344 Dec 17 01:54 hellos.xz.bz2 | |
-rw-r--r-- 1 epi users 272 Dec 17 01:50 hellos.xz.xz | |
-rw-r--r-- 1 epi users 235 Dec 17 01:50 hellos.xz.gz | |
-rw-r--r-- 1 epi users 212 Dec 17 01:50 hellos.xz | |
-rw-r--r-- 1 epi users 128 Dec 17 01:51 hellos.gz.xz | |
-rw-r--r-- 1 epi users 121 Dec 17 01:54 hellos.gz.bz2 | |
-rw-r--r-- 1 epi users 75 Dec 17 01:50 hellos.gz.gz |
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
$ ruby trivia.rb | |
Round 1! Category: NATIONAL HISTORIC SITES (from episode #4736, aired 2005-03-21) | |
Question: A portion of this avenue between the Capitol & the White House was designated a National Historic Site in 1965 | |
Hint: ____________ ______ | |
Hint: _____y______ ______ | |
Hint: _____y______ ____u_ | |
Hint: _____y______ ___nu_ | |
Hint: ___n_y______ ___nu_ | |
Hint: ___n_yl_____ ___nu_ | |
Hint: ___n_ylv____ ___nu_ |
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
### wxruby ######################### | |
1500 text files. | |
1480 unique files. | |
813 files ignored. | |
http://cloc.sourceforge.net v 1.60 T=4.21 s (172.6 files/s, 16513.3 lines/s) | |
------------------------------------------------------------------------------- | |
Language files blank comment code | |
------------------------------------------------------------------------------- |
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 | |
require 'epitools' | |
class Array | |
def without(letters) | |
grouped = group_by { |letter| letter } | |
letters.each do |letter| |
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 | |
require 'io/console' | |
thread = Thread.new do | |
$stdin.each_line do |line| | |
print "stdin: #{line}\r" | |
end | |
end |
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
require 'binding_of_caller' | |
class Tmpl | |
def initialize(&block) | |
@tmpl = block | |
end | |
def render | |
@thebinding = binding.of_caller(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
$ grep -i conlang *lesswrong*|field 3|sort|uniq -c | |
4 * | |
1 Betawolf | |
1 c0rw1n | |
3 capisce | |
1 cardboard_box | |
1 catern | |
1 cntarantula | |
1 cntgrational | |
1 cntnamstyle |
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
#include <stdio.h> | |
int main() { | |
int x = 10; | |
while (x --> 0) { // x downto 0 | |
printf("%d ", x); | |
} | |
} |