Skip to content

Instantly share code, notes, and snippets.

@aaylward
aaylward / pizza_pricing.gleam
Last active August 29, 2023 12:26
gleam rulez
pub type Pizza {
Margherita
Caprese
Formaggio
ExtraSauce(Pizza)
ExtraToppings(Pizza)
}
fn pizza_price_helper(pizza: Pizza, acc: Int) -> Int {
case pizza {
@aaylward
aaylward / ijs
Last active August 1, 2023 01:50
project euler #1 baby J solution
x =: 1 + i.999
z =: 0 & =
+/ ((z 3|x) >. (z 5|x)) * x
@aaylward
aaylward / tracer.scala
Last active September 9, 2021 21:36
ray tracer
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import java.io.File
val BLACK = Color(0, 0, 0)
val RED = Color(255, 0, 0)
val GREEN = Color(0, 255, 0)
val BLUE = Color(0, 0, 255)
val YELLOW = Color(255, 255, 0)
val WHITE = Color(255, 255, 255)
(ns meetup)
(def myinput { :app1 #{:t1 :t2} :app2 #{:t2 :t3} :app3 #{:t2 :t3 :t4}})
(defn update-table [outputmap table app]
(assoc outputmap table (conj (or (outputmap table) #{}) app)))
(defn process-tables [outputmap [app tables]]
(loop [map outputmap appname app ts tables]
(if (empty? ts)
@aaylward
aaylward / karabiner.json
Last active March 28, 2017 14:17
karabiner elements config for vim clutch on sierra for use with https://github.com/wwwjfy/Karabiner-Elements/releases/tag/0.90.90 . modify your ~/.config/karabiner/karabiner.json to look kinda like
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"devices": [
{
@aaylward
aaylward / HowToOTGFast.md
Created March 10, 2017 17:16 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH is

@aaylward
aaylward / Gruntfile.js
Last active January 2, 2016 03:59
example grunt express
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-express-server');
grunt.initConfig({
pkg: require('./package.json'),
express: {
dev: {
options: {