Skip to content

Instantly share code, notes, and snippets.

@mithereal
mithereal / .zshrc
Last active February 1, 2018 00:35
install bfg repo cleaner in arch/antegros
function git_clean_passwords() {
if [ -n "$1" ]
then
java -jar $HOME/bin/bfg.jar --replace-text passwords.txt $1
else
java -jar $HOME/bin/bfg.jar
fi
}
@mithereal
mithereal / all_changes_mergify.sh
Last active August 8, 2018 22:56
fix for mergeify
#!/bin/bash
GIT=`which git`
for d in $(find -name \.mergify.yml);
do (
DIR=${d//.mergify.yml}
cd "$DIR" &&
${GIT} add --all .
${GIT} commit -m "fix mergify"
${GIT} push
@mithereal
mithereal / App.re
Last active August 27, 2018 21:01
bucklescript prob
open Belt ;
type state = {
| LOADING
| ERROR
| LOADED(id) ;
};
type searchType =
| zip ;
@mithereal
mithereal / app.re
Last active August 30, 2018 23:00
bs prob reloaded
type state =
| LOADING
| ERROR
| LOADED(string)
type searchType =
| ZIP
| LOCATION
type webData('a) = RemoteData.t('a, 'a, string);
type language = {
name: option(string),
count:int
}
type repo = {
id: int,
owner: string,
open Googleplaces
open AddressShared
module Encode = {
let location = (location: location) =>
Json.Encode.(
object_([
("administrative_area_level_1", string(location.administrative_area_level_1)),
("country", string(location.country)),
("locality", string(location.locality)),
type marshalled_location = {.
"administrative_area_level_1": string,
"country": string,
"locality": string, "postal_code": string,
"route": string,
"street_number": string
}
type input = {
key: string,
type location = {
street_number: string,
route: string,
locality: string,
administrative_area_level_1: string,
country: string,
postal_code: string
}
@mithereal
mithereal / phx_run.sh
Last active December 1, 2018 23:56
elixir phoenix init script for restarting from shell with ssl key generation and db reset
#!/bin/bash
## place in the app root ie /
echo "This will reinit the db, create ssl keys and the main website"
PLATFORM_DIRECTORY=$(pwd)
PHOENIX_DIRECTORY="apps/api"
DB_DIRECTORY="apps/db"
@mithereal
mithereal / Makefile
Created March 26, 2019 18:51 — forked from xenogenesi/Makefile
create self signed certificates
DOMAIN ?= mydomain.com
COUNTRY := IT
STATE := IT
COMPANY := Evil Corp.
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309
# usage: