/*
* classList.js: Cross-browser full element.classList implementation.
* 2014-07-23
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
我的 Mac 必装软件 | |
1. xcode | |
安装好 commend line tools 方便开发使用命令行 | |
2. iTerm2 + zsh | |
mac 上最好用的终端,全屏透明什么的用起来很不错 | |
3. Alfred | |
启动器,和spotlight一样,不过更强大,alt+space让你启动任何东西 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.select2-container .select2-choice { | |
height: 34px; | |
-webkit-box-shadow: none; | |
-moz-box-shadow: none; | |
box-shadow: none; | |
background-color: #fff; | |
background-image: none; | |
background: #fff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove copy button if copy to clipboard method is not allowed | |
// Note: Button detection is broken before Chrome 48 | |
var copyBtn = document.querySelector('.copyToClip'); | |
if (copyBtn !== null) { | |
if( !document.queryCommandSupported('copy') ) { | |
copyBtn.parentNode.removeChild(copyBtn); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```javascript | |
(function{ | |
if(window.DeviceMotionEvent) { | |
alert('you'); | |
window.addEventListener('devicemotion', deviceMotionHandler, false); | |
}else{ | |
alert('no'); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export FOO=100 | |
python - <<END | |
import os | |
print "foo:", os.environ['FOO'] | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:bind-key -n C-k send-keys "clear && tmux clear-history; history -d $((\$HISTCMD-1))" \; send-keys "Enter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/facebook/react/issues/3725 | |
... | |
static get defaultProps() { | |
return { | |
count:1 | |
} | |
} | |
.... |
Here's how I converted a whole batch of Stylus files to SASS without using a converter (none exist, that I'm aware of), converting each Stylus file manually, or programming my own Stylus->SASS converter, which would have entailed building a parser, and then generate SCSS from the AST.
First, grab sandr.py
here: https://github.com/jfgiraud/sandr
Then, in the directory of your Stylus files, run (if you have multiple directory levels, you can do similar task using find
):
for file in *.styl; do echo "/*! FILENAME: $file */" >tempfile; cat $file >>tempfile; mv tempfile $file; done
OlderNewer