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
/* zpipe.c: example of proper use of zlib's inflate() and deflate() | |
Not copyrighted -- provided to the public domain | |
Version 1.2 9 November 2004 Mark Adler */ | |
/* Version history: | |
1.0 30 Oct 2004 First version | |
1.1 8 Nov 2004 Add void casting for unused return values | |
Use switch statement for inflate() return values | |
1.2 9 Nov 2004 Add assertions to document zlib guarantees | |
1.3 6 Apr 2005 Remove incorrect assertion in inf() |
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
CREATE TABLE `mails` ( | |
`id` bigint(20) NOT NULL auto_increment, | |
`email` varchar(250) NOT NULL, | |
`type` char(6) NOT NULL, | |
`time` int(11) NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `email` (`email`), | |
KEY `time` (`time`), | |
KEY `type` (`type`) | |
) ENGINE=MyISAM; |
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
#Took: 6.605544 seconds | |
#Took: 15.969022 seconds | |
#Took: 4.270395 seconds | |
#Took: 3.229852 seconds | |
import re | |
import time | |
DATETIME_BLACKLIST = ['1970-01-01 01:00:00', '1970-01-01 00:00:00', '0000-00-00 00:00:00'] |
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 time | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
from pygame import mixer | |
log = open("radio7.log", "a") | |
mixer.init() | |
alert = mixer.Sound('alarm.wav') | |
lastpic = "" |
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
Don't use MongoDB | |
================= | |
I've kept quiet for awhile for various political reasons, but I now | |
feel a kind of social responsibility to deter people from banking | |
their business on MongoDB. | |
Our team did serious load on MongoDB on a large (10s of millions | |
of users, high profile company) userbase, expecting, from early good | |
experiences, that the long-term scalability benefits touted by 10gen |
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
<?php | |
namespace FOO; | |
function strlen($arg) { | |
return 42; | |
} | |
// "my" strlen | |
echo strlen('lala'), "\n"; |
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 imp | |
import os | |
import sys | |
import threading | |
USAGE = "python %s YOUR_MODULE TIMEOUT_IN_SECONDS arg1 arg2 arg3" % sys.argv[0] | |
class ModuleRunner(threading.Thread): | |
def __init__(self, module_name): | |
threading.Thread.__init__(self) |
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
public class Main { | |
static interface InterfaceA { | |
public void speak(); | |
} | |
static interface InterfaceB extends InterfaceA { | |
public void sit(); | |
} |
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 flask | |
import flask.views | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
class MyFlaskExt(object): | |
def __init__(self, app=None): | |
if app is not None: | |
self.init_app(app) |
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 __future__ import print_function | |
import argparse | |
import csv | |
import requests | |
import sys | |
_EPILOG = """ | |
Script takes a list of .csv files, tries to guess their format (seperator), | |
then checks for a field called 'URL', tries to fetch that url and prints |
OlderNewer