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
# npm publish with goodies | |
# prerequisites: | |
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json` | |
# `np` with optional argument `patch`/`minor`/`major`/`<version>` | |
# defaults to conventional-recommended-bump | |
# and optional argument preset `angular`/ `jquery` ... | |
# defaults to conventional-commits-detector | |
np() { | |
travis status --no-interactive && | |
trash node_modules &>/dev/null; |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
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
# copied from https://github.com/bendrucker/make-module/blob/master/module.sh | |
module () { | |
cd ~/Code | |
mkdir $1 | |
cd $1 | |
git init | |
hub create | |
travis enable --no-interactive & | |
yo bd | |
} |
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
var fs = require('fs'); | |
var html; | |
fs.readFile('./index.html', function (err, data) { | |
html = data; | |
}); | |
require('http').createServer(function (request, response) { | |
response.end(html); |
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 | |
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
if [ -z "$REPO_URL" ]; then | |
echo "-- ERROR: Could not identify Repo url." | |
echo " It is possible this repo is already using SSH instead of HTTPS." | |
exit | |
fi |
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
console = console || {}; // just in case | |
console.watch = function(oObj, sProp) { | |
sPrivateProp = "$_"+sProp+"_$"; // to minimize the name clash risk | |
oObj[sPrivateProp] = oObj[sProp]; | |
// overwrite with accessor | |
Object.defineProperty(oObj, sProp, { | |
get: function () { | |
return oObj[sPrivateProp]; | |
}, |
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
alias ng="npm list -g --depth=0 2>/dev/null" | |
alias nl="npm list --depth=0 2>/dev/null" |
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/you-dont-need/You-Dont-Need-GUI | |
# dependency: https://github.com/axiros/terminal_markdown_viewer | |
# pip install mdv | |
# replace `'copy a file'` with whatever you are searching for | |
curl https://raw.githubusercontent.com/you-dont-need/You-Dont-Need-GUI/master/readme.md | mdv - | grep 'copy a file' -A 10 |
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
<html> | |
<head> | |
<title>collisionForce</title> | |
<script type="text/javascript" src = "https://d3js.org/d3.v4.min.js"></script> | |
<style type = "text/css"> | |
.active { | |
stroke: #000; | |
stroke-width: 2px; | |
} |
OlderNewer