This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rules | |
===== | |
1) Add https://plus.google.com/106245824841620354963 to your circles | |
2) Follow https://twitter.com/Appaholics16 (if you have a twitter account) | |
3) Send me a message somehow (email, G+, twitter, fb whatever. Pick your poison). | |
There are 0x3 copies available in this giveaway. | |
The book being given away is http://www.apress.com/9781430239451 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var candidates = $( ".vote-count-post" ).map(function() { | |
var score, name, reputation, helpfulFlags, | |
postEl, repEl; | |
score = Math.max( +$( this ).text(), 1 ); | |
postEl = $( this ).closest( "tr" ); | |
postHeight = postEl.find( ".post-text" ).height(); | |
name = postEl.find( ".user-details a" ).text(); | |
repEl = postEl.find( ".user-details .reputation-score" ); | |
reputation = +( repEl.attr( "title" ).replace( /[^0-9]/g, "" ) || repEl.text().replace( /[^0-9]/g, "" ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import os | |
baseurl = "http://ceodelhi.gov.in/WriteReadData/AssemblyConstituency/AC" | |
constituencyCount = 67 | |
constituencyTotal = 70 #Delhi has 70 sub sections | |
while constituencyCount <= constituencyTotal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
subfolders = 70 | |
basepath = "/Users/raghavsood/Downloads/Elections/Delhi/" | |
currentfolder = 1 | |
directory = "/Users/raghavsood/Downloads/Elections/Delhi/Analysed/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import re | |
directory = "/Users/raghavsood/Downloads/Elections/Delhi/Analysed/Lists/" | |
inputdirectory = "/Users/raghavsood/Downloads/Elections/Delhi/Analysed/" | |
try: | |
os.makedirs(directory) | |
except OSError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 as lite | |
import sys | |
import os | |
con = None | |
try: | |
dbdirectory = "/Users/raghavsood/Downloads/Elections/Delhi/Analysed/Database/" | |
try: | |
os.makedirs(dbdirectory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 as lite | |
import sys | |
import os | |
def luhn_checksum(card_number): | |
def digits_of(n): | |
return [int(d) for d in str(n)] | |
digits = digits_of(card_number) | |
odd_digits = digits[-1::-2] | |
even_digits = digits[-2::-2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.appaholics.buzz; | |
import android.graphics.drawable.Drawable; | |
public class ListRow { | |
private Drawable image; | |
private String title; | |
private String packageName; | |
private boolean selected; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import html | |
import requests | |
import os | |
import json | |
import shelve | |
import sys | |
scriptid = int(sys.argv[1]) | |
p = shelve.open("//Users/raghavsood/Development/CBSE/2015/shelve" + str(scriptid) + ".db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Enter the client name" | |
read name | |
echo "Generating keys and config for $name" | |
cd /etc/openvpn | |
SERVER_IP=$(curl -s4 canhazip.com || echo "<insert server IP here>") |
OlderNewer