Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, F19)</appendix>
<identifier>private.f192f19</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@yuanshanxiaoni
yuanshanxiaoni / dabblet.css
Created September 18, 2013 07:35
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #18a;
background: linear-gradient(45deg, #18a, #18c);
min-height: 100%;
max-height: 200%;
@yuanshanxiaoni
yuanshanxiaoni / dabblet.css
Created September 18, 2013 07:37
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
width:320px;
height:480px;
background:#189;
@yuanshanxiaoni
yuanshanxiaoni / shadows
Created September 18, 2013 07:50
view or image shadows.
/* Shared styles */
.drop-shadow {
position:relative;
float:left;
width:40%;
padding:1em;
margin:2em 10px 4em;
background:#fff;
-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
//express3.0
var express = require('express');
var app = express();
app.set('port', 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
//session & cookie
/*
* print
*/
static void pr_do(FILE *stream,
const char *label,
const char *fmt,
va_list ap);
@yuanshanxiaoni
yuanshanxiaoni / gist:7686061
Last active December 29, 2015 14:48
git 操作命令收集
) 远程仓库相关命令
检出仓库:$ git clone git://github.com/jquery/jquery.git
查看远程仓库:$ git remote -v
添加远程仓库:$ git remote add [name] [url]
删除远程仓库:$ git remote rm [name]
修改远程仓库:$ git remote set-url --push [name] [newUrl]
拉取远程仓库:$ git pull [remoteName] [localBranchName]
推送远程仓库:$ git push [remoteName] [localBranchName]
* 如果想把本地的某个分支test提交到远程仓库,并作为远程仓库的master分支,或者作为另外一个名叫test的分支,如下:
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2013 Peter Steinberger. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
@yuanshanxiaoni
yuanshanxiaoni / ngInclude-demo
Created April 13, 2014 04:49
ngInclude-sample
Dynamic includes with Angular.js
In a previous post I show how to use includes to partition views.
In that example, I was using static includes that provide limited flexibility.
What if you want to display different information on the same area of the template based on some condition?
You could use a conditional statement inside the include and render different code accordingly, but doing that will most likely result in bloated and difficult to maintain views.