Skip to content

Instantly share code, notes, and snippets.

@simplay
simplay / docker-cleanup-resources.md
Created September 14, 2018 13:21 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

Enable mobx' annotations in es6

  1. Install plugins:

yarn add mobx mobx-react react-app-rewire-mobx

yarn add --dev react-app-rewired

  1. Define config-overrides:
@simplay
simplay / digital_ocean_setup.md
Created October 17, 2017 21:56 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@simplay
simplay / require_gems.md
Created October 13, 2017 07:56
Require all gems specified in a Gemfile in a non Rails app.

Inside Gemfile:

source "https://rubygems.org"
gem 'hashtel'

The app.rb code:

@simplay
simplay / gist:b5c5e84009048a238eea430b55968c1c
Created October 2, 2017 10:52
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~

PSQL Cheat-Sheet

Some Facts

  • NULLis never equal to anything.
  • 7 = NULLand 7 <> NULL always yield NULL
  • 7 IS DISTINCT FROM NULL is TRUE
  • 7 IS NOT DISTINCT FROM NULL is FALSE
  • Match UNKNOWN via IS (NOT) UNKNOWN
  • Only records with a true conditional in a WHERE statement are matched (and hence fetched).
@simplay
simplay / yardoc_cheatsheet.md
Created July 21, 2017 13:36 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

http://ubuntuhandbook.org/index.php/2017/04/install-the-latest-keepass2-2-35-in-ubuntu-16-04-16-10-14-04/
@simplay
simplay / debugging_in_jruby.md
Created February 20, 2017 08:42 — forked from klappradla/debugging_in_jruby.md
Debugging in JRuby

Debugging in JRuby

Step-by-step debugging and stack navigation for JRuby code.

Problem: the common tools byebug and pry-byebug are MRI-only.

Prerequisites

Force JRuby to run in fully interpreted mode:
(otherwise next would behave like step)

@simplay
simplay / tmux-cheatsheet.markdown
Created February 13, 2017 13:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname