Skip to content

Instantly share code, notes, and snippets.

View ideamonk's full-sized avatar
🍹
wfh

Ideamonk ideamonk

🍹
wfh
View GitHub Profile
@ideamonk
ideamonk / corelate.py
Created January 16, 2011 05:26
finds closest city on craiglist for a given patch location
import urllib
import urllib2
from BeautifulSoup import BeautifulSoup
from multiprocessing import Pool, cpu_count
def getMaxUrl(logline):
donkey_kong = logline.split('|')
orig_place = donkey_kong[0]
place = orig_place.split('-')[0]
#!/usr/bin/env python
'''
To my surprise texter3 is still alive, the first fish in this pond was
caught on 08-24-07, so I assume there is about 3 years of data locked in this
amber.
Yet more surprising part was to see a box with status - alive and DOB : 02-05-10
Truly proud to have written long surviving dirty little rats when I was young :)
A great credit goes to (8bits)host for freely running it so far.
@ideamonk
ideamonk / q2_borq_lcd.rb
Created October 24, 2010 19:55
Q2. of BORQ
# Author: Abhishek Mishra <[email protected]>
require 'rubygems'
require 'choice'
Choice.options do
banner 'q2_lcd_numbers.rb [-shv] string'
separator 'Optional:'
option :size do
@ideamonk
ideamonk / BORQ_1_MadLibs.rb
Created October 24, 2010 16:38
Q1 of BORQ
# solution to simpler part
# puts gets.chop.gsub!( /\(\([^))]*\)\)/) { |w| w=gets.chop}
# part 2 - along with substitution
dict = {}
puts IO.read(ARGV.shift).chop.gsub!( /\(\([^))]*\)\)/) { |w|
w = w.scan(/[^()]+/)[0]
combo = w.split(":")
if (combo.size==2)
print "Enter #{combo[1]} : "
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
import urllib2
from BeautifulSoup import BeautifulSoup
def safename(s):
return "".join([x for x in s if x.isalpha() or x.isdigit()])
print "Doing..."
mothers = [
# these pages contain links to pages to be saved
#!/bin/bash
# WiFi Hunter
# ===========
#
# Scans for unprotected Access Points in your neighborhood and alerts you
# when it finds something good for you :)
# -- ideamonk at gmail.com
export MPLAYER_VERBOSE=0
@ideamonk
ideamonk / flickfetch.py
Created November 11, 2009 10:49
This is a python script that Yuvi wrote, comes handy while making a collection for pymos
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Download with wget and xargs
# python download.py portrait 1 | xargs wget --directory-prefix=pics
# first argument is tag name, second is page number. 500 pics per page.
# -- Yuvi Panda
import sys
import simplejson as json