Skip to content

Instantly share code, notes, and snippets.

View rjungemann's full-sized avatar

Roger Jungemann rjungemann

View GitHub Profile
@ygotthilf
ygotthilf / jwtRS256.sh
Last active August 31, 2026 22:25
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@shaunlebron
shaunlebron / es7coreasync.md
Last active July 28, 2018 07:58
es7 vs core.async

Comparing ES7 and core.async

ES7 core.async
async function() {...} (fn [] (go ...))
await ... (<! ...)
await* or Promise.all(...) (doseq [c ...] (<! c))
@patik
patik / how-to-squash-commits-in-git.md
Last active August 24, 2026 11:43
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@AaronBPaden
AaronBPaden / nvim-command
Last active August 29, 2015 14:24
Run a command in the running neovim session.
#!/usr/bin/python2
from __future__ import print_function
from docopt import docopt
from neovim import attach
from neovim.api import NvimError
import os
import sys
__doc__ = """nvim-command - Run a command in the running neovim session.
Usage:
nvim-command <command>..."""
@CMCDragonkai
CMCDragonkai / free_monad_interpreter_pattern.md
Last active January 7, 2026 14:35
Haskell: Free Monad + Interpreter Pattern

Free Monad + Interpreter Pattern

It's like creating the front end and back end of a compiler inside Haskell without the need of Template Haskell!

Write your DSL AST as a Free Monad, and then interpret the monad any way you like.

The advantage is that you get to swap out your interpreter, and your main code

@optimalistel
optimalistel / CMakeHideConsole.cmake
Last active July 11, 2025 11:13
CMake Hide console window in visual studio projects
#--------------------------------------------------------------------
# Hide the console window in visual studio projects
#--------------------------------------------------------------------
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
#--------------------------------------------------------------------
# Hide the console window in visual studio projects - Release
#--------------------------------------------------------------------
@oliyh
oliyh / condas.clj
Created May 14, 2015 16:28
condas-> - A Clojure macro combining cond-> and as-> to give more flexibility in the test and step forms
(defmacro condas->
"A mixture of cond-> and as-> allowing more flexibility in the test and step forms"
[expr name & clauses]
(assert (even? (count clauses)))
(let [pstep (fn [[test step]] `(if ~test ~step ~name))]
`(let [~name ~expr
~@(interleave (repeat name) (map pstep (partition 2 clauses)))]
~name)))
@ae-s
ae-s / .bashrc
Last active February 11, 2023 01:48
Host-dependent automatic prompt colorization
#!/bin/bash
# Put the contents of this file in your .bashrc, to
# get a prompt that is automatically a distinct,
# stable color on every host you log into.
# ^O puts terminal back into default text mode for every prompt,
# preventing random glyphs.
resetterm="\[\017\]"

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co
@flaugher
flaugher / gist:ec36ec940a31707ac683
Created March 1, 2015 20:03
Things to do if your Django form.is_valid() method fails
- Check that you inserted "request.POST" as an argument to your form when instantiating the form in your view after the POST.
- Add {{ form.errors }} {{ form.non_field_errors }} to the form or debug your view and print them from the debugger.
- Examine each form field in the debugger: myform['<fieldname>'].value()
- Make sure DEBUG = True so that you'll see any server errors.
- Check your server log.
- If all else fails, step through the is_valid() call.