Skip to content

Instantly share code, notes, and snippets.

View ZijiaLewisLu's full-sized avatar

Zijia Lu ZijiaLewisLu

View GitHub Profile
@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 21, 2024 06:32
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@turicas
turicas / unix_time.py
Created March 30, 2013 22:06
Python function to retrieve `real`, `sys` and `user` elapsed times, like UNIX command-line `time`.
# coding: utf-8
from resource import getrusage as resource_usage, RUSAGE_SELF
from time import time as timestamp
def unix_time(function, args=tuple(), kwargs={}):
'''Return `real`, `sys` and `user` elapsed time, like UNIX's command `time`
You can calculate the amount of used CPU-time used by your