Skip to content

Instantly share code, notes, and snippets.

View zuoRambo's full-sized avatar
🎯
Focusing

Rambone zuoRambo

🎯
Focusing
View GitHub Profile
@zuoRambo
zuoRambo / github-skill-0001.md
Last active May 4, 2016 05:33
github skills
@zuoRambo
zuoRambo / js-snippet-0001.md
Created May 4, 2016 05:39
javascript snippets
// 生成随机颜色代码
(~~(Math.random()*(1<<24))).toString(16) 

// 给所有元素添加随机色的外边框线
[].forEach.call($$("*"),function(a){
  a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16) 
}); 
@zuoRambo
zuoRambo / php-skills-0001.md
Last active June 29, 2016 04:30
php skills

一些经常会用到但是记不住的函数

// Create array containing variables and their values from current symbol table
compact();
// compact的对应函数
extract();
// 获取定义的变量,包括预定义的全局变量
get_defined_vars();
list($a,,$b,,$c) = ['a','b','c','d','e'];
@zuoRambo
zuoRambo / mysql-skill-001.md
Last active May 17, 2016 03:39
some mysql snippet
-- 快速复制一个表,添加limit 0可以只保留结构
CREATE TABLE copy_table AS SELECT * FROM original_table

-- 将sql语句的查询结果保存到文件中
pager cat > /tmp/sql_result_file 
-- 设置上述命令之后执行的sql结果将不在屏幕缓冲区显示,直接写入文件

-- explain 查询计划
-- type指标的排序
# git stash 讲当前修改隐藏起来

# 查看隐藏
git stash list
git stash pop
git stash pop --index stash@{0}
git stash drop --index stash@{0}
# 清除隐藏
git stash clear
@zuoRambo
zuoRambo / linux-skills-0001.md
Last active June 12, 2016 13:09
Linux skills
vim /etc/inittab

SU:2345:respawn:/usr/bin/supervisord -c /etc/supervisord.conf

#使其生效
init q 
@zuoRambo
zuoRambo / go-knowledge-map
Last active March 6, 2018 03:11
Go Knowledge Graph
{
"tags": [
{
"text": "GoCN出品",
"color": "rgb(255, 255, 255)",
"background": "rgb(99, 171, 247)"
}
],
"id": "root",
"title": "Go知识图谱",