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
/* | |
* c99-heap.c | |
* - Description: Simple std::priority_queue-like container implemented in C99, without error handling and thread-safety | |
* - Author: Shao-Chung Chen | |
* - License: CC0 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> |
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
/* | |
* c99-vector.c | |
* - Description: Simple std::vector-like container implemented in C99, without error handling and thread-safety | |
* - Author: Shao-Chung Chen | |
* - License: CC0 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
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
function repImg( tar ) { | |
var div = document.createElement( 'div' ); | |
div.style.height = tar.height + 'px'; | |
div.style.width = tar.width + 'px'; | |
div.style.display = 'inline-block'; | |
div.style.backgroundColor = 'transparent'; | |
// http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser | |
var isFirefox = typeof InstallTrigger !== 'undefined'; |
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 <unistd.h> | |
#include <mach/mach.h> | |
#include <mach/mach_vm.h> | |
#include <mach-o/dyld.h> | |
int | |
main (int argc, char * argv[]) | |
{ | |
volatile char * library; | |
const mach_vm_size_t page_size = getpagesize (); |
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
// ==UserScript== | |
// @name Pocket Web Customized | |
// @description Cusotmizations/Simplifications for Pocket Web | |
// @namespace http://getpocket.com | |
// @author Shao-Chung Chen | |
// @license MIT (http://opensource.org/licenses/MIT) | |
// @version 1.9.1 | |
// @include http://getpocket.com/* | |
// @include https://getpocket.com/* | |
// |
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
#!/usr/bin/env python | |
import os | |
import re | |
import md5 | |
import sys | |
import json | |
import urllib | |
import urllib2 | |
try: |
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
require 'digest' | |
filename = "House.Of.Cards.2013.S02E01.720p.WEB-DL.x264-Sohu.mp4" | |
f = File.new(filename, "rb") | |
puts f.stat.inspect | |
file_size = File.size?(filename) | |
offset = [] |
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
# First commit | |
echo "hello" | git hash-object -w --stdin | |
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt | |
git write-tree | |
git commit-tree aaa96c -m "First commit" | |
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d | |
# Second commit |
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
{ | |
"binary_file_patterns": | |
[ | |
"*.psd" | |
], | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme", | |
"detect_indentation": false, | |
"disable_formatted_linebreak": true, | |
"drag_text": false, |
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
var extend_keyboard_event_with_keycode = function(original_event_name) { | |
var $fn_original = $.fn[original_event_name]; | |
var keyboard_event_function_wrapper = function(keycodes, handler) { | |
return function(e) { | |
if(keycodes.indexOf(e.which) != -1) | |
return handler(e); | |
} | |
} |
NewerOlder