Skip to content

Instantly share code, notes, and snippets.

View cute-angelia's full-sized avatar
🎯
最近在开发游戏服务端,网络基础框架还是比一般的服务复杂

Angelia cute-angelia

🎯
最近在开发游戏服务端,网络基础框架还是比一般的服务复杂
View GitHub Profile
@cute-angelia
cute-angelia / get_gv_loop.sh
Created April 1, 2017 09:54 — forked from Jiezhi/get_gv_loop.sh
replace your curl
for (( i=1; i>0; i++ ))
do
curl 'https://www.google.com/voice/b/0/service/post' -H 'origin: https://www.google.com' -H 'dnt: 1' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-CN,zh;q=0.8,en;q=0.6' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36' -H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' -H 'accept: */*' -H 'referer: https://www.google.com/voice/b/0' -H 'authority: www.google.com' -H 'cookie: gv=.........; GV_NR=1;-eVupmL6qR...........ncdG7vO' --data 'sid=...' --compressed
sleep 3s
done
@cute-angelia
cute-angelia / hosts
Last active July 29, 2018 08:27 — forked from alswl/hosts
hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@cute-angelia
cute-angelia / ExportCsv.php
Created October 20, 2017 05:57 — forked from HugoWen/ExportCsv.php
php export csv file
function exportCSV($filename, $data)
{
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header("Content-Disposition:attachment;filename=".$filename);
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');
echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo $data;
@cute-angelia
cute-angelia / toCsv.php
Created October 20, 2017 06:06 — forked from ring0li/toCsv.php
csv
/**
* Export an array as downladable Excel CSV
* http://stackoverflow.com/questions/155097/microsoft-excel-mangles-diacritics-in-csv-files
* @param array $header
* @param array $data
* @param string $filename
*/
function toCSV($header, $data, $filename) {
$sep = "\t";
$eol = "\n";
@cute-angelia
cute-angelia / mm.go
Created October 31, 2017 01:31 — forked from lerry/mm.go
package main
import (
"io"
"os"
"fmt"
"sync"
"strconv"
"strings"
@cute-angelia
cute-angelia / nginx
Last active December 25, 2017 02:12 — forked from pzorn/nginx
php-fpm and nginx init.d script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: NGINX is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
var Base64 = {
// private property
@cute-angelia
cute-angelia / userhomedir.go
Created November 4, 2019 13:49 — forked from miguelmota/userhomedir.go
Golang get user home directory path
package main
import (
"fmt"
"os"
"runtime"
)
func userHomeDir() string {
if runtime.GOOS == "windows" {
@cute-angelia
cute-angelia / aes-256-cbc-test.js
Created February 28, 2020 15:19 — forked from brettscott/aes-256-cbc-test.js
AES 256 CBC encryption between Golang and Node JS
// Node v6.9.0
//
// TEST FILE (cut down for simplicity)
// To ensure Golang encrypted string can be decrypted in NodeJS.
//
let crypto;
try {
crypto = require('crypto');
@cute-angelia
cute-angelia / build.sh
Last active March 4, 2020 05:35 — forked from tmpbook/build.sh
Jenkins build setup for Go Projects.
# You need install jenkins go plugin first -> https://wiki.jenkins.io/display/JENKINS/Go+Plugin
#!/usr/bin/bash
pwd
export GOPROXY=https://goproxy.io
cd ./ && make proto
export GOROOT=/usr/local/go
export GOPATH=$WORKSPACE
mkdir -p $GOPATH/src