Skip to content

Instantly share code, notes, and snippets.

View monomadic's full-sized avatar
♥️
rust and crypto

Monomadic monomadic

♥️
rust and crypto
  • Nomadic
View GitHub Profile
@monomadic
monomadic / main.rs
Created December 25, 2018 11:45
Window with NSEvent delegate in rust.
extern crate cocoa;
#[macro_use]
extern crate objc;
use cocoa::appkit::*;
use cocoa::base::*;
use cocoa::foundation::*;
use objc::runtime::*;
@monomadic
monomadic / decodeFloatToInt.elm
Last active October 7, 2018 08:52
Convert a float to an int with JSON.Decode
import Json.Decode as Decode
type alias CoinPair = { pair: String, price: Float, rsi_15m: Int }
decodeCoinPair : Decode.Decoder CoinPair
decodeCoinPair =
Decode.map5 CoinPair
(Decode.field "pair" Decode.string)
(Decode.field "price" Decode.float)
(Decode.field "rsi_15m" decodeFloatAsInt)
@monomadic
monomadic / SortableTable.elm
Created September 15, 2018 13:35
elm - sortable-table example
module Main exposing (Model, Msg(..), Person, config, init, main, presidents, update, view)
import Browser
import Html exposing (Html, div, h1, input, text)
import Html.Attributes exposing (placeholder)
import Html.Events exposing (onInput)
import Table
main =
Browser.element
@monomadic
monomadic / mac.sh
Last active August 10, 2022 04:50
Forked from another file and documented, each entry on a new line to provide easy commenting / disabling of lines.
#!/bin/bash
# PRO TIP: Don't disable shit until you know exactly what it does. Remember that disabling doesn't kill the process, so most tweaks you need to reboot to fully see effects.
# MINI TUTORIAL ON LAUNCHCTL
# List all jobs in system:
# launchctl list
# first column is the process id, or - if the job is not loaded. second is exit code.
@monomadic
monomadic / advtool.rb
Last active August 29, 2015 14:19
ableton_tools
#!/usr/bin/env ruby
require 'nokogiri'
require 'fileutils'
require 'zlib'
require 'colorize'
INPUT_FILE = ARGV[0]
PROJECT_NAME = (ARGV[1].nil? || ARGV[1].empty?) ? nil : ARGV[1] # dirty but necessary unforch. ruby sucks.
OUTPUT_DIR = "./_output"
@monomadic
monomadic / split_midi_tracks.rb
Last active August 29, 2015 14:14
Batch split multi-part MIDI files into single-part MIDI files.
require 'fileutils'
require 'midilib/sequence'
require 'midilib/io/midifile'
DEBUG = false
LOGGING = true
LOG_FILE = Dir.pwd + '/error.log'
INPUT_DIR = './vgm/'
OUTPUT_DIR = '../split'