Skip to content

Instantly share code, notes, and snippets.

View prafulfillment's full-sized avatar
🐶
Speaking to 🐶 & 🐬

praful mathur prafulfillment

🐶
Speaking to 🐶 & 🐬
View GitHub Profile
vagrant@vagrant-ubuntu-precise-32:~/planet$ osm2pgsql --slim -d gis -C 16000 --number-processes 3 ~/planet/planet-latest.osm.pbf
osm2pgsql SVN version 0.81.0 (64bit id space)
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping
Setting up table: planet_osm_line
NOTICE: table "planet_osm_line" does not exist, skipping
NOTICE: table "planet_osm_line_tmp" does not exist, skipping

Dividing by 100:

Airport Parking => (44.8545276, -88.1565606)

Map: http://goo.gl/maps/0JKPA

Tried xy2latlon:

I knew it wasn't an x,y coordinate but wanted to see what was happening and I get the following:

@prafulfillment
prafulfillment / startup_vagrant.bash
Created April 23, 2013 20:44
My startup file when I launch vagrant.
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
sudo apt-get install vim git-core subversion
cat > ~/.bashrc <<DELIM
# virtualenv
export WORKON_HOME=$HOME/.virtualenvs
@prafulfillment
prafulfillment / kickstarter_project_stats.py
Created August 20, 2013 15:08
We're getting the stats from kickstarter projects.
# coding: utf-8
import requests
from bs4 import BeautifulSoup
from pprint import pprint as pp
from re import sub
def get_project(url):
r = requests.get(url)
kickstarter_html = r.text
soup = BeautifulSoup(kickstarter_html)
import serial
ser = serial.Serial('<USB tty>', 9600)
"""
`Forward` is constant 85 to `Acceleration Servo` value
`Backward` is constant 103 to `Acceleration Servo` value
`Stop` is constant 90 to `Acceleration Servo` value
Before moving `Forward` or `Backward`, the `Acceleration Servo` is `Stop`ped for 1 second
var five = require("johnny-five"),
board, servo;
board = new five.Board();
board.on("ready", function() {
servos = {
acceleration: new five.Servo({
pin: 9,
range: [0, 180], // Default: 0-180
@prafulfillment
prafulfillment / delete-fb-apps.js
Created April 14, 2014 16:25
Delete all your FB Apps from your Privacy view -- Hackish
function confirmDialog(){
document.getElementsByName('delete_app_actions')[0].click()
document.getElementsByName('ok')[0].click()
setTimeout(deleteApp,3000);
}
function deleteApp(){
document.getElementsByClassName('uiCloseButton')[0].click()
setTimeout(confirmDialog,1000);
}
/*
Autosend Invites to anyone that shares X number of connections with you.
Way to use this script:
1. Save it as a bookmarklet
2. Go to 'People you may know'
3. Click on this bookmarklet.
4. Enter number of overlapping connections
5. Check your console
@prafulfillment
prafulfillment / code-style.js
Created December 3, 2014 04:43
Replace Github code block css with the style Slack uses. (Use TamperMonkey on Chrome or GreaseMonkey on Firefox)
// ==UserScript==
// @name Replace Github code style
// @namespace https://www.derivatived.com/
// @version 0.1
// @description Remove all Pulse stories from LinkedIn news feed
// @match https://github.com/*
// @copyright 2014, Praful Mathur
// ==/UserScript==
function addGlobalStyle(css) {
set filePath to (path to desktop as text) & "screencast.mov"
tell application "QuickTime Player"
activate
set tdoc to new screen recording --> document "Screen Recording"
delay 1
tell application "System Events" to key code 49
delay 2
repeat while exists tdoc