Skip to content

Instantly share code, notes, and snippets.

View WolfDan's full-sized avatar
❄️
halcyon days

WolfDan

❄️
halcyon days
View GitHub Profile
@WolfDan
WolfDan / mk_image.sh
Created September 25, 2022 01:41 — forked from patmaddox/mk_image.sh
FreeBSD ZFS-on-Root (GCP)
#!/bin/sh
set -e
set -x
# Adapted from https://www.daemonology.net/blog/2019-02-16-FreeBSD-ZFS-AMIs-now-available.html
# Note: You need to run this on an instance with read/write access to Google Compute
# Alternatively, you can run the gcloud commands from somewhere with privileges
disk=da1
@WolfDan
WolfDan / in.ex
Last active January 9, 2019 17:59
Instruction Parser
%{
where: %{
OR: [
%{
description: "description",
OR: [
%{
test: "hmmm"
},
%{
defmodule Nomure.Database.Coder.GraphValue do
@moduledoc """
A module that specifies how the data is serialized, pretty much as the `FDB.Coder.Dynamic` but without
the need of specifing the type
"""
use FDB.Coder.Behaviour
import Nomure.Database.Coder.Guards,
only: [is_int: 1, is_long: 1, is_short: 1, is_long_string: 1, is_byte: 1]
// Main
package com.first;
public class Main {
public static void main(String[] args) {
HangmanConsole console = new HangmanConsole();
console.startGame();
@WolfDan
WolfDan / main.java
Created August 23, 2018 03:14
First UNAL exercise...
package com.first;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
@WolfDan
WolfDan / reForm.re
Last active January 8, 2018 22:49
ReForm validation proposal
/* Source from: https://github.com/Astrocoders/reform I edited it to handle the onChange events and validation */
type action =
| HandleChange((string, string))
| HandleSubmit;
type validation =
| Required
| MinLength(int)
| MaxLength(int)
| Between(int, int)
defmodule Search.Searcher do
# Score consts
@sequential_bonus 15 # bonus for adjacent matches
@separator_bonus 30 # bonus if match occurs after a separator
@camel_bonus 30 # bonus if match is uppercase and prev is lower
@first_letter_bonus 15 # bonus if the first letter is matched
@leading_letter_penalty -5 # penalty applied for every letter in str before the first match
@max_leading_letter_penalty -15 # maximum penalty for leading letters