Skip to content

Instantly share code, notes, and snippets.

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 webData('a) = RemoteData.t('a, 'a, string);
type language = {
name: option(string),
count:int
}
type repo = {
id: int,
owner: string,
@mithereal
mithereal / app.re
Last active August 30, 2018 23:00
bs prob reloaded
type state =
| LOADING
| ERROR
| LOADED(string)
type searchType =
| ZIP
| LOCATION
@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 / 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 / .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 / filter.ex
Created January 3, 2018 17:06
elixir filter from a list
defmodule Filter do
@moduledoc """
this module will filter out results from a list via body or tail recursion
"""
@doc """
this will filter one result from the list via tail recursion
"""
@mithereal
mithereal / tile38.service
Created October 12, 2017 16:48
tile38 systemd script
[Unit]
Description=Advanced Geolocation store
After=network.target
Documentation=http://tile38.com/documentation/, man:redis-server(1)
[Service]
Type=forking
ExecStart=/srv/geodb/tile38-server
PIDFile=/var/run/tile38/tile38-server.pid
TimeoutStopSec=0
@mithereal
mithereal / brunch-config.js
Created September 28, 2017 00:04
brunch config
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: {
"js/landing/vendor.js": /^(bundled\/js\/landing|vendor|deps|node_modules).*/,
"js/page/vendor.js": /^(bundled\/js\/page|vendor|deps|node_modules).*/,
"js/quote/vendor.js": /^(bundled\/js\/quote|vendor|deps|node_modules).*/,
// Brunch automatically concatenates all files in your
// watched paths. Those paths can be configured at
// config.paths.watched in "brunch-config.js".
//
// However, those files will only be executed if
// explicitly imported. The only exception are files
// in vendor, which are never wrapped in imports and
// therefore are always executed.
// Import dependencies