Skip to content

Instantly share code, notes, and snippets.

View creeperyang's full-sized avatar
🎯
I may be slow to respond.

Creeper creeperyang

🎯
I may be slow to respond.
  • pdd
  • Shanghai,China
View GitHub Profile
# See <https://gist.github.com/isaacs/579814>
# 1
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
@creeperyang
creeperyang / cookies.js
Created January 22, 2015 04:31
Manipulate cookies via js
function CreateCookieMan() {
var cookieStore = getCookies();
var getAll = function() {
return cookieStore;
};
var getItem = function(name) {
return cookieStore[name];
@creeperyang
creeperyang / selector.md
Created June 13, 2015 08:35
你真的了解原生 dom 选择器吗?

live nodelist?

  1. 只有element/document.getElementsByClassName element/document.getElementsByTagName document.getElementsByName 获取返回的才是 live HTMLCollection of found elements.
  2. querySelectorAll 等获取的是 static nodelist.

所以像操作dom发生时,尤其当心你是否获取了想要的nodelist。

@creeperyang
creeperyang / shell-cmd.md
Last active June 2, 2017 16:29
shell usage and shortcuts

1. move cursor

  • esc+B: left word, esc and then b
  • esc+F: right word, esc and then f
  • Ctrl+A: jump to the beginning of the current command
  • Ctrl+E: jump to the end
@creeperyang
creeperyang / rem.js
Created November 28, 2016 10:42
rem helper
(function (doc, win) {
var docEl = doc.documentElement,
isIPhone = window.navigator.appVersion.match(/iphone/gi),
platform = navigator.platform,
justMobile = !/win32/i.test(platform),
fontSize, scale;
recalc();
function recalc() {
var clientWidth = docEl.clientWidth;
@creeperyang
creeperyang / Some words.md
Last active June 2, 2017 16:52
With silence and tears.

1

派大星:“嗨,海绵宝宝,我们去抓水母吧!”

海绵宝宝:“对不起,今天不行,我要上学。”

派大星:“如果你去上学的话,我今天该干点什么?”

海绵宝宝:“我不知道,一般我不在家的时候,你都干些什么啊?”

@creeperyang
creeperyang / style.css
Last active January 23, 2019 04:23
table布局
html,body { margin: 0;}
.container {
background: #f0f3f6;
display: table;
width: 100%;
/* 不加这个无法正确等宽切分 */
table-layout: fixed;
}