Skip to content

Instantly share code, notes, and snippets.

@logicrime
logicrime / searchgems
Last active September 16, 2015 10:57
searchgems
#!/usr/bin/env ruby
# gem search, by hayden jones
# License: whatever
# usage: ./searchgems eventmachine
# prints all gems that contain eventmachine in the name
# if a lot of people use this, maybe somebody will fix rubygems so that gem search
# searches from cache instead of over the wire
puts `gem search ""`.split("\n").select { |line| line.include?(ARGV[0]) }.sort
@logicrime
logicrime / addwords.rb
Created September 8, 2015 06:33
addwords.rb
#!/usr/bin/env ruby
# addwords.rb
# you know those posts that are like
# A+T+T+I+T+U+D+E= 100, or whatever?
# this program does that
# you need a file to pass to initialize
# that has one word per line
# most distros have a dict somewhere, just use that
@logicrime
logicrime / bogo.rb
Created September 8, 2015 03:16
generates random string to match another random string or How I learned to write code yet not do any work
#!/usr/bin/env ruby
class Cry
def initialize(pool)
@data = pool.split("")
end
def take(num)
res = ""
@logicrime
logicrime / accwords.rb
Created September 7, 2015 01:52
accwords
#!/usr/bin/ruby
# free 4 u 2 use
# hayden jones
# this can take any number of files as arguments
# eg: ./accwords junk.txt junk2.txt junk3.txt
# and accumulates each letter
# a = 1, b = 2 ... z = 26
# it prints out the final result
#!/usr/bin/env lua
-- hayden jones
-- MIT/X11
-- junk.lua
-- just what it sounds like
junk = {}
function junk.randstream(str)