Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#include <stdio.h> | |
#include <limits.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <assert.h> | |
int main(void) { | |
unsigned long number = -1; |
This file contains hidden or 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 | |
# Place here your github organization/account name | |
GITHUB_ACCOUNT= | |
COMMITS=`git log ..@{u} --format=%h --no-merges` | |
for commit in $COMMITS | |
do | |
git --no-pager show $commit |
This file contains hidden or 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
""" | |
Default Dict Implementation. | |
Unlike python's collections.defaultdict, the default_factory takes the key in | |
argument. | |
""" | |
class defaultdict(dict): | |
""" | |
Default Dict Implementation. | |
Unlike python's collections.defaultdict, the default_factory (called here |
This file contains hidden or 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 | |
for file in `git diff --name-only --cached` | |
do | |
flake8 $file | |
if [ $? == 0 ] | |
then | |
ret_code=0 | |
else | |
ret_code=1 |
This file contains hidden or 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 unittest | |
ALL_0 = """\ | |
_ _ _ _ _ _ _ _ _ | |
| || || || || || || || || | | |
|_||_||_||_||_||_||_||_||_| | |
""" | |
ALL_1 = """\ | |
This file contains hidden or 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
""" | |
Dirty Scraping Around USGS website to be informed of japan quake replica. | |
""" | |
from BeautifulSoup import BeautifulSoup | |
from urllib import urlopen | |
from time import sleep | |
def get_usgs_info(): |
This file contains hidden or 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
# classinstancemethod, when you want to use both a classmethod and the function with a class instance | |
## Descriptors | |
## Anything with __get__ and optionally __set__: | |
class classinstancemethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, type=None): |
This file contains hidden or 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
# classinstancemethod, when you want to use both a classmethod and the function with a class instance | |
## Descriptors | |
## Anything with __get__ and optionally __set__: | |
class classinstancemethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, type=None): |
NewerOlder