Skip to content

Instantly share code, notes, and snippets.

wangshijun wangshijun

Block or report user

Report or block wangshijun

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
View phantomjs_intaller.sh
#!/bin/bash
sudo apt-get remove phantomjs
sudo unlink /usr/local/bin/phantomjs
sudo unlink /usr/local/share/phantomjs
sudo unlink /usr/bin/phantomjs
cd /usr/local/share
View RadarChart.js
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3
//I only made some additions and aesthetic adjustments to make the chart look better
//(of course, that is only my point of view)
//Such as a better placement of the titles at each line end,
//adding numbers that reflect what each circular level stands for
//Not placing the last level and slight differences in color
//
//For a bit of extra information check the blog about it:
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html
View angularjs-fuzzy-filter.js
'use strict';
/*
IMPORTANT: requires Underscore.js (http://underscorejs.org)
Usage: ng-repeat="item in items | fuzzyFilter: searchText"
*/
var app = angular.module('app', []);
View gulpfile-express.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
View gist:221bdea1970e7fd3967e
// Requires jQuery from http://jquery.com/
// and jQuerySparklines from http://omnipotent.net/jquery.sparkline
// AngularJS directives for jquery sparkline
angular.module('sparkline', []);
angular.module('sparkline')
.directive('jqSparkline', [function () {
'use strict';
return {
@wangshijun
wangshijun / CSS
Created Aug 27, 2012
Border-Radius
View CSS
-webkit-border-radius: 3px 3px 0 0;
-khtml-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
-ms-border-radius: 3px 3px 0 0;
-o-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
@wangshijun
wangshijun / hideaddrbar.js
Created Aug 27, 2012 — forked from scottjehl/hideaddrbar.js
Normalized hide address bar for iOS & Android
View hideaddrbar.js
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
@wangshijun
wangshijun / index.php
Created Aug 27, 2012
php: environment dependent config autoloading Yii startup
View index.php
<?php
define("APP_DIR", dirname(dirname(__FILE__)));
define("WWW_DIR", dirname(APP_DIR));
define("CONF_DIR", APP_DIR . "/protected/config/");
$clusters = require_once(CONF_DIR . "clusters.php");
$mainConfig = require_once(CONF_DIR . "main.php");
// 根据应用程序所在环境加载配置, 默认为develop
if (isset($clusters["product"]) && in_array(strtolower(php_uname("n")), $clusters["product"])) {
@wangshijun
wangshijun / gist:3521924
Created Aug 30, 2012
Sublime Text 2 - Useful Shortcuts
View gist:3521924

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@wangshijun
wangshijun / night_mode.js
Created Aug 30, 2012
javacript: web page night mode
View night_mode.js
var nightCss = 'html,body,div,span,applet,object,'
+ 'h1,h2,h3,h4,h5,h6,p,blockquote,'
+ 'pre,abbr,acronym,address,big,cite,'
+ 'code,del,dfn,em,font,img,ins,kbd,'
+ 'q,s,samp,small,strike,strong,sub,'
+ 'sup,tt,var,b,u,i,center,dl,dt,dd,'
+ 'ol,ul,li,fieldset,form,label,'
+ 'legend,table,caption,tbody,tfoot,thead,th,td'
+ '{background:#333333 !important;'
+ 'color:#A0A0A0 !important;'
You can’t perform that action at this time.