Skip to content

Instantly share code, notes, and snippets.

View opensussex's full-sized avatar

Graham Holden opensussex

View GitHub Profile
@opensussex
opensussex / scritch.rkt
Created June 8, 2023 15:56
Scritch a rough outline of a scratch pad using Racket
#lang racket/gui
(define f (new (class frame%
(super-new))
[label "Scritch"]
[width 800]
[height 600]))
(define c (new editor-canvas% [parent f]))
(define t (new text%))
(send c set-editor t)
(send f show #t)
@opensussex
opensussex / .env
Created February 23, 2023 16:00
loading environment vars with svelte / rollup in netlify
TEST_VAR="TEST ENVIRONMENT VAR"
@opensussex
opensussex / karabiner.json
Created January 4, 2023 07:54
karabiner-elements config for wasd keyboard.
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
//------------------------------------------
#include "textures.inc"
plane { <0,1,0>,0
pigment {
Tiles_Ptrn()
color_map{
[0.00 color rgb <0,1,0>] // lines
[0.04 color rgb <0,0,0,1>] // space
}
@opensussex
opensussex / doubleLinkedList.js
Created January 27, 2021 15:18
little example of a double linkedList
const uuid = require('uuid/v1');
export default class DoubleLinkedList {
list;
currentItemId;
constructor(items) {
this.setList(items);
}
@opensussex
opensussex / PlayState.hx
Created April 28, 2020 15:31
basics of a play state with mouse interaction haxeflixel
package;
import flixel.FlxState;
import flixel.input.mouse.FlxMouseEventManager;
import flixel.input.mouse.FlxMouseButton.FlxMouseButtonID;
class PlayState extends FlxState
{
var player:Player;
override public function create()
@opensussex
opensussex / middle-me.md
Last active November 26, 2019 08:25
middle me challenge written in clojure

Challenge Write a function that will take a key of X and place it in the middle of Y repeated N times.

Rules: If X cannot be placed in the middle, return X. N will always be > 0.

(ns test.core
 (:gen-class))
@opensussex
opensussex / match_stick_factory.ex
Last active April 11, 2018 11:41
having a go at creating a module to work out the number of boxes are needed for the number of matches past in - this is for the learning functional programming with elixir book
defmodule MatchStickFactory do
def boxes(number_of_matches) do
number_of_matches_in_big = 50;
number_of_matches_in_medium = 20;
number_of_matches_in_small = 5;
number_of_matches_remaining = number_of_matches;
{number_of_big_boxes, number_of_matches_remaining} = divide(number_of_matches_remaining, number_of_matches_in_big)
{number_of_medium_boxes, number_of_matches_remaining} = divide(number_of_matches_remaining, number_of_matches_in_medium)
{number_of_small_boxes, number_of_matches_remaining} = divide(number_of_matches_remaining, number_of_matches_in_small)
@opensussex
opensussex / tax.ex
Created April 10, 2018 19:43
example of some elixir anonymous function
apply_tax = fn price -> tax = (price * 0.12); total = price + tax;IO.puts "Price: #{total} - Tax: #{tax}" end;
Enum.each [12.5, 30.99, 250.49, 18.80], apply_tax
<?php
$yodiz_columns = [
[
'title'=>'Position',
'from_done_done' =>2
],
[
'title'=>'Id',
'from_done_done'=>2,