Skip to content

Instantly share code, notes, and snippets.

@minwe
minwe / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@minwe
minwe / detectFlash.js
Created September 30, 2014 05:54
detect flash support
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if (fo) {
hasFlash = true;
}
} catch (e) {
if (navigator.mimeTypes
&& navigator.mimeTypes['application/x-shockwave-flash'] != undefined
&& navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
@minwe
minwe / duoshuo.css
Last active August 29, 2015 14:07
多说评论样式调整
/**
* Duoshuo Comments Style for Amaze UI
* by Minwe
*/
#ds-thread #ds-reset .ds-meta {
border-bottom-color: #eee;
}
/* Like button */
# sets the proxy cache path location, max size 2g
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=2g;
# transfers the `Host` header to the backend
proxy_set_header Host $host;
# uses the defined STATIC cache zone
proxy_cache STATIC;
# cache 200 10 minutes, 404 1 minute, others status codes not cached
@minwe
minwe / gulpfile.js
Created August 23, 2014 05:57
gulpfile.js
var gulp = require('gulp'),
runSequence = require('run-sequence'),
watch = require('gulp-watch'),
concat = require('gulp-concat'),
imagemin = require('gulp-imagemin'),
less = require('gulp-less'),
prefixer = require('gulp-autoprefixer'),
clean = require('gulp-clean'),
template = require('gulp-template');
var blob = require('azure').createBlobService()
, fs = require('fs')
, Q = require('q')
var options = { publicAccessLevel: 'blob' }
// With Q
var fsLstat = Q.nbind(fs.lstat, fs);
var getContainer = Q.nbind(blob.createContainerIfNotExists, blob);
var streamFile = Q.nbind(blob.createBlockBlobFromStream, blob);
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.minwe.mongod</string>
<key>Program</key>
<string>/usr/local/mongodb/bin/mongod</string>
<key>ProgramArguments</key>
<array>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.lextang.shadowsocks</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/node</string>
<string>/Users/Lex/Dropbox/shadowsocks-nodejs/local.js</string>
/**
* impress.js
*
* impress.js is a presentation tool based on the power of CSS3 transforms and transitions
* in modern browsers and inspired by the idea behind prezi.com.
*
*
* Copyright 2011-2012 Bartek Szopka (@bartaz)
*
* Released under the MIT and GPL Licenses.