Skip to content

Instantly share code, notes, and snippets.

View chengang's full-sized avatar
🏠
Working from home

Chen Gang chengang

🏠
Working from home
  • Beijing, China
View GitHub Profile

8.10 - set up test WebDAV server via lighttpd

8.11 - developped package swift-doro-webdav-client

拾拾麦穗

投投看

// ==UserScript==
// @name HookXHR
// @namespace http://tampermonkey.net/
// @version 2024-03-14
// @description try to take over the world!
// @author You
// @match https://*/*
// @run-at document-start
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/mman.h>
@chengang
chengang / http.c
Created May 20, 2019 11:56
http get in c
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <time.h>
void initRandomGenerator() {
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
srand( (uint32_t) time.tv_nsec );
}
uint64_t getRandomUint64() {
int randnum = rand();
@chengang
chengang / MacInit.sh
Last active May 29, 2018 07:22
Macbook Init
1. Xcode
2. xcode-select --install
3. homebrew
4. iterm2
5. iterm2 command+left -> Esc+b, command+right -> Esc+f
//not work right now: 6. QuickLook-plugin https://github.com/sindresorhus/quick-look-plugins
7. .vimrc
8. .profile
9. ShadowsocksX-NG https://github.com/shadowsocks/ShadowsocksX-NG
10. Keynote, Page, Number
self.TableView.intercellSpacing = NSMakeSize(0, 0)
@chengang
chengang / RNN.c
Created June 20, 2016 14:26
Simplest RNN-Learning Code
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int M[10];
int X[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int Y[10] = {1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
int O[10];
int ST = 52;
yum install python-setuptools && easy_install pip
yum install m2crypto gitLoaded plugins: fastestmirror
pip install shadowsocks
ssserver -p 443 -k OTdlZDEyYW -m rc4-md5 –user nobody -d start
@chengang
chengang / gonotify.go
Last active November 18, 2015 09:59
golang fsnotify (no CLOSE_WRITE support)
package main
import (
"errors"
"fmt"
"github.com/go-fsnotify/fsnotify"
"log"
"os"
"os/signal"
)