Skip to content

Instantly share code, notes, and snippets.

Nicolas Bettenburg nicbet

Block or report user

Report or block nicbet

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
@nicbet
nicbet / Code Signing with Git on Mac OS X.md
Created Dec 13, 2019
Code Signing in Git on Mac OS X
View Code Signing with Git on Mac OS X.md

Install required software

brew install gpg pinentry pinentry-mac

Create a GPG Key

gpg --full-generate-key
View Deploy a Phoenix app with Dokku.md
@nicbet
nicbet / digital-ocean-ddns-update.sh
Created Jul 8, 2019
Digital Ocean - Dynamic DNS (DDNS) Updater Script for Multiple Subdomains (e.g., Traefik)
View digital-ocean-ddns-update.sh
#!/bin/bash
# Created by fibergames.net // Loranth Moroz // v.0.5
# Updated by yukicreative // Jay Vogt // v.0.6
# Updated by nicbet // Nicolas Bettenburg // v.0.7
# Required tools to run this script as is: curl (https://curl.haxx.se/) & jq (https://stedolan.github.io/jq/)
# This is to be used with crontab -> example entry to run it every 3hours:
# 0 */3 * * * sh /path/to/script/dnsupdater.sh
# Don't forget to make it executable: chmod +x /path/to/script/dnsupdater.sh
@nicbet
nicbet / Dockerfile
Created Jun 27, 2019
Elixir 1.9 Releases Alpine Linux Docker Multi-Stage Build
View Dockerfile
# ---- Build Stage ----
FROM erlang:22-alpine AS app_builder
# Set environment variables for building the application
ENV MIX_ENV=prod \
TEST=1 \
LANG=C.UTF-8
# Fetch the latest version of Elixir (once the 1.9 docker image is available you won't have to do this)
RUN set -xe \
@nicbet
nicbet / workbench.main.css
Created May 7, 2019
Visual Studio Code Tree Lines
View workbench.main.css
/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
* /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css
*--------------------------------------------------------*/
.monaco-action-bar{text-align:right;overflow:hidden;white-space:nowrap}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;width:100%;justify-content:flex-end}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar.reverse .actions-container{flex-direction:row-reverse}.monaco-action-bar .action-item{cursor:pointer;display:inline-block;transition:transform 50ms ease;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar.animated .action-item.active{transform:scale(1.272019649)}.monaco-action-bar .action-item .icon{display:inline-block}.monaco-action-bar .action-label{font-size:11px;margin-right:4px}.monaco-action-bar .action-label.octicon{fo
@nicbet
nicbet / song.txt
Created May 6, 2019
Teaching my Toddler about Bitbucket
View song.txt
The itsy bitsy bucket contains all our code,
down comes the git commit and adds another load,
out comes the pull request and merges the changes in,
the itsy bitsy bucket now has more code within.
@nicbet
nicbet / pretty_print.py
Created Apr 30, 2019
Prettier formatting of numbers for Tables in Python
View pretty_print.py
def pretty_num(value, t=5):
if(len(repr(value)) > t):
if(value < 1):
return 0
else:
return '%.2e' % value
else:
return "{:,}".format(value)
@nicbet
nicbet / start_mysql.sh
Created Apr 9, 2019
Running Data Services via Docker with Persistent Data
View start_mysql.sh
#!/bin/bash
docker run --name mysql -d -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_ROOT_PASSWORD=mysql -v $(pwd)/mysql:/var/lib/mysql -p 3306:3306 mysql:8
@nicbet
nicbet / .rubocop.yml
Created Apr 3, 2019
Rubocop sane defaults for Rails 5.2
View .rubocop.yml
Rails:
Enabled: true
AllCops:
TargetRubyVersion: 2.5
Exclude:
- bin/*
- Gemfile
- vendor/**/*
- node_modules/**/*
- db/schema.rb
@nicbet
nicbet / database.yml
Created Apr 3, 2019
DRY Database Config for Rails
View database.yml
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: <%= ENV.fetch("DB_USER") { "postgres" } %>
password: <%= ENV.fetch("DB_PASSWORD") { "postgres" } %>
host: <%= ENV.fetch("DB_HOST") { "localhost" } %>
You can’t perform that action at this time.