Skip to content

Instantly share code, notes, and snippets.

View suneg's full-sized avatar

Sune Gynthersen suneg

  • Copenhagen, Denmark
View GitHub Profile
@suneg
suneg / .vimrc
Created February 7, 2021 10:25
Vim configuration
syntax on
"set background=dark
let g:solarized_termcolors=256
let g:solarized_contrast="high"
colorscheme solarized8
set termguicolors
set ruler " show the line number on the bar
set more " use more prompt
set autoread " watch for file changes
@suneg
suneg / gist:ffdb359e145b5fe8ecd84ae935fe34cb
Created November 30, 2020 10:17
Get MD5 fingerprint of ssh key
ssh-keygen -l -E md5 -f ~/.ssh/id_rsa
@suneg
suneg / .gitconfig
Created September 16, 2020 13:35
git config
[push]
default = simple
[alias]
co = checkout
st = status
br = branch
c = commit
hist = log --oneline --graph --decorate --all
unstage = reset HEAD --
[pull]
@suneg
suneg / bumpme
Last active August 8, 2020 10:21
Bumpme
Sat Aug 8 10:20:59 UTC 2020
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
execute pathogen#infect()
syntax on
set background=dark
let g:solarized_termcolors=256
let g:solarized_contrast="high"
colorscheme solarized
call togglebg#map("<F5>")
set ruler " show the line number on the bar
set more " use more prompt
@suneg
suneg / readonly_user.sql
Created March 8, 2019 11:33
Create readonly user on postgres
-- List roles
SELECT rolname FROM pg_roles;
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
@suneg
suneg / index.js
Created February 20, 2019 12:11
Clear React component state
// How to clear the state of the current component
// (set all state properties to undefined)
let clearerObject = Object.keys(this.state).reduce((prev, k) => {
prev[k] = undefined;
return prev
}, {});
this.setState({
...clearerObject
@suneg
suneg / garbagecollect.sh
Created January 25, 2018 14:21
Docker image garbage collection
docker rmi $(docker images | grep \<none | awk '{print $3}')
@suneg
suneg / README.md
Last active January 22, 2018 21:34
Simple docker network bridge

Setting up a simple docker bridge

docker network create -d bridge mybridge
docker run --rm --network=mybridge -p=6379:6379 --name=redis redis:3-alpine
docker run --rm --network=mybridge -it -p=443:443 --name=version-frontend version-frontend

Inside frontend container...