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
| // $ sudo apt-get install libboost-{system,chrono}1.48-dev | |
| // $ g++ *.cpp -lboost_{system,chrono} && time ./a.out | |
| #include <boost/chrono.hpp> // <chrono> in C++11 | |
| #include <iostream> | |
| #include <string> | |
| #include <stdint.h> // uintmax_t | |
| #include <stdlib.h> // system() | |
| #include <unistd.h> // sleep() |
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
| /c_extension_module*.so | |
| /build/* | |
| /.do_built* | |
| /log | |
| /all.did |
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
| /b2a_bin.c | |
| /b2a_bin.html | |
| /b2a_bin*.so | |
| /build/* |
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
| # based on https://launchpadlibrarian.net/94884626/testUtcToDst.patch | |
| # from https://bugs.launchpad.net/dateutil/+bug/944123 | |
| import unittest | |
| from datetime import datetime, timedelta | |
| import dateutil.tz | |
| import dateutil.zoneinfo | |
| import pytz | |
| tzname = "America/Toronto" |
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
| /.cachedir/ | |
| /comments-*.json |
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 sys | |
| from subprocess import Popen | |
| from Tkinter import Tk, StringVar | |
| import ttk | |
| START, STOP = "start", "stop" | |
| # just some arbitrary command for demonstration | |
| cmd = [sys.executable, '-c', """import sys, time | |
| print("!") |
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
| /.tox/ | |
| /*.egg-info/ | |
| /tox-*.egg/ |
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
| #!/usr/bin/env python3 | |
| """Notes on `arrow` library. | |
| * inconsitent (fixed) | |
| >>> a = arrow.get(datetime(2012, 4, 7, 0, 30, 00), 'America/New_York') | |
| >>> a.datetime.tzname() == a.tzinfo.tzname(a.datetime) # fixed | |
| True |
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
| #!/usr/bin/env python | |
| import os | |
| import time | |
| from datetime import timedelta | |
| from hashlib import sha512 | |
| import pytz # pip install pytz | |
| def filehash(path): | |
| with open(path, 'rb') as file: |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| http://stackoverflow.com/q/13655169 | |
| """ | |
| import doctest | |
| import inspect | |
| import os | |
| import sys | |
| import timeit |