Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mblarsen's full-sized avatar
💭
Actively recommending people not to use WordPress!

Michael Bøcker-Larsen mblarsen

💭
Actively recommending people not to use WordPress!
View GitHub Profile
@rogpeppe
rogpeppe / vgoget.sh
Last active August 4, 2023 07:07
go get binary@version
#!/bin/sh
# This command installs binaries at specified versions
# into $GOBIN, $GOPATH/bin or $HOME/bin.
# It assumes Go 1.11.
if [ $# = 0 ]; then
usage: vgoget cmdpackage[@version]... >&2
exit 2
fi
d=`mktemp -d`
cd "$d"
" netrw
let g:netrw_banner = 0 " hide banner
let g:netrw_altv=1 " open splits to the right
let g:netrw_liststyle=3 " tree view
let g:netrw_list_hide=netrw_gitignore#Hide()
function! s:open_netrw()
" Grab the current file name
let file_name = expand("%:t")
" Open a 20-column left-side netrw explorer in the directory for the current
@mort3za
mort3za / git-auto-sign-commits.sh
Last active January 30, 2024 10:31
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@mariocesar
mariocesar / api.js
Created September 26, 2017 04:21
Axios single configured instance
import axios from "axios";
const singleton = Symbol();
const singletonEnforcer = Symbol();
function readCookie(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
}
@DavidWells
DavidWells / serverless.yml
Created September 15, 2017 05:39
DynamoDB custom index serverless.yml example
service: service-name
provider:
name: aws
runtime: nodejs6.10
functions:
myfunc:
handler: handler.myfunc
@cowboymathu
cowboymathu / touchcursor_mode.json
Created September 8, 2017 20:36
TouchCursor Karabiner-Elements json
{
"title": "TouchCursor Mode",
"rules": [
{
"description": "TouchCursor Mode [Space as Trigger Key]",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
@turbo
turbo / std.md
Last active April 14, 2024 09:18
Git Commit Message Standard

Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/

General Rules

  • Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
  • The subject line must not exceed 50 characters
  • The subject line should be capitalized and must not end in a period
  • The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
  • The body copy must be wrapped at 72 columns
  • The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
@ttscoff
ttscoff / karabiner.json
Last active February 1, 2023 23:34
Full karabiner.json for Hyper Key with Escape
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"rules": [
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 20, 2024 00:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@halberom
halberom / 00_play.yml
Created May 17, 2017 09:35
ansible - example of using map + regex_replace to modify all items in a list
---
- hosts: localhost
connection: local
gather_facts: False
vars:
mylist:
- group_1
- group_2
tasks: