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 twitter | |
import csv | |
import string | |
import time | |
import random | |
import sys | |
pavan = twitter.Api(consumer_key='<REMOVED>',consumer_secret='<REMOVED>',access_token_key='<REMOVED>',access_token_secret='<REMOVED>') | |
fark = twitter.Api(consumer_key='<REMOVED>',consumer_secret='<REMOVED>',access_token_key='<REMOVED>',access_token_secret='<REMOVED>') |
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
#!/usr/bin/python | |
import urllib2 | |
import threading | |
import re | |
import Queue | |
import sys | |
# The fourth URL returns a 403 error which python dies on, so I wrap this grab_ip function with exception handling. |
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 BaseHTTPServer | |
import urlparse | |
class SimpleHandler(BaseHTTPServer.BaseHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(200) | |
if "?" in self.path: | |
for key,value in dict(urlparse.parse_qsl(self.path.split("?")[1], True)).items(): | |
print key + " = " + value |
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
<link rel="import" href="../topeka-elements/category-images.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
# Tried this on an AWS EC2 Ubuntu 14.04.1 (and a dist-upgraded 14.04.2) 64 bit VM | |
# This is nothing more than a copy and paste thing you can do as ubuntu to get up and running. | |
# It's definitely not efficient at this point, feel free to make more efficient | |
sudo apt-get -y update; | |
sudo echo mysql-server-5.5 mysql-server/root_password password abc123 | sudo debconf-set-selections; | |
sudo echo mysql-server-5.5 mysql-server/root_password_again password abc123 | sudo debconf-set-selections; | |
sudo apt-get -y install build-essential checkinstall git-core mysql-server \ | |
python-pip python-twisted python-mysqldb \ | |
python-mysqldb-dbg memcached python-memcache \ | |
python-simplejson python-cjson python-cjson-dbg \ |
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
svn ls 'https://svn.pavgup.io/svnroot' | parallel svn export 'https://svn.pavgup.io/svnroot/'\{\} | |
# Nothing clever here. Seeking adventure? Get yourself a couple more layers of the svnroot with more pipes. Definite overkill. |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/sh | |
# Before a magical image optimization pipeline kicks off (e.g., imagemin inside | |
# grunt/gulp) you'd probably want to know what the size of all your images are. | |
# Here's a quick one-liner that grabs a filetype for every file inside your | |
# current directory and then awks out the files that *nix is considering an | |
# image before finally handing off the file size calculations to du. | |
find . -exec file {} \; | \ | |
awk -F':' '{ | |
if ($2 ~/[Ii]mage|EPS/) |
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/sh | |
mkdir backup; \ | |
for file in $( | |
find . -exec \ | |
file {} \; | \ | |
awk -F':' '{ if ($2 ~/[Ii]mage|EPS/) print $1,"\n"}'| \ | |
sed s/\.//); | |
do | |
cp -R -v .$file ./backup/ |
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/sh | |
mkdir backup; | |
for file in $( | |
find . -exec \ | |
file {} \; | \ | |
awk -F':' '{ if ($2 ~/[Ii]mage|EPS/) print $1,"\n"}'| \ | |
sed s/\.//); | |
do | |
cp -R -v .$file ./backup/; |
OlderNewer