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> | |
int | |
main(int argc, char *argv[]) | |
{ | |
printf("hello, world!"); | |
return 0; | |
} |
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
<div id="disqus_thread"></div> | |
<script type="text/javascript"> | |
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | |
var disqus_shortname = 'example'; // required: replace example with your forum shortname | |
/* * * DON'T EDIT BELOW THIS LINE * * */ | |
(function() { | |
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); |
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/sh | |
#curl https://gist.githubusercontent.com/webee/6581853/raw/pyenv.sh |sudo sh | |
#set -x | |
#resource url. | |
#check root. | |
root=$(whoami) | |
if [ "$root" != "root" ];then | |
echo "need root privilege." | |
exit 1 | |
fi |
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
if [ "${0:0:1}" != "-" ]; then | |
export PY_PROFILE=$(readlink -f $0) | |
fi | |
export PY_ROOT=/home/q/python | |
export PY_HOME=$PY_ROOT/default | |
export PY_ENV=$PY_ROOT/env | |
export PY_SRC=$PY_ROOT/src | |
export PY_XSRC=$PY_ROOT/xsrc | |
export PY_DEFAULT_ENV=main |
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
" todo. |
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 | |
name=$1 | |
username=webee | |
template=test-maven-project | |
function LOG_INFO() { | |
local msg=$1 | |
echo "[$(date +'%Y-%m-%d %H:%M:%S.%N')][INFO] ${msg}" |
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 logging | |
def get_logger(): | |
level = logging.DEBUG | |
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(module)s[%(lineno)d] - %(funcName)s - %(message)s') |
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/sh | |
# | |
# /etc/rc.d/init.d/supervisord | |
# | |
# Supervisor is a client/server system that | |
# allows its users to monitor and control a | |
# number of processes on UNIX-like operating | |
# systems. | |
# | |
# chkconfig: - 64 36 |
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/env sh | |
date2stamp () { | |
date --utc --date "$1" +%s | |
} | |
stamp2date (){ | |
date --utc --date "1970-01-01 $1 sec" "+%Y-%m-%d %T" | |
} | |
dateDiff (){ |
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
// refer to: http://rosettacode.org/wiki/Add_a_variable_to_a_class_instance_at_runtime#Swift | |
// this is stupid, just inherit the target class. | |
import Foundation | |
class ObjectAssociateUtil { | |
static var objKeys = [String:UnsafePointer<()>]() | |
class func getAssociateObject<T:AnyObject, D>(target:T, by_key key:String) -> D? { | |
let objKeyName = "\(NSStringFromClass(target.dynamicType)).\(key)" | |
if let objKey = objKeys[objKeyName] { |
OlderNewer