Skip to content

Instantly share code, notes, and snippets.

View olegch's full-sized avatar

Oleg Chunikhin olegch

View GitHub Profile
@olegch
olegch / 0_reuse_code.js
Created April 6, 2016 15:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@olegch
olegch / vim show whitespaces
Last active December 13, 2015 22:08
vim show whitespaces
:set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
:set list
@olegch
olegch / Git repo refactoring.sh
Last active December 13, 2015 20:58
Commands/sequence useful for git repository refactoring
#!/bin/bash
# Delete everything except some files:
find . -not \( -path "./.git" -o -path "./.git/*" -o -path "./pom.xml" \) -delete
# checkout all branches you want to have:
for i in develop br1 br2 br3; do git branch -t $i origin/$i; done
# automatically find all remote branches:
for i in `git show-ref | awk '/ refs\/remotes\/origin\// { sub(/refs\/remotes\/origin\//,""); print $2 }' | grep -v '^HEAD$'`; do git branch -t $i origin/$i; done
@olegch
olegch / subscript.groovy
Last active August 29, 2015 13:56
running a groovy subscript from a groovy script
// parse script by file name dynamically
new GroovyShell(binding).parse(new File("${context.serviceDirectory}/test_script.groovy")).run()
// run script statically linking
new test_script(binding).run()