Skip to content

Instantly share code, notes, and snippets.

@gnarmis
gnarmis / racket_quick_intro.rkt
Created January 2, 2019 23:11
A playful introduction to Racket (<60 min activity), with example usage of quickcheck (property based testing)
;; This is a playful introduction to Racket, using the in-built app
;; Dr. Racket, intended for a <60 min session.
;; Racket is a polygot-friendly, language designer friendly, beginner friendly
;; multi-paradigm general purpose programming language.
;; Install Racket and then open this little tutorial using Dr. Racket, by
;; saving it as a "racket_quick_intro.rkt" text file.
;; Download link for Racket: https://download.racket-lang.org
@gnarmis
gnarmis / sensor_loop.xml
Created April 24, 2018 21:57
NEPO program: sensor_loop
<export xmlns="http://de.fhg.iais.roberta.blockly"><program><block_set xmlns="http://de.fhg.iais.roberta.blockly" robottype="ev3" xmlversion="2.0" description="" tags=""><instance x="178" y="45"><block type="robControls_start" id="KF=O@fUtUJy5HXbAjbK(" intask="true" deletable="false"><mutation declare="false"></mutation><field name="DEBUG">FALSE</field></block><block type="robControls_loopForever" id="c30IgWEeP/O-?U4y%vW^" intask="true"><statement name="DO"><block type="robControls_ifElse" id="J[`1E#d%TdTWPv{Km`jh" intask="true"><mutation else="1"></mutation><repetitions><value name="IF0"><block type="logic_compare" id="+Jrku0q15]7@2eB.gHxk" intask="true"><field name="OP">LT</field><value name="A"><block type="robSensors_colour_getSample" id="mN_gllFh2X~)x*7gD17D" intask="true"><mutation mode="LIGHT"></mutation><field name="MODE">LIGHT</field><field name="SENSORPORT">3</field><field name="SLOT"></field></block></value><value name="B"><block type="math_number" id="k=Xc?r[Ty1[.Ovv6E,k-" intask="true"><field nam
@gnarmis
gnarmis / simple_loop.xml
Created April 24, 2018 21:55
NEPO program: simple_loop
<export xmlns="http://de.fhg.iais.roberta.blockly"><program><block_set xmlns="http://de.fhg.iais.roberta.blockly" robottype="ev3" xmlversion="2.0" description="" tags=""><instance x="178" y="45"><block type="robControls_start" id="KF=O@fUtUJy5HXbAjbK(" intask="true" deletable="false"><mutation declare="false"></mutation><field name="DEBUG">FALSE</field></block><block type="robActions_motorDiff_on_for" id="hKd3voniAqPp!8a%}:FS" intask="true"><field name="DIRECTION">FOREWARD</field><value name="POWER"><block type="math_number" id="L`91X?qsI]!R;D%CgIB9" intask="true"><field name="NUM">30</field></block></value><value name="DISTANCE"><block type="math_number" id="b;FkGdy7.O1Uikrp5K.]" intask="true"><field name="NUM">25</field></block></value></block><block type="robActions_motorDiff_turn_for" id="2EKf?d!oGV3Bq/VNSZS[" intask="true"><field name="DIRECTION">LEFT</field><value name="POWER"><block type="math_number" id="PY2+{ds4_(5s1xk3/x_r" intask="true"><field name="NUM">30</field></block></value><value name="DEGRE
@gnarmis
gnarmis / nodesource_setup_8
Created April 2, 2018 21:16
copy of https://deb.nodesource.com/setup_8.x, but without the atrocious ssl cert related error preventing secure `curl`s
#!/bin/bash
# Discussion, issues and change requests at:
# https://github.com/nodesource/distributions
#
# Script to install the NodeSource Node.js v8.x LTS Carbon repo onto a
# Debian or Ubuntu system.
#
# Run as root or insert `sudo -E` before `bash`:
#
@gnarmis
gnarmis / Preferences.sublime-settings
Created April 5, 2017 21:37
my sublime text user settings
{
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true,
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
"tab_size": 2,
@gnarmis
gnarmis / spooky_say.js
Created October 31, 2015 22:05
Spooky Say
function spookysay(s){
m = new SpeechSynthesisUtterance(s);
m.voice = speechSynthesis.getVoices().filter(function(voice) {return voice.name == 'Whisper'})[0];
speechSynthesis.speak(m)
}
spookysay('I know what you did last summer!')
@gnarmis
gnarmis / gist:0d08ad5603014efea52f
Last active August 29, 2015 14:02
Swift on the Command Line
So, this is where swift lives, after you've installed XCode 6 Beta:
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
Also, there's a directory named swift which has various libraries:
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
To start playing in a terminal:
@gnarmis
gnarmis / git-recent-branches
Last active August 29, 2015 14:01
List Git Branches by Recency
#!/bin/bash
#
# Blame @gnarmis if this doesn't work
#
# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it
# and you'll be able to do `git recent-branches`.
#
# Show top 5 most recent branches:
# $ git recent-branches | head -n 5
#
@gnarmis
gnarmis / .emacs.minimal
Last active August 29, 2015 14:01
Minimal Emacs Config for Fast Startup
; Want a fast emacs startup? Copy this to ~/.emacs.minimal and:
;
; cp ~/.emacs ~/.emacs.bak
; echo "(load-file \"/absolute/path/to/.emacs.minimal\")" > ~/.emacs
;
; Switch it back if you don't like it.
;
;; cutoff for word wrap
(setq-default fill-column 79)

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Homebrew

First you'll need to install the [Homebrew package manager][brew] if yo haven't already. It is amazing.