Skip to content

Instantly share code, notes, and snippets.

:octocat:
‏‏‎ Eating github stars for breakfast.

Andrzej Rehmann hoto

:octocat:
‏‏‎ Eating github stars for breakfast.
Block or report user

Report or block hoto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@angelo-v
angelo-v / jwt-decode.sh
Created Jul 4, 2017
Decode a JWT via command line
View jwt-decode.sh
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT
@rgl
rgl / wait_for_http_200.sh
Last active Feb 20, 2020
Wait for an HTTP endpoint to return 200 OK with Bash and curl
View wait_for_http_200.sh
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76
@lukechilds
lukechilds / get_latest_release.sh
Created Aug 9, 2016
Shell - Get latest release from GitHub
View get_latest_release.sh
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
View Oh my zsh with autosuggestions & syntax-highlighting.md

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@mpj
mpj / README.md
Last active Apr 28, 2016
REALLY quick and dirty static file dev server
View README.md

Usage

node dirtyserve.js

The point your browser to

http://localhost:3000/myfile.xxx

and the server will try to serve that file from the local server.

@saeidzebardast
saeidzebardast / Enable CORS in Spark Java
Created Mar 8, 2016
Enable CORS in Spark Java to allow origins *
View Enable CORS in Spark Java
options("/*",
(request, response) -> {
String accessControlRequestHeaders = request
.headers("Access-Control-Request-Headers");
if (accessControlRequestHeaders != null) {
response.header("Access-Control-Allow-Headers",
accessControlRequestHeaders);
}
@CMCDragonkai
CMCDragonkai / curl_custom_dns.sh
Last active Sep 16, 2019
cURL: Selecting a custom DNS server to resolve domain names
View curl_custom_dns.sh
#!/usr/bin/env bash
# this can be useful when developing against a custom DNS server, or
# for example, if you made a change to the DNS settings of a domain, and you
# know the authoritative nameserver IP address for a domain, you could use this
# to bypass the intermediate DNS cache, and apply an HTTP request using the new
# DNS settings supplied by your specified (authoritative) nameserver
curl --dns-servers <dns.ip,dns.ip> url.com
@jakubfiala
jakubfiala / custom_console.js
Created Feb 1, 2016
this small script intercepts the standard console methods and provides a way of accessing their messages, as well as stack traces, which is really cool. it formats the stack traces for popular browsers
View custom_console.js
//==========================================================
// CUSTOM JAVASCRIPT CONSOLE
// built by jakub fiala
//
// this small script intercepts the standard console methods
// and provides a way of accessing their messages,
// as well as stack traces, which is really cool.
// it formats the stack traces for popular browsers
//
// contributions welcome!
@elgalu
elgalu / dconf-custom-keybindings.sh
Created Jan 22, 2016
Sample custom key bindings through dconf-tools cli
View dconf-custom-keybindings.sh
# requirements
sudo apt-get install -qyy dconf-tools
# careful, if you already have custom hotkeys this commands will overwrite the first 7 ...
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name "'SouthWest(7)0,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Primary><Super>a'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command "'wmctrl -r :ACTIVE: -e 7,0,1080,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name "'SouthEast(9)1920,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding "'<Primary><Super>d'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command "'wmctrl -r :ACTIVE: -e 9,1920,1080,-1,-1'"
@ansgarschulte
ansgarschulte / Visual Studio Code eclipse Shortcuts Mac
Created Nov 30, 2015
Visual Studio Code eclipse Shortcuts Mac
View Visual Studio Code eclipse Shortcuts Mac
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "cmd+shift+r", "command": "workbench.action.quickOpen" },
{ "key": "cmd+shift+f", "command": "editor.action.format", "when": "editorTextFocus" },
{ "key": "alt+cmd+down", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" },
{ "key": "alt+cmd+up", "command": "editor.action.copyLinesUpAction", "when": "editorTextFocus" },
{ "key": "alt+down", "command": "editor.action.moveLinesDownAction", "when": "editorTextFocus" },
{ "key": "alt+up", "command": "editor.action.moveLinesUpAction", "when": "editorTextFocus" },
{ "key": "cmd+d", "command": "editor.action.deleteLines", "when": "editorTextFocus" },
{ "key": "alt+cmd+r", "command": "editor.action.rename", "when": "editorTextFocus" },
You can’t perform that action at this time.