Skip to content

Instantly share code, notes, and snippets.

View rm--'s full-sized avatar

René rm--

View GitHub Profile
@rm--
rm-- / curl_json.tool_example.rst
Created December 20, 2014 14:09
get json from url and save it to file with correct indentation

get json file and save them with human-readable indentation

general:

curl <url> | python -m json.tool > <filename>

example:

@rm--
rm-- / git_previous_branch.rst
Last active March 28, 2017 14:13
git checkout to previous branch

perhabs you know

cd -

to go to the directory where you come from.

git can do that too!

@rm--
rm-- / py-pdb.sublime-snippet
Created April 7, 2015 08:52
sublime snippet for python debugger pdb
<snippet>
<content><![CDATA[
import pdb; pdb.set_trace()]]>
</content>
<scope>source.python</scope>
<tabTrigger>pdb</tabTrigger>
</snippet>
@rm--
rm-- / hopper_api.json
Last active August 29, 2015 14:18 — forked from keimlink/hopper_api.json
each level needs a weight
{
"url": "http://example.com/api/23/",
"author": 1,
"date_created": "2015-03-26T11:01:23.262391Z",
"date_updated": "2015-03-26T11:01:23.262391Z",
"html": "<form></form>",
"javascript": "<script></script>",
"form": {
"id": 123,
"method": "POST",
{
"url": "http://example.com/api/23/",
"author": 1,
"date_created": "2015-03-26T11:01:23.262391Z",
"date_updated": "2015-03-26T11:01:23.262391Z",
"html": "<form></form>",
"javascript": "<script></script>",
"form": {
"id": 123,
"method": "POST",
@rm--
rm-- / salt state debug
Created June 24, 2015 16:33
salt state debug
# debug salt states:
`sudo salt-call state.sls <your-salt-state-to-debug> test=True`
@rm--
rm-- / git diff with stash
Created June 27, 2015 17:47
git diff with stash
git stash show -p stash@{0}
@rm--
rm-- / gist:5711fe816784048f27f6
Created August 27, 2015 07:27
git remote prune origin
# delete unused remote branches
git remote prune origin
@rm--
rm-- / git_mergetool.md
Last active October 7, 2015 21:51
manual mergetool selection

osx

git mergetool -t opendiff

ubuntu linux

git mergetool -t meld

@rm--
rm-- / most_used_zsh_cmds.md
Created October 7, 2015 22:06
summarize most used zsh cmds to find out alias candidates

cat ~/.zsh_history | awk -F\; '{ print $2 }' | sort | uniq -c | sort -n