Skip to content

Instantly share code, notes, and snippets.

@loschke
loschke / Bootstrap-3_Carousel-Collection
Last active March 6, 2024 15:31
Bootstrap 3 - Carousel Collection Pack
@mbostock
mbostock / type.js
Created December 11, 2012 17:59
GeoJSON Transforms
function d3_geo_type(types) {
for (var type in d3_geo_typeDefaults) {
if (!(type in types)) {
types[type] = d3_geo_typeDefaults[type];
}
}
return types;
}
var d3_geo_typeDefaults = {
@cjgiridhar
cjgiridhar / sqliteform.html
Created August 25, 2012 16:39
Tornado - SQLite DB
<html>
<title>
SQLite Example
</title>
<body>
<FORM ACTION="/create" METHOD=POST>
Name: <input type="text" name="name">
Marks: <input type="text" name="marks">
@HowardMei
HowardMei / django_interface.py
Created May 7, 2012 03:47 — forked from niwinz/django_interface.py
Django websockets with tornado, gevent and zeromq
# -*- coding: utf-8 -*-
from gevent import monkey; monkey.patch_all()
import gevent
from gevent_zeromq import zmq
class WebSocketHandler(object):
def __init__(self, _id, in_queue, socket):
@cyberswat
cyberswat / git-init.sh
Created February 28, 2012 16:35
Initialize git repo and make first commit
# switch to the jenkins user
[root@li220-252:~] su jenkins
jenkins@li220-252:/root$
# Move into the jenkins directory
jenkins@li220-252:~$ cd /var/lib/jenkins/
# Intialize a git repository
jenkins@li220-252:~$ git init
Initialized empty Git repository in /var/lib/jenkins/.git/
@perpetual-hydrofoil
perpetual-hydrofoil / unfollow.py
Last active January 19, 2023 01:35
Twitter Unfollow Example (python)
#! /usr/bin/env python
# how to unfollow everyone who isn't following you
# By Jamieson Becker (Public Domain/no copyright, do what you will)
# Easy instructions, even if you don't know Python
#
# 1. Install pip (apt-get install python-pip) and then
# pip install tweepy, which is the python twitter client
#
@macek
macek / .htaccess
Created September 29, 2010 21:59
Redirect without www on Nginx and Engine Yard
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
import os
import httplib
import tornado.web
class ErrorHandler(tornado.web.RequestHandler):
"""Generates an error response with status_code for all requests."""
def __init__(self, application, request, status_code):
tornado.web.RequestHandler.__init__(self, application, request)
self.set_status(status_code)
@eriwen
eriwen / check_feedburner.py
Created November 4, 2009 21:30
check_feedburner.py
#!/usr/bin/env python
# Usage: ./check_feedburner.py MyFeedName
import re, sys, urllib, fileinput
from xml.dom import minidom
AWARENESS_API_URL = 'https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=%s'
# If you want to replace the feedburner count in a given file, define it here
FEED_COUNT_FILE = '/path/to/your/file.php'
@danmackinlay
danmackinlay / supervisord.sh
Created August 27, 2009 07:07
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.