Skip to content

Instantly share code, notes, and snippets.

View heyarne's full-sized avatar

heyarne

View GitHub Profile

Keybase proof

I hereby claim:

  • I am heyarne on github.
  • I am heyarne (https://keybase.io/heyarne) on keybase.
  • I have a public key ASDvj02EXJrTlfilf9OLmjN9lMYO6Is93UU-gqkZeAr_hAo

To claim this, I am signing this object:

#!/usr/bin/env bash
LOG="/var/log/update-dyndns.log"
USER="DYNDNS2_USER"
PASS="DYNDNS2_PASS"
URL="DYNDNS2_ENDPOINT"
exec > >(tee -i ${LOG})
exec 2>&1
[Macaron] 2018-04-17 20:54:49: Started GET /index.html for :xed-out-ip-address:, :xed-out-ip-address:
[Macaron] 2018-04-17 20:54:49: Completed /index.html 404 Not Found in 8.763581ms
[Macaron] 2018-04-17 20:54:49: Started GET /vendor/assets/octicons/octicons.min.css for :xed-out-ip-address:, :xed-out-ip-address:
[Macaron] 2018-04-17 20:54:49: Started GET /vendor/plugins/cssrelpreload/cssrelpreload.min.js for :xed-out-ip-address:, :xed-out-ip-address:
[Macaron] [Static] Serving /vendor/plugins/cssrelpreload/cssrelpreload.min.js
[Macaron] 2018-04-17 20:54:49: Started GET /vendor/plugins/semantic/semantic.min.css for :xed-out-ip-address:, :xed-out-ip-address:
[Macaron] 2018-04-17 20:54:49: Completed /vendor/plugins/cssrelpreload/cssrelpreload.min.js 200 OK in 429.496µs
[Macaron] 2018-04-17 20:54:49: Started GET /css/index.css?v=38dfe6388acfa83c3486d41f22b08165 for :xed-out-ip-address:, :xed-out-ip-address:
[Macaron] [Static] Serving /vendor/assets/octicons/octicons.min.css
[Macaron] 2018-04-17 20:54:49: Complete
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@heyarne
heyarne / isochrones-galton-lat:52-lng:13.geojson
Last active April 27, 2018 09:49
Example Isochrones returned from galton
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@heyarne
heyarne / migrate.fish
Last active May 5, 2018 11:07
Move a folder of local bare git repos over to gitea
# assumes you have httpie installed: https://httpie.org/
set GITEA_URL "your.gitea.server"
set USER "YOUR_USERNAME"
set PASS "YOUR_PASSWORD"
for f in (find . -type d -name '*.git')
set --local name (basename $f | sed 's/\.git//')
pushd $f
http -a $USER:$PASS POST https://$GITEA_URL/api/v1/user/repos name=$name
git remote add origin git@$GITEA_URL:$USER/$name.git
@heyarne
heyarne / e.fish
Created August 2, 2018 16:09
emacsclient wrapper for fish shell
# This is a port of the emacs zsh script found on
# https://medium.com/@bobbypriambodo/blazingly-fast-spacemacs-with-persistent-server-92260f2118b7
# basically it checks whether we have a running emacs server; if we don't, it starts one
function e
emacsclient -n -e "(if (> (length (frame-list)) 1) 't)" ^ /dev/null | grep --silent t
if test $status -eq 1
# not running, -a '' starts a new server
emacsclient -a '' -nqc $argv > /dev/null ^ /dev/null
else
emacsclient -nq $argv > /dev/null ^ /dev/null
@heyarne
heyarne / Perlin.cs
Created May 20, 2019 09:39 — forked from Flafla2/Perlin.cs
Improved Perlin Noise Implementation in C#
public class Perlin {
public static double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
double frequency = 1;
double amplitude = 1;
for(int i=0;i<octaves;i++) {
total += perlin(x * frequency, y * frequency, z * frequency) * amplitude;
amplitude *= persistence;
@heyarne
heyarne / advanced-histogram.clj
Last active July 6, 2019 07:50
Unfinished Clojure puzzle for the purely functional newsletter
user=> (require '[clojure.string :as str])
nil
user=> (def dictionary (->> (slurp "/home/arne/Downloads/purely functional - wordlist.txt")
#_=> (str/split-lines)))
#'user/dictionary
user=> (defn frequency-histogram [phrase]
#_=> (->> (str/split (str/lower-case phrase) #"\s+")
#_=> (map frequencies)
#_=> (apply merge-with +)))
#'user/frequency-histogram
@heyarne
heyarne / airsonic.fish
Last active October 22, 2020 23:36
A simple command-line wrapper for interacting with the airsonic api. 🎧 Needs https://fishshell.com/ and https://httpie.org/.
#!/usr/bin/env fish
# Put this in your .config/fish/functions folder and you'll get an `airsonic`
# command that you can use to interact with the rest api. If you just want to
# play around with it, you can execute it directly.
function _airsonic_usage
echo 'Usage: airsonic [-h|--help] -u $user -p $pass [$url] $endpoint [...$params]'
echo
echo 'Interact with an airsonic server via REST. See http://www.subsonic.org/pages/api.jsp for additional documentation.'