Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
.

Vlad von Hraban vonhraban

🌴
.
  • Selladore Limited
  • London, UK
View GitHub Profile
View mgoTestExample.go
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Content struct {
View fuckdock2
if [[ $(docker ps -q) ]] ; then docker kill $(docker ps -q) ; else true ; fi && if [[ $(docker ps -aq) ]] ; then docker rm $(docker ps -aq) ; else true ; fi ; sudo service docker restart
@vonhraban
vonhraban / .tmux.conf
Created Oct 30, 2018 — forked from tsl0922/.tmux.conf
vim style tmux config
View .tmux.conf
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
View Gitconfig
[alias]
a = add
s = status
b = branch
can = commit --amend --no-edit
pf = push --force
rewrite = "!git add . && git can && git push -f"
la = "!git config -l | grep alias | cut -c 7-"
find = "!git ls-files | grep -i"
View gist:afe2d593bfc66f22e92f80c0e794b9b0
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
View LEMP docker setup
nginx:
image: tutum/nginx
ports:
- "80:80"
links:
- phpfpm
volumes:
- ./nginx/default:/etc/nginx/sites-available/default
- ./nginx/default:/etc/nginx/sites-enabled/default
View Fuckdock
alias fuckdock="docker stop -f $(docker ps -aq); docker rm -f $(docker ps -aq); docker rmi -f $(docker images -aq); docker system prune -a -f --volumes"
View Git aliases
[alias]
a = add
s = status
b = branch
can = commit --amend --no-edit
pf = push --force
rewrite = "!git add . && git can && git push -f"
la = "!git config -l | grep alias | cut -c 7-"
View Fuckdock
alias fuckdock="docker rm --force $(docker ps -a -q) && docker rmi --force $(docker images -q)"
View docker-compose.yml
version: "2"
services:
nginx:
image: nginx:latest
container_name: tracking-nginx
ports:
- "80:80"
volumes:
- .:/app