Skip to content

Instantly share code, notes, and snippets.

@jenux
jenux / install_homebrew_on_lion.md
Last active October 8, 2015 04:48
Install Homebrew on Mountain Lion

Install Xcode

Download Xcode from App Store

Install Command Line Tools

Xcode -> Preferences -> Downloads -> Components

Let Everyone Know Where XCode Is

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Install X11 [I don't know if this step is necessary ]

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@jenux
jenux / setup_sublime.md
Last active January 3, 2016 07:49
Setup Sublime Text Editor

How to install package control for Sublime Text 3, and recommend plugins.

OS: Mac

@jenux
jenux / Twitte_avoid_iframed.js
Last active August 29, 2015 13:56
Twitter处理防止被iframe的方式
function bust () {
document.write = "";
window.top.location = window.self.location;
setTimeout(function() {
document.body.innerHTML = '';
}, 0);
window.self.onload = function(evt) {
document.body.innerHTML = '';
};
}
@jenux
jenux / chrome_extensions.md
Last active August 29, 2015 14:01
Chrome 扩展推荐

Recommended Chrome extensions

This is a list for those recommended extensions in google chrome browser.

-- Jenux

@jenux
jenux / index.html
Created June 23, 2014 05:20 — forked from tzi/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>PrintPreview - A bookmarklet to preview the print version of a web page</title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" href="style.css" >
</head>
<body>
<h1>PrintPreview</h1>
@jenux
jenux / SetGemSources.sh
Last active August 29, 2015 14:02
Set gem sources to "taobao" or reset to "rubygems.org"
#!/bin/bash
param=$1
oldsource=`gem sources | tail -n 1`
if [ "$param"x = "setx" ]; then
newsource="https://ruby.taobao.org/"
else
newsource="https://rubygems.org/"
fi
@jenux
jenux / markdown-toc
Created July 11, 2014 06:29
Sample codes of generate TOC for markdown with js
<!--
copy from https://www.dropbox.com/s/bus9jw8yqm03z3b/markdown-toc-v2.txt
http://jianshu.io/p/34c92cbd0aaf
-->
<ul id="tree" class="ztree"></ul>
<article class='markdown-body'>
# titleI
## titleII
### titleIII
@jenux
jenux / addMethod-John-Resig.js
Created July 26, 2017 03:15
addMethod - By John Resig
// addMethod - By John Resig (MIT Licensed)
// https://johnresig.com/blog/javascript-method-overloading/
// https://blog.fundebug.com/2017/07/24/javascript_metho_overloading/?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io
function addMethod(object, name, fn){
var old = object[ name ];
object[ name ] = function(){
if ( fn.length == arguments.length )
return fn.apply( this, arguments );
else if ( typeof old == 'function' )
return old.apply( this, arguments );
@jenux
jenux / git-command.md
Last active November 29, 2018 02:20
git command

checkout remote branch

$ git checkout -b test origin/test

remove remote branch

$ git push origin --delete <branch_name>

remove local branch

$ git branch -D