This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script can be launched at login time by creating an app wrapper with Automator. | |
# 1. open Automator | |
# 2. create a new application | |
# 3. search for and add "Run shell script" | |
# 4. either copy the code below or invoke it | |
# 5. save your new "app" | |
# 6. go to "System Preferences > Users & Groups > Login items" and add the new app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://play.golang.com/p/nVrmIlgzZac | |
package main | |
import ( | |
"fmt" | |
) | |
// FindPowerSet does not include the empty set. | |
// The imput set must already be distinct values. | |
func FindPowerSet(set []string) (powerset [][]string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Can be easily modified to work with binary with a unitStep of 1024 and iB as a suffix instead of B. | |
func HumanizeSize(b int64) string { | |
const unitStep = 1000 | |
const units = "BkMGTPE" | |
v := float64(b) | |
exp := 0 | |
for v > unitStep { | |
v /= unitStep | |
exp++ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script generates a register_queries.go file which uses embed | |
# to pack queries in a binary. | |
# | |
# The generated file will panic if additional queries are added to | |
# the query folder. | |
# | |
# This can then be hooked up in any go file with: | |
# | |
# //go:generate sh ./generator.sh query queries | |
# var queries map[string]string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Basic Google Keep to Standard Notes importer made by | |
* https://github.com/lzambarda because he was too lazy to manually migrate his | |
* notes. | |
* | |
* How to use: | |
* 1) Use Google Takeout to export a copy of your Keep notes. The folder you | |
* will download will contain two files for each note: | |
* - a sassy html visually resembling your note | |
* - a tasty JSON file containing the true format of the note |