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
func (bus *EventBus) find(register *Register) int { | |
bus.registersLock.RLock() | |
defer bus.registersLock.RUnlock() | |
for i := 0; i < len(bus.registers); i++ { | |
if bus.registers[i] == register { | |
return i | |
} | |
} | |
return -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
package util | |
import "encoding/json" | |
func JsonStringify(obj interface{}, intent bool) string { | |
if intent { | |
data, err := json.MarshalIndent(obj, "", " ") | |
if err != nil { | |
return "" | |
} |
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
package main | |
import ( | |
"fmt" | |
"log" | |
zmq "github.com/pebbe/zmq4" | |
uuid "github.com/satori/go.uuid" | |
) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Dynamic; | |
namespace Json | |
{ | |
public class 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
function range(n) | |
return coroutine.wrap(function() | |
for i = 1, n, 1 do | |
coroutine.yield(i) | |
end | |
end) | |
end | |
function main() | |
for i in range(10) do |
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 parse_json_date(json_date) | |
local pattern = "(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%-])(%d?%d?)%:?(%d?%d?)" | |
local year, month, day, hour, minute, | |
seconds, offsetsign, offsethour, offsetmin = json_date:match(pattern) | |
local timestamp = os.time{year = year, month = month, | |
day = day, hour = hour, min = minute, sec = seconds} | |
local offset = 0 | |
if offsetsign ~= 'Z' then | |
offset = tonumber(offsethour) * 60 + tonumber(offsetmin) | |
if xoffset == "-" then offset = offset * -1 end |
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
sudo hdiutil create ~/Documents/case-sensitive.dmg -volname "case-sensitive" -size 10g -fs "Case-sensitive HFS+" | |
sudo hdiutil mount ~/Documents/case-sensitive.dmg | |
cd /Volumes/case-sensitive |
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
// quu..__ | |
// $$$b `---.__ | |
// "$$b `--. ___.---uuudP | |
// `$$b `.__.------.__ __.---' $$$$" . | |
// "$b -' `-.-' $$$" .'| | |
// ". d$" _.' | | |
// `. / ..." .' | | |
// `./ ..::-' _.' | | |
// / .:::-' .-' .' | |
// : ::''\ _.' | |
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/openrc-run | |
name=shadowsocksr | |
cfgfile="/usr/local/shadowsocksr/user-config.json" | |
command="/usr/local/shadowsocksr/shadowsocks/server.py" | |
command_args="--pid-file /var/run/shadowsocksr.pid -c /usr/local/shadowsocksr/user-config.json" | |
pidfile="/var/run/shadowsocksr.pid" | |
start_stop_daemon_args="" | |
command_background="yes" | |
command_user="root" |
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
{"channels":[{"name":"CCTV-1综合高清","url":"http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8"},{"name":"CCTV-3综艺高清","url":"http://ivi.bupt.edu.cn/hls/cctv3hd.m3u8"},{"name":"CCTV-5+体育赛事高清","url":"http://ivi.bupt.edu.cn/hls/cctv5phd.m3u8"},{"name":"CCTV-6电影高清","url":"http://ivi.bupt.edu.cn/hls/cctv6hd.m3u8"},{"name":"CCTV-8电视剧高清","url":"http://ivi.bupt.edu.cn/hls/cctv8hd.m3u8"},{"name":"CHC高清电影","url":"http://ivi.bupt.edu.cn/hls/chchd.m3u8"},{"name":"北京卫视高清","url":"http://ivi.bupt.edu.cn/hls/btv1hd.m3u8"},{"name":"北京文艺高清","url":"http://ivi.bupt.edu.cn/hls/btv2hd.m3u8"},{"name":"北京纪实高清","url":"http://ivi.bupt.edu.cn/hls/btv11hd.m3u8"},{"name":"湖南卫视高清","url":"http://ivi.bupt.edu.cn/hls/hunanhd.m3u8"},{"name":"浙江卫视高清","url":"http://ivi.bupt.edu.cn/hls/zjhd.m3u8"},{"name":"江苏卫视高清","url":"http://ivi.bupt.edu.cn/hls/jshd.m3u8"},{"name":"东方卫视高清","url":"http://ivi.bupt.edu.cn/hls/dfhd.m3u8"},{"name":"安徽卫视高清","url":"http://ivi.bupt.edu.cn/hls/ahhd.m3u8"},{"name":"黑龙江卫视高清","url":"http://ivi.bupt.edu.cn/hls/hljhd.m3u8"},{"name":"辽宁卫 |
OlderNewer