Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
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
#ifdef _WIN64 | |
//define something for Windows (64-bit) | |
#elif _WIN32 | |
//define something for Windows (32-bit) | |
#elif __APPLE__ | |
#include "TargetConditionals.h" | |
#if TARGET_OS_IPHONE && TARGET_IPHONE_SIMULATOR | |
// define something for simulator | |
#elif TARGET_OS_IPHONE | |
// define something for iphone |
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
See my DASH-IF presentation from October, 2014: | |
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/ | |
1. encode multiple bitrates with keyframe alignment: | |
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \ | |
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4 | |
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment | |
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012. |
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
"""Demonstrates how to construct and send raw Ethernet packets on the | |
network. | |
You probably need root privs to be able to bind to the network interface, | |
e.g.: | |
$ sudo python sendeth.py | |
""" | |
from socket import * |
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
""" | |
Add copy to clipboard from IPython! | |
To install, just copy it to your profile/startup directory, typically: | |
~/.ipython/profile_default/startup/ | |
Example usage: | |
%clip hello world | |
# will store "hello world" |
Having trouble installing the latest stable version of tmux?
Save yourself some time and run this little fellow!
- gcc
- wget
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
/** | |
* Scrolling shadows by @kizmarh and @leaverou | |
* Only works in browsers supporting background-attachment: local; & CSS gradients | |
* Degrades gracefully | |
*/ | |
html { | |
background: white; | |
font: 120% sans-serif; | |
} |
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
include "/usr/share/X11/locale/en_US.UTF-8/Compose" | |
# Punctuation | |
# знаки препинания, необходимые в русском, которых нет в en_US.UTF-8/Compose | |
<Multi_key> <period> <minus> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие | |
<Multi_key> <period> <space> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие | |
<Multi_key> <?> <!> : "⁈" U2048 # QUESTION EXCLAMATION, ?! | |
<Multi_key> <period> <colon> : "…" # ELLIPSIS | |
# №: набирается в русской раскладке без ухищрений, |
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
""" | |
Copyright (c) 2012 Zohaib Sibte Hassan | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
NewerOlder