These rules are adopted from the AngularJS commit conventions.
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 | |
| usage () | |
| { | |
| cat <<UsageHERE | |
| boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host | |
| Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT | |
| or boot2docker-fwd -d RULE_NAME | |
| or boot2docker-fwd -l | |
| or boot2docker-fwd -A |
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
| <?php | |
| // all default values | |
| MongoSessionPersistence::create() | |
| ->connect() | |
| ->register(); | |
| // connect to concrete server/db | |
| MongoSessionPersistence::create() | |
| ->connect('mongodb://mongo_server:27017', 'databaseName') | |
| ->useLifeTime(60*60) // lifetime=1 hour |
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
| redis-cli EVAL "$(cat hello.lua)" 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
| package model | |
| import ( | |
| "strings" | |
| uuid "github.com/satori/go.uuid" | |
| ) | |
| // BaseUUID auto gen uuid xorm base model | |
| type BaseUUID struct { |
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
| package common | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| // Timestamp 自定义时间戳类型,支持Mysql的TIMESTAMP,DATETIME,DATE类型 | |
| type Timestamp int64 |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "runtime" | |
| "strconv" | |
| "strings" | |
| "sync" | |
| "time" |
Dockerized: V2ray + WebSocket + TLS + Web
also see: https://toutyrater.github.io/advanced/wss_and_web.html
Server side sontents:
- Caddyfile
- config.json
- docker-compose.yml
Client side contents:
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
| function download() { | |
| let token = ''; | |
| let data = {id: id}; | |
| new Promise((resolve, reject) => { | |
| axios({ | |
| url: `/`, | |
| method: 'POST', | |
| headers: {'X-USER-TOKEN': token}, // custom token | |
| data: data, // json object | |
| responseType: 'blob', // important! |
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
| package ddns | |
| import ( | |
| "log" | |
| "net" | |
| "sync" | |
| ) | |
| var ( | |
| dnsLock = &sync.Mutex{} |
OlderNewer