Skip to content

Instantly share code, notes, and snippets.

@jetpks
jetpks / get3io.rb
Created December 13, 2012 10:47
Find available three letter .io domains from list of any sized words in a file called ./wordlist.
#!/usr/bin/env ruby
require 'whois'
def load_words
three_letter_words = []
File.open('./wordlist', 'r') do |infile|
while (line = infile.gets)
next if (line == nil or line.chomp.length > 3)
three_letter_words.push(line.chomp)
end
@jetpks
jetpks / get2io.rb
Created December 13, 2012 10:44
Find all available 2 letter .io domain names.
#!/usr/bin/env ruby
require 'whois'
c = Whois::Client.new
('a'..'z').to_a.shuffle!.each do |starter|
('a'..'z').to_a.shuffle!.each do |ender|
#puts "Trying #{starter}#{ender}.io"
if c.query("#{starter}#{ender}.io").available?
puts "FOUND AVAILABLE!! AWESOME! : #{starter}#{ender}.io"
@jetpks
jetpks / switcher.js
Created July 1, 2012 04:29
A node.js based gnome desktop background interval switcher.
#!/usr/local/bin/node
(function() {
"use strict";
// The purpose of this script is to switch the gnome background every x
// minutes.
var exec = require('child_process').exec
, fs = require('fs')
, interval = 0
@jetpks
jetpks / coprime.rb
Created June 20, 2012 05:20
Find the a number coprime to the input
#!/usr/bin/env ruby
## Initialization and parameter checking:
def usage
puts "Usage: ./coprime.rb integer\n"
Process.exit(1)
end
@jetpks
jetpks / .vimrc
Created June 5, 2012 23:12
my older .vimrc.
call pathogen#infect()
syntax on
set autoindent
set smartindent
set tabstop=2
set shiftwidth=2
set expandtab
set ruler
set hlsearch
set incsearch
@jetpks
jetpks / twat.js
Created May 23, 2012 07:17
ed's node app
(function() {
"use strict";
var http = require('http')
, url = require('url')
, cached = {}
;
function server(req, res) {
var now = Date.now()
, twitter = url.parse(req.url).pathname.slice(1)
echo "Show all filename extensions in Finder"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
echo "Use current directory as default search scope in Finder"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
echo "Show Path bar in Finder"
defaults write com.apple.finder ShowPathbar -bool true
echo "Show Status bar in Finder"
@jetpks
jetpks / hack.sh
Created March 31, 2012 17:04 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2266791/hack.sh | sh
#
@jetpks
jetpks / config
Created March 23, 2012 15:43
.irssi/config
servers = (
{
address = "irc.mikezauner.com";
chatnet = "zl4u";
port = "6697";
autoconnect = "yes";
use_ssl = "yes";
},
{
address = "irc.freenode.net";
@jetpks
jetpks / gist:1765481
Created February 8, 2012 04:39
I'M A BUS
C:\Users\eric\Documents\node_service>.\nssm.exe install thebus "C:\Program Files (x86)\nodejs\node.exe" "C:\Users\eric\Documents\static\server.js" "80" "C:\Users\eric\Documents\public\"
Service "thebus" installed successfully!
C:\Users\eric\Documents\node_service>net start thebus
The thebus service is starting.
The thebus service was started successfully.
C:\Users\eric\Documents\node_service>curl localhost