Skip to content

Instantly share code, notes, and snippets.

View lanwen's full-sized avatar
🎃
Thats my status

Kirill Merkushev lanwen

🎃
Thats my status
View GitHub Profile
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@vielhuber
vielhuber / bash.sh
Created February 24, 2020 22:21
Git auto tag next semver version #tools
#!/bin/bash
v=`git describe --abbrev=0 --tags 2>/dev/null`
n=(${v//./ })
n1=${n[0]}
n2=${n[1]}
n3=${n[2]}
if [ -z "$n1" ] && [ -z "$n2" ] && [ -z "$n3" ]; then n1=1; n2=0; n3=0
else n3=$((n3+1)); fi
if [ "$n3" == "10" ]; then n3=0; n2=$((n2+1)); fi
if [ "$n2" == "10" ]; then n2=0; n1=$((n1+1)); fi
@mtei
mtei / split-keyboard-figs.md
Last active March 16, 2024 22:58
split keyboard figs

i2c connection

#define USE_I2C

sk-i2c-connection-red

sk-i2c-connection-blue

sk-i2c-connection-gray

sk-i2c-connection-mono

@salgmachine
salgmachine / OAuth2AuthorizationServerConfigJwt.java
Last active March 20, 2024 19:56
JWE/JWT with Spring Boot 2 and Nimbus JOSE JWT
// this is based on code from https://www.baeldung.com/spring-security-oauth-jwt
// also based on code from https://connect2id.com/products/nimbus-jose-jwt/examples/signed-and-encrypted-jwt and https://connect2id.com/products/nimbus-jose-jwt/examples/jwt-with-rsa-encryption
// used com.nimbusds:nimbus-jose-jwt:6.4.2
// interesting bits at lines 120 - 188
/**
* THIS IS JUST A PROOF OF CONCEPT. DO NOT USE IN PRODUCTION.
*/
import java.text.ParseException;
import java.util.Arrays;
@troyfontaine
troyfontaine / 1-setup.md
Last active May 12, 2024 15:17
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@GuyPaddock
GuyPaddock / gradle_aop_agent.gradle
Created March 25, 2017 15:52
Getting Gradle to resolve path to agent dependencies
// BEGIN: Dynamic agent JAR config
configurations {
runtimeAgent
}
// END: Dynamic agent JAR config
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
}
@schmohlio
schmohlio / sse.go
Last active February 13, 2023 08:38 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@destan
destan / ParseRSAKeys.java
Last active March 29, 2024 10:43
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@bruth
bruth / README.md
Last active November 23, 2022 21:54
Postgres push notification

Postgres push triggers

Watch a table for changes and push a notification with a payload describing the change.

Example

In the Postgres shell:

-- Create the functions
@adamveld12
adamveld12 / comments.md
Last active April 5, 2024 17:13
Go Code Review Comments

Go Code Review Comments

This page collects common comments made during reviews of Go code, so that a single detailed explanation can be referred to by shorthands. This is a laundry list of common mistakes, not a style guide.

You can view this as a supplement to http://golang.org/doc/effective_go.html.

Please discuss changes before editing this page, even minor ones. Many people have opinions and this is not the place for edit wars.