Skip to content

Instantly share code, notes, and snippets.

View gist:acdb1a2378e2731e98fad2a28e83bf31
ZYNGA INC.
50 User License
EA7E-811825
927BA117 84C9300F 4A0CCBC4 34A56B44
985E4562 59F2B63B CCCFF92F 0E646B83
0FD6487D 1507AE29 9CC4F9F5 0A6F32E3
0343D868 C18E2CD5 27641A71 25475648
309705B3 E468DDC4 1B766A18 7952D28C
E627DDBA 960A2153 69A2D98A C87C0607
45DC6049 8C04EC29 D18DFA40 442C680B
@guoxiangke
guoxiangke / .htaccess
Created Feb 5, 2018
Exclude one url from Apache .htaccess password protected site
View .htaccess
AuthType Basic
AuthName "Authentication Required"
AuthUserFile /etc/htpasswd/.htpasswd
# Allow access to excluded diretories
SetEnvIf Request_URI /contact-us/ noauth=1
SetEnvIf Request_URI /*.css noauth=1
SetEnvIf Request_URI /*.js noauth=1
SetEnvIf Request_URI /*.ico noauth=1
SetEnvIf Request_URI /*.png noauth=1
SetEnvIf Request_URI /*.jpg noauth=1
View php_serial.class.php
<?php
define ("SERIAL_DEVICE_NOTSET", 0);
define ("SERIAL_DEVICE_SET", 1);
define ("SERIAL_DEVICE_OPENED", 2);
/**
* Serial port control class
*
* THIS PROGRAM COMES WITH ABSOLUTELY NO WARANTIES !
* USE IT AT YOUR OWN RISKS !
View durpal-make-file-glup
var Promise = require('es6-promise').Promise;
var gulp = require('gulp');
var livereload = require('gulp-livereload')
var uglify = require('gulp-uglifyjs');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
// http://blog.andrewray.me/how-to-copy-only-changed-files-with-gulp/
@guoxiangke
guoxiangke / drupal8-make-start
Created Jul 28, 2016
drupal8 start project makefile
View drupal8-make-start
DRUPAL_VERSION ?= 8.1.7
default: build
build: build-drupal
#chown -R $(WWW_USER):$(WWW_GROUP) ./build
# when any changes in backend ,do build-drupal
build-drupal:
cp -rf ./backend/modules ./public_html/
View gist:75fbc720fd6f6264d6f8
$account = user_load(12);
$weObj = _mp_service_init_wechat($account);
// $weObj->valid();
set_time_limit(0);
$qr = DRUPAL_ROOT.'/sites/default/files/QR/01/QR_1409.jpg';
// $qr = $file_path.'QR_'.$account->uid.'.jpg';
$data= array('media'=>$qr);//'@'.
$return = $weObj->uploadForeverMedia($data,'image');//
View QQ
/\:\:)=<img class="wechat-emoji" src="/img/emoji/wechat/100.gif" alt="微笑" width="24">
/\:\:~=<img class="wechat-emoji" src="/img/emoji/wechat/101.gif" alt="伤心">
/\:\:B=<img class="wechat-emoji" src="/img/emoji/wechat/102.gif" alt="美女">
/\:\:|=<img class="wechat-emoji" src="/img/emoji/wechat/103.gif" alt="发呆">
/\:8-)=<img class="wechat-emoji" src="/img/emoji/wechat/104.gif" alt="墨镜">
/\:\:<=<img class="wechat-emoji" src="/img/emoji/wechat/105.gif" alt="哭">
/\:\:$=<img class="wechat-emoji" src="/img/emoji/wechat/106.gif" alt="羞">
/\:\:X=<img class="wechat-emoji" src="/img/emoji/wechat/107.gif" alt="哑">
/\:\:Z=<img class="wechat-emoji" src="/img/emoji/wechat/108.gif" alt="睡">
/\:\:'(=<img class="wechat-emoji" src="/img/emoji/wechat/109.gif" alt="哭">
View image php
<?php
// echo phpinfo();
// Set the content-type
// header('Content-Type: image/png');
header ("Content-type: image/png");
$x = 600;
$y = 1240;
// $x = 240;
@guoxiangke
guoxiangke / README.md
Created Dec 21, 2015 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
View README.md
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default and default-ssl to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@guoxiangke
guoxiangke / preg
Created Nov 9, 2015
匹配到最后一个括号里的内容 preg (
View preg
[\((][\s\S]*[\))]