Skip to content

Instantly share code, notes, and snippets.

View ryanhanwu's full-sized avatar
🎯
Focusing

Ryan W ryanhanwu

🎯
Focusing
View GitHub Profile
@ryanhanwu
ryanhanwu / git-aliases.md
Created March 21, 2016 18:52 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@ryanhanwu
ryanhanwu / quote.css
Created December 23, 2015 00:20
quote text
blockquote {
background:#f9f9f9;
border-left:10px solid #ccc;
margin:1.5em 10px;
padding:.5em 10px;
quotes:"\201C""\201D""\2018""\2019";
}
blockquote:before {
color:#ccc;
content:open-quote;
@ryanhanwu
ryanhanwu / pre.css
Created December 23, 2015 00:19
line wrap in PRE
pre{
height: 120px;
overflow: auto;
font-family: “Consolas”,monospace;
font-size: 9pt;
text-align:left;
background-color: #FCF7EC;
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
@ryanhanwu
ryanhanwu / side_shadow.css
Created December 23, 2015 00:15
side shadow
.box-shadow {
background-color: #AC92EC;
width: 160px;
height: 90px;
margin-top: -45px;
margin-left: -80px;
position: absolute;
top: 50%;
left: 50%;
}
@ryanhanwu
ryanhanwu / vc.css
Created December 23, 2015 00:15
Vertical align
.vc{
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
}
@ryanhanwu
ryanhanwu / sso.md
Last active June 4, 2016 21:04
Hello!

SSO Knowledge Sharing

What is HTTP ?

  • Client: Browsers
  • Server: Web server
Note left of Client: Preparing Material
@ryanhanwu
ryanhanwu / console
Created October 20, 2015 15:12
Get all Template Instance of your Meteor application page -
getAllTempalteInstances()
@ryanhanwu
ryanhanwu / npm-upgrade-bleeding.sh
Last active August 29, 2015 01:15 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@ryanhanwu
ryanhanwu / linkify.js
Created August 19, 2015 15:34
Linkify
if(!String.linkify) {
String.prototype.linkify = function() {
// http://, https://, ftp://
var urlPattern = /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim;
// www. sans http:// or https://
var pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
// Email addresses
@ryanhanwu
ryanhanwu / agg.coffee
Last active August 29, 2015 14:26 — forked from lawrencejones/agg.coffee
Projection generator for mongodb
_ = require 'underscore'
# Given an array of elements ELEM and a matching KEY value,
# will build the apprpriate projection to generate sortable
# weights for a mongo aggregator.
#
# ELEM: An array of values upon which to match against KEY
# KEY: The document field key to match against
# I: Default 0, index into array at which to begin
#