Skip to content

Instantly share code, notes, and snippets.

my sublime snippets for js
@mcfog
mcfog / init.d_new-node-app.sh
Last active August 29, 2015 14:00
a init.d script for forever node app
gist name
@mcfog
mcfog / .jshintrc
Created April 27, 2014 02:43
my jshint config for nodejs
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": "nofunc",
"noarg": true,
"undef": true,
"boss": true,
"devel": true,
"node": true
<- define <[jquery]>
let @ = Deferred = {}
@when = $~when
@defer = ->
dfr = $.Deferred!
{
@mcfog
mcfog / grid.styl
Created June 13, 2013 21:49
a semantic grid mixin for Stylus, better with PR <https://github.com/LearnBoost/stylus/pull/1048>
grid-ctn(containerwidth, col, padwidth = grid-devide(containerwidth, col * 8))
$grid_width grid-devide(containerwidth, col)
$grid_col col
$grid_padding grid-devide(padwidth, 2)
width containerwidth
position relative
clearfix()
grid-block(colspan)
@mcfog
mcfog / README.md
Created June 12, 2013 13:25
`hexo new` 后自动打开新建的文件

用法:将open.js放入scripts目录下,然后在你的hexo目录中打开cmd,执行

npm i open

即可

@mcfog
mcfog / preview.co
Last active December 17, 2015 18:39
hexo-preview
(args) <- hexo.extend.console.register 'preview' 'watch change and run server'
hexo.extend.console.list!generate {w:true}
hexo.extend.console.list!server args

*** How to use

  1. replace the tortoiseGit install path in tortoiseGit_win7_menu.reg with yours and import it into registry
  2. open regedit, edit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected & HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksItemsSelected
    use names like "mcfog.git.commit", semicon-seperated, example:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksItemsSelected]
@="mcfog.git.menu.svn;mcfog.git.log;mcfog.git.diff;mcfog.git.sync;mcfog.git.menu.branch"
@mcfog
mcfog / qq.co
Created January 18, 2012 07:37
everyauth module for qq
everyauth = require 'everyauth'
oauthModule = require 'everyauth/lib/modules/oauth2'
url = require 'url'
rest = require 'everyauth/lib/restler'
qq = module.exports = oauthModule.submodule('qq')
.configurable do
scope: 'URL identifying the Tencent QQ service to be accessed. See the documentation for the API you\'d like to use for what scope to specify. To specify more than one scope, list each one separated with a space.'
.oauthHost 'https://graph.qq.com'