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
fingerprint: | |
A3D4 3A29 8737 27DF 0332 4F3F CE04 2F08 D030 B175 | |
public key: | |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQGNBGNM+40BDADQc9srvea/E/XzwsybseuSSEQIn2Xl3GTuKPlFio80MuLt8nsc | |
CuJVgzyem13qQHGowu14pG0mZdh1cSC8dwhuCTF3YSgWD7pPkoaeU8/s6dbDUSH8 | |
8Ku/anB5e3iOrhMKIExxKzTU7edt44rzeBv/hydrZUkZ1JM/IxfnKAUrG1zhGfDH | |
k31Mhgwd34zDj/qXku/J1cB6Ry9x4iR8E5ybpL6DohSKB7VHVfnLukT8ZB6qKK6O |
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
// gin | |
func StringToBytes(s string) []byte { | |
return *(*[]byte)(unsafe.Pointer( | |
&struct { | |
string | |
Cap int | |
}{s, len(s)}, | |
)) | |
} |
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" | |
"reflect" | |
) | |
type row struct { i, j int } | |
func main() { |
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 NilInterface(i interface{}) bool { | |
iVal := reflect.ValueOf(i) | |
switch iVal.Kind() { | |
case reflect.Invalid: | |
return i == nil | |
case reflect.Chan, reflect.Map, reflect.Slice, reflect.Interface, reflect.Func: | |
fallthrough | |
case reflect.Ptr, reflect.UnsafePointer: | |
return iVal.IsNil() |
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
import ctypes | |
import time | |
SendInput = ctypes.windll.user32.SendInput | |
# C struct redefinitions | |
PUL = ctypes.POINTER(ctypes.c_ulong) | |
class KeyBdInput(ctypes.Structure): | |
_fields_ = [("wVk", ctypes.c_ushort), | |
("wScan", ctypes.c_ushort), |
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
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define NGX_OK 0 | |
#define NGX_ERROR -1 | |
#define NGX_SETPROCTITLE_PAD '\0' | |
typedef int ngx_int_t; |
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 2011 Jesper de Jong | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/** | |
* 二进制数据与Set互转 | |
*/ | |
@MappedJdbcTypes({JdbcType.VARBINARY}) | |
public abstract class AbstractSetBinaryConverter<T> implements TypeHandler<Set<T>> { | |
/** | |
* 暂用json序列化 | |
*/ | |
private static final ObjectMapper OM = new ObjectMapper(); |
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
// -*- coding:utf-8-unix; mode:c; -*- | |
/* | |
get the active window on X window system | |
http://k-ui.jp/blog/2012/05/07/get-active-window-on-x-window-system/ | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <locale.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
location /capture/ { | |
internal; | |
rewrite ^/capture/(https?)/([^/]+)/(\d+)/(.*) /$4 break; | |
proxy_pass $1://$2:$3; | |
} | |
usage like this: | |
-- url: http://www.hejizhan.com/s/forum.php | |
ngx.location.capture("/capture/http/www.hejizhan.com/80/s/forum.php" |
NewerOlder