Skip to content

Instantly share code, notes, and snippets.

pavuk -mode sync \
-fnrules F '*' '%h/%d/%b.%Y' \
-url_pattern '*about.com*' \
-skip_url_pattern '*?*' \
-skip_url_pattern '*.png*' \
-skip_url_pattern '*.jpg*' \
-skip_url_pattern '*.css*' \
-skip_url_pattern '*.js*' \
http://www.about.com
<?php
if (isset($_POST['data_of_note']))
{
$db = new PDO('mysql:host=localhost;dbname=homepage;charset=utf8', 'xxx', 'xxx');
$content = $_POST['data_of_note'];
$stmt = $db->query("INSERT INTO ReadingList (category, content) VALUES ('research', '$content')");
echo "Successful :)";
}
else
<html>
<head>
<title>Reading List</title>
<style>
body {
width: 400px;
font: 14px/22px 'Open Sans',arial,sans-serif;
}
input[type="text"], input[type="password"] {
width: 300px;
{
"name": "Reading List",
"browser_action": {
"default_icon": "icon38.png",
"default_title": "Reading List",
"default_popup": "popup.html"
},
"manifest_version" : 2,
"version" : "1.0",
"permissions": [

DJANGO INSTALLATION

These instructions should be followed with grain of salt. Take care to understand what is going on.

Starting out - For Ubuntu users - Installs important stuff

  • sudo apt-get install curl sox mysql-server mysql-client libmysqlclient16-dev git-core apache2 libexpat1 ssl-cert unixodbc-dev libmyodbc phpmyadmin mercurial
  • sudo apt-get install python-setuptools python-dev build-essential python-mysqldb python-tz python-imaging

Starting out - For Mac OSX

@anilshanbhag
anilshanbhag / ycombinator_db.py
Created June 13, 2012 11:06
Data Aggregator [ currently only hacker news ]
#!/usr/bin/python
from mongoengine import *
import json
import urllib2
import sys
class Post(Document):
item_id = IntField(required=True,unique=True)
title = StringField(required=True)
@anilshanbhag
anilshanbhag / mail.py
Created April 28, 2012 08:18
Batch Mailing from the terminal
from smtplib import SMTP
import datetime
debuglevel = 1
smtp = SMTP()
smtp.set_debuglevel(debuglevel)
smtp.connect("smtp.cse.iitb.ac.in",25)
smtp.starttls()
smtp.login('USERNAME HERE', 'PASSWORD HERE')
@anilshanbhag
anilshanbhag / kolaveri.py
Created December 10, 2011 09:55
Kolaveri Di View Count analysis
######################
#Script1 : scraper.py
######################
import urllib2
import datetime
def main():
ph = urllib2.ProxyHandler({'http': 'http://xxx:xxxx@netmon.iitb.ac.in:80'})
opener = urllib2.build_opener(ph)
@anilshanbhag
anilshanbhag / poker.py
Created December 8, 2011 19:53
Poker AI
"POKER AI Team No:1465"
"""
Things to Remember:
1. All cards are numbered x-1 where x is defined
"""
import pickle
class Game:
# STAGE HANDLERS