Skip to content

Instantly share code, notes, and snippets.

💭
🦄

Michael Single simplay

💭
🦄
Block or report user

Report or block simplay

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
@simplay
simplay / docker-cleanup-resources.md
Created Sep 14, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

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
View enable-mobx-annotation-es6.md

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 Oct 17, 2017 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
View digital_ocean_setup.md

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

Create a Droplet

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@simplay
simplay / require_gems.md
Created Oct 13, 2017
Require all gems specified in a Gemfile in a non Rails app.
View require_gems.md

Inside Gemfile:

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

The app.rb code:

@simplay
simplay / gist:b5c5e84009048a238eea430b55968c1c
Created Oct 2, 2017
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
View gist:b5c5e84009048a238eea430b55968c1c
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 ~
View psql_good2know.md

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).
View yardoc_cheatsheet.md

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
View gist:96f41262c2c9413c99517494c0805933
http://ubuntuhandbook.org/index.php/2017/04/install-the-latest-keepass2-2-35-in-ubuntu-16-04-16-10-14-04/
View debugging_in_jruby.md

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)

View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
You can’t perform that action at this time.