Skip to content

Instantly share code, notes, and snippets.

Avatar
⛩️
On the way to refactoring

othree othree

⛩️
On the way to refactoring
View GitHub Profile
View git-commit-link.sh
View protect-master.pre-commit.hook.sh
#!/bin/bash
# Stops accidental commits to master and develop. https://gist.github.com/stefansundin/9059706
# Install:
# cd path/to/git/repo
# curl -fL -o https://gist.githubusercontent.com/othree/a5ad2dd81a5957a06867/raw/3abf8b2fbc9ce614af83e2522f23c163c78c97c6/Not%2520commit%2520to%2520master
# chmod +x .git/hooks/pre-commit
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [[ "$BRANCH" == "master" ]]; then
View track-all-branches.sh
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
@othree
othree / dwbp.md
Created Feb 20, 2017
Data on the Web Best Practices
View dwbp.md
  • Metadata
    • Provide metadata
    • Provide descriptive metadata
    • Provide structural metadata
  • Data Licenses
    • Provide data license information
  • Data Provenance
    • Provide data provenance information
  • Data Quality
    • Provide data quality information
View secret-es.mdown
View fetch multiple json2.js
const all = Promise.all.bind(Promise);
const fetchJSON = async file => (await fetch(file)).json();
const grabData = async files => await all(files.map(fetchJSON));
(async () => {
let [data1, data2] = await grabData(['/data1.json', '/data2.json']);
})();
View fetch multiple json.js
const all = Promise.all.bind(Promise);
const grabData = async files => await all(
(
await all(
files.map(f => fetch(f))
)
).map(v => v.json())
);
View change-cwd-when-insert.vim
:autocmd InsertEnter * let save_cwd = getcwd() | execute 'lcd %:p:h'
:autocmd InsertLeave * execute 'lcd' fnameescape(save_cwd)
View true-color-vim.sh
hg clone https://bitbucket.org/ZyX_I/vim
cd vim
hg update 24-bit-xterm
cd src && make autoconf && cd ..
./configure \
--enable-gui=no \
--without-x \
--enable-multibyte \
--with-tlib=ncurses \
You can’t perform that action at this time.