Skip to content

Instantly share code, notes, and snippets.

View refs's full-sized avatar
🤖
Another pointless day where I accomplish nothing 🍸

Alex Unger refs

🤖
Another pointless day where I accomplish nothing 🍸
View GitHub Profile
@refs
refs / configs.md
Last active October 8, 2019 08:42

backend.toml

# "look ma, no hands"
# commented on each individual directive are the available parameters
# requires:
#   - /data/users.json (https://gist.github.com/refs/6efa7ef2a6d8259594c88125d0fdccf0)
# follow same naming convention as jfd... (b)ackend, (-)noauth only jwt tokens, (o)wncloud storage driver

[core]
@refs
refs / thisisfine.gif
Last active February 4, 2022 14:56
thisisfine.gif
package main
import (
"fmt"
"io"
"log"
"os"
"strconv"
"sync"
@refs
refs / go-stdlib-interface-selected.md
Created July 18, 2019 08:49 — forked from asukakenji/go-stdlib-interface-selected.md
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

// curry functions with up to 2 arguments
function cTwo(fn) {
return x => {
return y => {
return fn(x, y)
}
}
}
function cThree(fn) {
@refs
refs / Postgres-stuff.md
Created March 19, 2019 12:32
things collected along the learning highway

System Monitoring Queries

SELECT pg_size_pretty( pg_database_size('dbname') ); prettified database size.

@refs
refs / curry.js
Created January 8, 2019 21:33
Function Curry in Javascript
// curry functions with up to 2 arguments
function cTwo(fn) {
return x => {
return y => {
return fn(x, y)
}
}
}
function cThree(fn) {
// ==UserScript==
// @name PR Files Collapser
// @namespace http://tampermonkey.net/
// @version 0.1
// @description It collapses files on Github PR view
// @author Alex. U
// @match https://github.com/*
// @require https://code.jquery.com/jquery-2.1.4.min.js
// @grant none
// @noframes
@refs
refs / help.md
Last active November 18, 2018 12:33

Postgres

init / stop postgres daemon (9.6)

# 1. prepare the destination directory
sudo mkdir /usr/local/pgsql
sudo chmod 775 /usr/local/pgsql
sudo chown $(whoami) /usr/local/pgsql
@refs
refs / custom_json.go
Created October 19, 2018 09:14 — forked from mdwhatcott/custom_json.go
Example of implementing MarshalJSON and UnmarshalJSON to serialize and deserialize custom types to JSON in Go. Playground: http://play.golang.org/p/7nk5ZEbVLw
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
)
func main() {