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
# 用 root 身份做如下操作 (高危! 请切记自己在干什么) | |
sudo -s | |
cd /sbin | |
# 将系统自带的挂载程序改名 | |
mv mount_ntfs mount_ntfs_orig | |
# 新建我们要的挂载脚本并编辑 | |
vim mount_ntfs | |
#!/bin/sh | |
/sbin/mount_ntfs_orig -o rw,nobrowse "$@" |
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
http://unix.stackexchange.com/questions/61907/how-do-i-create-a-directory-in-all-subdirectories | |
for dir in */; do mkdir -- "$dir/tmp1"; done |
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
http://unix.stackexchange.com/questions/102647/how-to-rename-multiple-files-in-single-command-or-script-in-unix | |
for file in aro_tty-mIF-*_opt | |
do | |
mv -i "${file}" "${file/-mIF-/-mImpFRA-}" | |
done |
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
http://www.danschnau.com/multiple-versions-of-a-package-in-bower/ | |
"dependencies": { | |
"jquery-1.9.1": "jquery#1.9.1", | |
"jquery-1.8.1": "jquery#1.8.1" | |
} |
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
git branch | grep '3\.2' | xargs git branch -d |
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
GOAL: | |
Make flow understand *.css files and map them to an exported Object or whatever type you need... also to prevent this dreaded module not found error. | |
STEPS: | |
In your project folder, create a file helpers/CSSModule.js with following content: | |
//@flow | |
export default {}; |
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
let touches = { | |
touchstart: Object.assign({}, { | |
x: -1, | |
y: -1 | |
}), | |
touchmove: Object.assign({}, { | |
x: -1, | |
y: -1 | |
}) | |
} |
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
const {Builder, By, Key, until, remote} = require('selenium-webdriver'); | |
const sauceUsername = process.env.SAUCELABS_USER, | |
sauceApiToken = process.env.SAUCELABS_APITOKEN; | |
(async function example() { | |
let driver = await new Builder() | |
.forBrowser('firefox') | |
.build(); |
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
/** | |
* Compare color difference in RGB | |
* @param {Array} rgb1 First RGB color in array | |
* @param {Array} rgb2 Second RGB color in array | |
*/ | |
export function deltaRgb (rgb1, rgb2) { | |
const [ r1, g1, b1 ] = rgb1, | |
[ r2, g2, b2 ] = rgb2, | |
drp2 = Math.pow(r1 - r2, 2), | |
dgp2 = Math.pow(g1 - g2, 2), |
OlderNewer