Skip to content

Instantly share code, notes, and snippets.

@csinchok
csinchok / million_homepage_stats.py
Created November 12, 2012 21:51
Stats for the Million Dollar Homepage links
import requests
from bs4 import BeautifulSoup
homepage = requests.get('http://www.milliondollarhomepage.com')
soup = BeautifulSoup(homepage.content)
response_codes = {'error': 0}
urls = {}
for area in soup.find_all('area'):
@csinchok
csinchok / app.py
Last active December 15, 2015 10:29
Trying to find the "unique" tweets for a URL.
import requests
import sys
import pprint
import re
from difflib import SequenceMatcher
from requests_oauthlib import OAuth1
def clean_tweet(text):
return " ".join(re.sub(r"http://t.co/\w+", "", text).split())
@csinchok
csinchok / gist:5313395
Created April 4, 2013 19:28
Simple grammar generator
import random
class Announcement(object):
def __init__(self, article):
self.grammars['article'] = [article]
start = ['"%(article)s" is a %(hyperbole)s, %(name)s!']
grammars = {
@csinchok
csinchok / avclub.json
Last active December 16, 2015 16:08
Kibana 3 dashboard
{
"title": "AV Club Dash",
"rows": [
{
"title": "Options",
"height": "50px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
var body = document.getElementsByTagName("body")[0];
var trackerEl = document.createElement("div");
trackerEl.style.positioning = "absolute";
trackerEl.style.top = "0";
trackerEl.style.left = "0";
trackerEl.style.width = "100%";
trackerEl.style.zIndex = "10000";
body.appendChild(trackerEl);

(Spaghetti Warehouse) It's the place to come and eat (You gotta try it) Soup and salad and spaghetti with meat (meatballs!) The 10-layer lasagna for me (Oh, we can share it) Will put you in the mood, great Italian food

Come and dine with us tonight

@csinchok
csinchok / Rajinder.md
Last active December 30, 2015 19:59
ClubElpaso.com Domain for Sale.

From: RAJINDER huda
To: bugs+avads

Hi there,

My company has been asked to sell one of our clients internet addresses "clubelpaso.com" Would this name be of interest to you?

From an SEO point of view this is a great name, as each and every month 1000's people type the term " Clubelpaso" into Google, making this name quite simply the best name for a company in the industry to own.

Regards,

function computeAspectRatio(_w, _h) {
if (_w !== 0 && _h !== 0) {
var aspectRatio = Math.ceil(_w/_h * 10);
//smooth out rounding issues.
switch (aspectRatio) {
case 30:
case 31:
crop = "3x1";
break;
@csinchok
csinchok / Makefile
Created January 7, 2014 20:26
Just a little thing to build a uwsgi binary with an app embedded.
BUILD_DIR := $(shell mktemp -d -t "betty-build")
UWSGI_VERSION = 1.9.21.1
UWSGI_DIR = $(BUILD_DIR)/uwsgi-$(UWSGI_VERSION)
VENV_DIR =$(BUILD_DIR)/uwsgi-$(UWSGI_VERSION)/env
all: embed
embed:
virtualenv $(BUILD_DIR)
@csinchok
csinchok / mj_hack.html
Last active August 29, 2015 13:56
Just a hack that goes into the teaser field on a video
<script type="text/javascript">
var primaryId = "1960";
var alternateIds = ["1647", "1648", "1649", "1642", "1637", "1629"];
function chooseVideo(){
var watched = localStorage.getItem("mj_video_variants");
if (watched === null) {
watched = [];
} else {