Instantly share code, notes, and snippets.

View Path.swift
class Path {
static func basename(path: String) -> String {
return ((path as NSString).lastPathComponent as NSString).stringByDeletingPathExtension
}
static func dirname(path: String) -> String {
return (path as NSString).stringByDeletingLastPathComponent
}
View gist:b91a9361832d5cd05f22
ps -ef | grep -v grep | grep OOXX | awk '{print$2}' | xargs kill -9
View lightpromise.js
function get(uri) {
return http(uri,'GET');
}
function post(uri,data) {
if(typeof data === 'object' && !(data instanceof String || (FormData && data instanceof FormData))) {
var params = [];
for(var p in data) {
if(data[p] instanceof Array) {
for(var i = 0; i < data[p].length; i++) {
params.push( encodeURIComponenet(p) + '[]=' + encodeURIComponenet(data[p][i]);
View urlparser.js
var parser = function(url) {
var a = document.createElement('a');
a.href = url;
var search = function(search) {
if(!search) return {};
var ret = {};
search = search.slice(1).split('&');
for(var i = 0; i < search.length; i++) {
View gist:cd254cd35eb5f5bbedf8
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |-- '.
/ \\||| : |||-- \
/ _||||| -:- |||||- \
| | \\\ - --/ | |
View -_-||.zsh-theme
# Symbols:
# ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷
# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠
# ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟ ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ     
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}git:(%{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})"
View SassMeister-input.scss
@import 'base.sass/+';
$z-layers: (
'goku': 9001,
'shoryuken': 8000,
'modal': (
'base': 500,
'close': 100,
'header': 50,
'footer': 10
View utils.scss
@import 'base.sass/+';
// Specify supports
$browser-supports: parse-rules('last 5 versions');
.fn-clear {
@include clearfix;
}
.fn-left {
View link-status.scss
View uninstall-nodejs.sh
#!/bin/bash
cd /usr/local/lib
sudo rm -rf node node_modules
cd /usr/local/bin/
sudo rm -f node npm
cd $HOME
sudo rm -rf .npm