Skip to content

Instantly share code, notes, and snippets.

View mygoare's full-sized avatar
:octocat:

Gore mygoare

:octocat:
View GitHub Profile
@mygoare
mygoare / new_file0
Last active October 9, 2015 03:53
codepen collections
css3 animation:
http://codepen.io/anon/pen/rOMaJp?editors=110
http://codepen.io/anon/pen/meEKLm?editors=110
http://codepen.io/anon/pen/vNXNaj?editors=110
Flex three columns layout:
http://codepen.io/anon/pen/NGgNZG?editors=110
@mygoare
mygoare / mp3player.js
Created October 30, 2015 03:31 — forked from TooTallNate/mp3player.js
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
@mygoare
mygoare / css实践.rtf
Last active November 25, 2015 07:06
css实践
分离 用于展示效果的 css className 和 javascript 用来绑定或附加效果的 css className
css 命名:
prefixName-block-element--modifier
e.g.
qm-header-title
qm-header-title--highLight
qm-header-navList
@mygoare
mygoare / 范式
Last active November 20, 2015 09:28
Database 设计
通过entity relation diagram 设计数据库
1. 表中属性唯一,不重复
2. 属性完全只依赖于主键
3. 表中不含非关键字信息
索引是用来定位的
http://stackoverflow.com/questions/26882177/react-js-inline-style-best-practices
@mygoare
mygoare / README.md
Created January 12, 2016 02:48 — forked from joyrexus/README.md
form-data vs -urlencoded

Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data.

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


Matt Bridges' answer in full:

The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing

@mygoare
mygoare / install_docker.sh
Created July 21, 2016 16:58
install docker on ubuntu trusty 14.04
# This script is used for ubuntu Trusty 14.04
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-get install vim -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo touch /etc/apt/sources.list.d/docker.list
sudo echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' > /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
However, if you have a normal parent div with a background, the lower element will be hidden. In this case, give the parent relative positioning and a z-index of 1. See: jsbin.com/juputice/3/edit
@mygoare
mygoare / co.js
Created August 24, 2016 17:39
understand co (a simple co)
function co(GenFunc) {
return function(cb) {
var gen = GenFunc()
next()
function next(err, args) {
if (err) {
cb(err)
} else {
if (gen.next) {
var ret = gen.next(args)