Skip to content

Instantly share code, notes, and snippets.

View axelerator's full-sized avatar

Axel axelerator

  • Shopify
  • Montreal, Canada
View GitHub Profile
@axelerator
axelerator / main.roc
Created December 3, 2023 17:15
Error in alias analysis: error in module ModName("UserApp")
# thread 'main' panicked at 'Error in alias analysis: error in module ModName("UserApp"), function definition FuncName("\x13\x00\x00\x00\r\x00\x00\x00S\xd4\xce\x7ff\x8f\xfb5"), definition of value binding ValueId(5): could not find func in module ModName("UserApp") with name FuncName("\x13\x00\x00\x00\xb7\x00\x00\x00\')\xc9\xb5<\xabU~")', crates/compiler/gen_llvm/src/llvm/build.rs:5644:19
# note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
# -------------------------------------------------------------------------------------------------------------------
# ~/dev/roc/aoc23/03 (main*) » roc version
#roc nightly pre-release, built from commit a56d7adc17 on Fri Dec 1 09:19:25 UTC 2023
# (base) -------------------------------------------------------------------------------------------------------------------
# ~/dev/roc/aoc23/03 (main*) » uname -a
# Darwin Axels-Air 22.6.0 Darwin Kernel Version 22.6.0: Wed Oct 4 21:26:43 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_ARM64_T8112 arm6
@axelerator
axelerator / Main.elm
Created November 25, 2023 23:48
Dynamic Diagrams
-- https://blog.axelerator.de/development/en/liquid-diagrams
module Main exposing (main)
import Maybe.Extra
import Vector2d
import Dict
import Axis2d
import Browser
import Browser.Events exposing (onAnimationFrameDelta)
import Html exposing (Html, button, details, div, input, p, text, textarea)
@axelerator
axelerator / haskell_errors.md
Last active October 31, 2021 19:42
Confusing/Misleading Haskell error messages

Haskell has error messages that often add to the confusion rather than helping to remove it.

I collect some anecdotal examples here.

Missing extension

data EventResponse
  = Success
  | FailedParse String
@axelerator
axelerator / vrg.sh
Created May 26, 2020 16:51
Open all files found with ripgrep in vim
#!/bin/sh
MATCHES=`rg -l $@ `
echo "$MATCHES"
read -p "Open these files?([Y/n])" -n 1 -r
if [[ $REPLY = '' || $REPLY =~ ^[Yy]$ ]]
then
FILES=`echo $MATCHES | tr "\n" ' '`
vim $FILES
@axelerator
axelerator / Animation and Naviagation
Last active May 3, 2020 02:26
animation_navigation.elm
module Main exposing (Model, Msg(..), init, main, subscriptions, update, view)
import Animation exposing (px)
import Browser
import Browser.Navigation as Nav
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Url
@axelerator
axelerator / input.hs
Created February 2, 2020 04:24
Asyn user input
main = do
hSetBuffering stdin NoBuffering
hSetEcho stdin False
mVar <- newMVar ""
putStrLn "Go"
runAfterDelay 1000000 (appender mVar "foo")
runAfterDelay 2000000 (appender mVar "bar")
typer mVar
putStrLn "Main done"
@axelerator
axelerator / handleplay.ino
Created October 18, 2018 02:15
Customize play function to support different frequencies
void handlePlay() {
String response = "POSTED";
response += server.arg("timings");
readCSV(server.arg("timings"));
for (int i = 0; i < current_data_length; ++i) {
Serial.println(signal_data[i]);
}
int frequency = server.arg("frequency").toInt();
irsend.sendRaw(signal_data, current_data_length, frequency); // Send a raw data capture at frequency given as request parameter.
server.sendHeader("Access-Control-Allow-Origin", "*");
@axelerator
axelerator / yaml key sorting in vim
Last active September 21, 2017 16:01
yaml key sorting in vim
nmap <leader>y :!yml-sorter -i % -o %<CR>
https://www.npmjs.com/package/yml-sorter
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/var/www/APP_NAME/shared/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name APP_NAME.42ls.de APP_NAME.42ls.de;
@axelerator
axelerator / custom_search.rb
Created January 31, 2017 13:41
Custom search
class HomeController < ApplicationController
class MovieSearch < FortyFacets::FacetSearch
model 'Movie' # which model to search for
custom :for_manual_handling
end
def index