Skip to content

Instantly share code, notes, and snippets.

View liuliangsir's full-sized avatar
💻
Coding

流浪大法师 liuliangsir

💻
Coding
View GitHub Profile
@keelii
keelii / mac app
Last active August 31, 2016 03:37
我的 Mac 必装软件
1. xcode
安装好 commend line tools 方便开发使用命令行
2. iTerm2 + zsh
mac 上最好用的终端,全屏透明什么的用起来很不错
3. Alfred
启动器,和spotlight一样,不过更强大,alt+space让你启动任何东西
@andrewbranch
andrewbranch / select2-override.css
Last active October 16, 2017 14:04
Flat styling of select2.
.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;
}
@christierney402
christierney402 / copyToClipboard.js
Last active November 29, 2017 13:44
HTML5 Copy to Clipboard
// 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);
};
@xgqfrms-GitHub
xgqfrms-GitHub / classList.js.md
Created February 12, 2017 21:45
classList.js: Cross-browser full element.classList implementation.
/* 
 * 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.
 */
@FrankFan
FrankFan / h5-shake.js
Last active May 17, 2018 02:28
HTML5 shake 晃动demo
```javascript
(function{
if(window.DeviceMotionEvent) {
alert('you');
window.addEventListener('devicemotion', deviceMotionHandler, false);
}else{
alert('no');
}
@Yexiaoxing
Yexiaoxing / README.md
Last active June 26, 2018 03:49
Plugin for Jekyll to insert videos from Youku or Tudou.

这是一个用于Jekyll的youku、tudou嵌入插件。

This is a plugin meant for Jekyll.

用例:

Example use:

将youku.rb和/或tudou.rb文件拷贝至_plugins目录下,然后在文章中输入以下代码即可嵌入。

@jiaaro
jiaaro / script.bash
Created April 24, 2013 14:45
Embed Python in a bash script
#!/bin/bash
export FOO=100
python - <<END
import os
print "foo:", os.environ['FOO']
END
@marcelbeumer
marcelbeumer / gist:5652379
Created May 26, 2013 10:34
Clear tmux pane with ctrl-k (like cmd-k clears a terminal) without polluting the bash history.
:bind-key -n C-k send-keys "clear && tmux clear-history; history -d $((\$HISTCMD-1))" \; send-keys "Enter"
@mburakerman
mburakerman / defaultProps.jsx
Last active August 1, 2018 02:30
defaultProps ES6 Syntax in React.js
// https://github.com/facebook/react/issues/3725
...
static get defaultProps() {
return {
count:1
}
}
....
@esbullington
esbullington / intro.md
Last active September 30, 2018 11:59
Convert Stylus to SASS/SCSS

Convert Stylus to SASS

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