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" | |
// Constant definitions | |
const MaxUint = ^uint(0) | |
const MinUint = 0 | |
const MaxInt = int(^uint(0) >> 1) | |
const MinInt = -MaxInt - 1 |
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 | |
/** | |
* Class Dependency injection | |
*/ | |
class DI | |
{ | |
protected $store = []; |
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 ( | |
"encoding/json" | |
"fmt" | |
) | |
type Source struct { | |
ID string `json:"id"` | |
Title string `json:"title"` |
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" | |
"time" | |
"gopkg.in/redis.v5" | |
) | |
func 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
zval ex, info; | |
zend_class_entry *def_ex = zend_ce_exception, *pdo_ex = zend_ce_exception; | |
object_init_ex(&ex, pdo_ex); | |
zend_update_property_string(def_ex, &ex, "message", sizeof("message")-1, message); | |
zend_update_property_string(def_ex, &ex, "code", sizeof("code")-1, *pdo_err); | |
array_init(&info); |
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
var csrfToken = { | |
init:function(){ | |
var me = csrfToken; | |
var header = "WW-Csrf-Token"; | |
var token = $("input[name='_ww_csrf_token']").val(); | |
if(token == null) { | |
token = $("meta[name='_ww_csrf_header']").attr("content"); | |
} | |
if((token != null) && (token != "null") && (token.length >0) && (token != undefined)) { |
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 ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"strings" | |
) |
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 | |
$SECRET_KEY = '387a1a3091c29cf7ff253621c347f6df'; | |
$args = $_POST; | |
// 校验必要参数是否存在 | |
if((!isset($args['sign'])) || (!isset($args['timestamp']))){ | |
echo "缺少必要参数"; | |
exit(1); | |
} | |
// 校验请求是否过期,自定义延迟10分钟以上的消息丢弃 |
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 | |
$host = "192.168.104.1xxx3"; | |
$port = 3306; | |
$user = "xxxx"; | |
$password="xxx"; | |
$dbname = "xx"; | |
$table = "xxx"; | |
$db = new PDO("mysql:host={$host};port={$port};dbname={$dbname};charset=UTF8;", $user,$password, array(PDO::ATTR_PERSISTENT=>true)); |
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 ( | |
"net/http" | |
"log" | |
"flag" | |
"os" | |
"os/exec" | |
"sync" | |
"fmt" |