Skip to content

Instantly share code, notes, and snippets.

View ideamonk's full-sized avatar
🍹
wfh

Ideamonk ideamonk

🍹
wfh
View GitHub Profile
@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
#!/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
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/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.
@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]} : "
@ideamonk
ideamonk / q2_borq_lcd.rb
Created October 24, 2010 19:55
Q2. of BORQ
# Author: Abhishek Mishra <ideamonk@gmail.com>
require 'rubygems'
require 'choice'
Choice.options do
banner 'q2_lcd_numbers.rb [-shv] string'
separator 'Optional:'
option :size do
#!/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 / 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]
@ideamonk
ideamonk / imperfect_sticky_scissors.js
Created January 16, 2011 05:31
A bit imperfect stickiness implementation resulted from aims of reproducing intelligent scissors, but making distance weights dynamic might help emulate what Mortensen aims at. Edge finding hardly helps though.
/* Author: ideamonk
*/
window.scissors = {
MAX_GRADIENT:179.606,
GRADIENT_SEARCH:32,
radius:16,
MIN_GRADIENT:63,
COST_WIDTH:2,
@ideamonk
ideamonk / craigcount.py
Created January 26, 2011 17:59
Counts daily posts in craiglist, does recursive page navs, uses multiprocessing to suck up all the bandwidth
#!/usr/bin/env python
import urllib2
import psycopg2
from time import strftime
from datetime import date, timedelta, datetime
from geopy import geocoders
from BeautifulSoup import BeautifulSoup
from multiprocessing import Pool, cpu_count
conn = psycopg2.connect("dbname=mydb user=ideamonk password=geodb")