Skip to content

Instantly share code, notes, and snippets.

View fonsp's full-sized avatar
🌳
climbing

Fons van der Plas fonsp

🌳
climbing
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/////////// NOTE ////////////////
// THIS IS FROM
// https://www.doc.gold.ac.uk/~esoer001/mljs-noglpk-module.js
// WITH SOME SLIGHT MODIFACTIONS TO SUIT MY USE CASE
// I AM NOT THE AUTHOR
// see the original LALO package for info
#!/bin/bash
#############################################
# CHANGE THIS LINE TO SET THE DEFAULT PROMPT
DEFAULT_PRINTI_ADDRESS="printi"
#############################################
if [ -z "$CHOSEN_ADDRESS" ]; then
@fonsp
fonsp / luka.py
Last active October 5, 2019 11:31
def g(input, offset=0):
return [sum(input[:i+1]) + offset if x else None for i, x in enumerate(input)]
def f(input, offset_carry=0):
# ~~ recursive ~~
# base case:
if not input:
return []
# recursive case:
current = input[0]
@fonsp
fonsp / printipi.sh
Last active March 28, 2020 22:23
Printi client for the Raspberry Pi
#!/bin/bash
cd /tmp/
! mkdir printi
cd printi
if [ -z "$1" ]
then
echo "Give a printi name as argument to this script."
exit
### A Pluto.jl notebook ###
# v0.7.4
using Markdown
macro bind(def, element)
quote
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.peek, el) ? Base.peek(el) : missing
el
end
using Plots
using ClimateMARGO
using LaTeXStrings
using Colors
# Helpers
function pl_percent_formatter(y)
"$(Integer(round(y*100)))%"
### A Pluto.jl notebook ###
# v0.9.10
using Markdown
macro bind(def, element)
quote
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.peek, el) ? Base.peek(el) : missing
el
end
using Test
"asdf"
function jl_is_runnable(path)
🏡 = Core.eval(Main, :(module asdf end))
try
Core.eval(🏡, :(include($path)))
catch ex
println.(enumerate(readlines(path; keep=true)))