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
#!/bin/bash | |
while read oldrev newrev ref; do | |
result=$(GIT_WORK_TREE=/path/to/deploy/repo git checkout -f $newrev) | |
if [ $? -eq 0 ]; then | |
echo 'Deploy Success!' | |
else | |
echo $result | |
fi | |
done |
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
params = (search = location.search) -> | |
RE = /(\?|&)([^=&]+)(=([^&$]*))?(?=&|$)/ | |
matches = search.match RegExp RE.source, 'g' | |
return {} unless matches | |
matches.reduce (memo, elem) -> | |
matchParts = elem.match RE | |
value = matchParts[4] | |
# if value is '' or undefined, keep it |
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
#!/sbin/runscript | |
extra_commands="debug" | |
SENTRY_COMMAND="/home/sentry/sentry-env/bin/sentry" | |
SENTRY_CONFILE=/home/sentry/sentry.conf.py | |
SENTRY_USER=sentry | |
SENTRY_PIDFILE=/var/run/sentry.pid | |
SENTRY_LOGFILE=/home/sentry/sentry.log |
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
#!/sbin/runscript | |
DAEMON=/usr/local/sbin/ocserv | |
PIDFILE=/var/run/ocserv.pid | |
LOGFILE=/var/log/ocserv.log | |
DAEMON_ARGS="-f -d 1" | |
extra_commands="debug" | |
depend() { |
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
> ~ $ echo '{"ni":1}' | LANG=en_US.utf-8 python -c 'import json, sys; print json.dumps(sys.stdin.read())' | |
"{\"ni\":1}\n" | |
> ~ $ echo '{"ni":1}' | LANG=en_US.utf-8 python -c 'import json, sys; print json.dumps(json.loads(sys.stdin.read()), indent=2, separators=(",", ": "))' | |
{ | |
"ni": 1 | |
} |
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
server { | |
listen 80; | |
server_name ci.server.name; | |
ignore_invalid_headers off; | |
access_log /var/log/nginx/jenkins.access_log main; | |
error_log /var/log/nginx/jenkins.error_log info; | |
location / { |
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
originJSON = window.JSON or global.JSON | |
JSON = { | |
parse: (-> originJSON.parse.apply originJSON, arguments) | |
# http://stackoverflow.com/a/4901205 | |
stringify: (obj, replacer, space) -> | |
unicodeRE = /[\u007f-\uffff]/g | |
# 如果直接在 JSON.stringify 的 replacer 里面加 '\\u' ,结果会真的被 JSON | |
# 替换为 \\u ,最终输出的结果就是 {"a": "\\u007f"} ,所以需要在得到 json 以 |
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) 2015-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ | |
#import "AppDelegate.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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
on format_time(currTime as date) | |
set stamp to the time of currTime | |
set h to text -2 thru -1 of ("00" & (stamp div (60 * 60))) | |
set m to text -2 thru -1 of ("00" & (stamp - (60 * 60) * h) div 60) | |
set s to text -2 thru -1 of ("00" & (stamp - ((60 * 60) * h + 60 * m))) | |
return h & ":" & m & ":" & s | |
end format_time | |
-- from http://henrysmac.org/blog/2014/1/4/formatting-short-dates-in-applescript.html | |
on format_date(currTime as date) |