Skip to content

Instantly share code, notes, and snippets.


Justin Chen interjc

Block or report user

Report or block interjc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
interjc / localstorage-fault.html
Created Jul 24, 2012 — forked from sofish/localstorage-fault.html
localstorage 不能直接包
View localstorage-fault.html
<!DOCTYPE html>
<meta charset="utf-8" />
<title>LocalStorage fault</title>
<link rel="stylesheet" href="" />
<body class="typo" style="width:800px;margin:30px auto;">
<h3># error message</h3>
View gist:5476330
//sample ajax function
add_action('wp_ajax_sample_ajax_function', 'sample_ajax_function'); //添加当用户处于登录状态下添加响应的 Hook
add_action('wp_ajax_nopriv_sample_ajax_function', 'sample_ajax_function'); //添加当用户处于未登录状态下添加响应的 Hook
//响应 AJAX 请求的主程序来了
function sample_ajax_function(){
$data = $_POST['data']; //接受并保存 request,这里的 data 可以是其他的东西,取决于你发过来的参数名,这个后面会说
//简单预设将要返回的数据,假定接收到了 data 这个参数就返回 {'status':'success'},否则返回 {'status':'fail'}
$arr = array('status'=>'success');
if(!$data) $arr['status'] = 'fail';
View gist:6656395
#UPDATE:2013-07-07 21:01 localhost
#SmartHosts START
#Google Services START
View gist:ebb5ae1c243020879819
"cmd": ["javac \"$file_name\" && java \"$file_base_name\""],
"shell": true,
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": ""
interjc / gulpfile.js
Created Oct 16, 2015 — forked from alyssaq/gulpfile.js
browserify, babel, gulp, glob, vinyl-source-stream, uglify
View gulpfile.js
npm install gulp gulp-load-plugins gulp-uglify
npm install browserify babelify glob vinyl-source-stream vinyl-buffer
More examples:
var gulp = require('gulp')
var $ = require('gulp-load-plugins')()
var browserify = require('browserify')
interjc / 0_reuse_code.js
Created Jan 20, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
interjc /
Last active May 5, 2016
Node.js 基础入门

2、nodejs的模块怎么用,如何载入别的模块(require),如何给另一模块调用(module, module.exports),自己编写的模块与

   npm install 
   npm init 
   npm install xxx
interjc / ajax.js
Created Jul 18, 2016
vue-resource 二次封装
View ajax.js
import Vue from 'vue';
import VueResource from 'vue-resource';
import utils from './utils';
import local from './local';
import toast from './toast';
// Usage
You can’t perform that action at this time.