Skip to content

Instantly share code, notes, and snippets.

@liyonghelpme
liyonghelpme / demo.go
Last active April 28, 2016 21:22
golang http proxy
package main
import (
"flag"
"log"
"net/http"
"strings"
"unicode"
"io/ioutil"
//"os"
)
@liyonghelpme
liyonghelpme / pro2.py
Last active August 29, 2015 14:02
python http proxy greenlet 非阻塞
#coding:utf8
import os, sys, thread, socket
from multiprocessing import Process
import time
BACKLOG = 50
MAX_DATA_RECV = 4096
DEBUG = False
LUA_CFLAGS=`pkg-config lua5.1 --cflags`
all: stringext.so
stringext.so: stringext.c
gcc $(LUA_CFLAGS) -O3 -fPIC -o stringext.o -c stringext.c
gcc -shared -O3 stringext.o -o stringext.so
#!/usr/bin/env bash
if [[ ! ( # any of the following are not true
# 1st arg is an existing regular file
-f "$1" &&
# ...and it has a .ipa extension
"${1##*.}" == "ipa" &&
# 2nd arg is an existing regular file
-f "$2" &&
# ...and it has an .mobileprovision extension
#include <NewPing.h>
#include <AFMotor.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <HMC5883L.h>
#define TRIGGER_PIN 14
#define ECHO_PIN 15
#define MAX_DISTANCE 200
#include <NewPing.h>
#include <AFMotor.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <HMC5883L.h>
#define TRIGGER_PIN 14
#define ECHO_PIN 15
#define MAX_DISTANCE 200
#include <NewPing.h>
#include <AFMotor.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <HMC5883L.h>
#define TRIGGER_PIN 14
#define ECHO_PIN 15
#define MAX_DISTANCE 200
#include <NewPing.h>
#include <AFMotor.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <HMC5883L.h>
#define TRIGGER_PIN 14
#define ECHO_PIN 15
#define MAX_DISTANCE 200
#include <NewPing.h>
#include <AFMotor.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <HMC5883L.h>
#define TRIGGER_PIN 14
#define ECHO_PIN 15
#define MAX_DISTANCE 200
#include <NewPing.h>
#include <AFMotor.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#define TRIGGER_PIN 14
#define ECHO_PIN 15
#define MAX_DISTANCE 200
AF_DCMotor Motor1(1);