Skip to content

Instantly share code, notes, and snippets.

View nitschmann's full-sized avatar

Florian Nitschmann nitschmann

  • solarisBank AG
  • Germany
View GitHub Profile
@noamtamim
noamtamim / README.md
Last active April 29, 2024 13:13
Markdown with PlantUML

How to use PlantUML with Markdown

PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.

Here's how I combine the two, to create docs with embedded diagrams.

Step 0: Setup

Get the command-line PlantUML from the download page or your relevant package manager.

@gmolveau
gmolveau / how_to_reverseproxy_proxypass_nginx_letsencrypt.md
Last active May 2, 2024 19:19
How to use nginx as a reverse-proxy with letsencrypt

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements

@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@bwbaugh
bwbaugh / unifi-raspberry_pi-instructions.sh
Created August 20, 2016 22:38
Installing Ubiquiti UniFi Controller 5 on Raspberry Pi.
# Mirror of the instructions available here:
# http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi/
#
# These commands CANNOT be run in a script.
# They're just for reference.
# Install on Raspbian Jessie, or upgrade from Wheezy.
# Make sure all packages are upgraded (update && upgrade).
@jacob-faber
jacob-faber / os_arch.go
Last active July 25, 2020 18:29
Golang build flags
// Go 1.6.1, Some combinations are valid, some not
// The known operating systems.
var okgoos = []string{
"darwin",
"dragonfly",
"linux",
"android",
"solaris",
"freebsd",
"nacl",
@solyarisoftware
solyarisoftware / idle.rb
Last active July 11, 2023 20:58
Ruby script to test how to fetch IMAP mails (IDLE "push" mode) without pulling (in "real-time")
# Encoding: utf-8
#
# idle.rb
#
# goal:
# Ruby script to test how to fetch IMAP mails with IDLE mode.
# IMAP IDLE allow a sort of "push" / "real-time" delivery.
#
# I used the script to test LATENCY (end-to-end delivery times)
@aackerman
aackerman / escape.rb
Last active September 5, 2017 02:09
Escaping a Lucene query in Ruby
RE_ESCAPE_LUCENE = /
( [-+!\(\)\{\}\[\]^"~*?:\\\/] # A special character
| && # Boolean &&
| \|\| # Boolean ||
)
/x
"123-456-7890".gsub(RE_ESCAPE_LUCENE) { |m| "\\#{m}" }
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 26, 2024 10:44
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@kinopyo
kinopyo / custom_logger.rb
Created October 11, 2011 15:40
Custom logger file in Rails
# lib/custom_logger.rb
class CustomLogger < Logger
def format_message(severity, timestamp, progname, msg)
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
end
end
logfile = File.open("#{Rails.root}/log/custom.log", 'a') # create log file
logfile.sync = true # automatically flushes data to file
CUSTOM_LOGGER = CustomLogger.new(logfile) # constant accessible anywhere
@macek
macek / 20101004063749_create_photos.rb
Created October 4, 2010 22:38
How to save uploaded files to your database in Rails
# db/migrate/20101004063749_create_photos.rb
class CreatePhotos < ActiveRecord::Migration
def self.up
create_table :photos do |t|
t.string :name, :null => false
t.binary :data, :null => false
t.string :filename
t.string :mime_type
t.timestamps