Skip to content

Instantly share code, notes, and snippets.

View ety001's full-sized avatar
🎯
Focusing

ety001 ety001

🎯
Focusing
View GitHub Profile
<?php
$name = $_GET['name'];
header('Content-type:image/png');
echo file_get_contents('/home/ety001/Desktop/'.$name.'.png');
@ety001
ety001 / wx.php
Created January 14, 2014 14:22
wx
<?php
/**
* wechat php test
*/
//define your token
define("TOKEN", "weixin");
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid();
<?php
/*-------------------------------------------------
| index.php [ 微信公众平台接口 ]
+--------------------------------------------------
| Author: LinYunpeng <QQ:50663950>
+------------------------------------------------*/
$wechatObj = new wechat();
$wechatObj->responseMsg();
class wechat {
#encoding=utf-8
# 甄码农代码 2012 03 06
# 打开sqlite3内存数据库,执行操作,将内存数据库保存到文件
# http://my.oschina.net/u/89296/blog/42717
import sqlite3
import StringIO
#使用:memory:标识打开的是内存数据库
con = sqlite3.connect(":memory:")
@ety001
ety001 / apply-call.js
Last active August 29, 2015 14:02
JS apply call
var Person = function(name,age){
this.name = name;
this.age = age;
}
var Print = function(){
this.functionName = 'Print';
this.show = function(){
var msg = [];
for(var key in this){
if(typeof(this[key])!='function'){
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks
#! /bin/sh
case "$1" in
start)
/usr/local/bin/ssserver -c /etc/config.json > /dev/null 2>&1 &
;;
stop)
pkill -9 ssserver
;;
var app = require('express')();
var bodyParser = require('body-parser');
var multer = require('multer');
//app.use(bodyParser.json());
//app.use(bodyParser.urlencoded({
// extended: true
//}));
//app.use(multer);
app.get('/', function(req, res) {
res.send("Hello world!\n");
@ety001
ety001 / qu1
Created December 21, 2014 07:26
var _data = {
web_title : 'test_web_title',
url : 'http%3A%2F%2Fwww.demohour.com%2Fprojects%2F351614',
url_hash : '3335cf59a624847a6638ce19c2b98b02',
comment_text : '<script>alert(123)</script>'
};
写一个算法,遍历_data,生成下面的结果.
Result:
{ web_title: 'test_web_title' }
-------
@ety001
ety001 / datatransfer.py
Last active August 29, 2015 14:15
datatransfer
# coding=utf-8
import sys,os
import os.path
import xlrd
import pypyodbc
from datetime import *
import time
import types