Skip to content

Instantly share code, notes, and snippets.

Gursimran Singh gnarmis

Block or report user

Report or block gnarmis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gnarmis
gnarmis / racket_quick_intro.rkt
Created Jan 2, 2019
A playful introduction to Racket (<60 min activity), with example usage of quickcheck (property based testing)
View racket_quick_intro.rkt
;; 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 Apr 24, 2018
NEPO program: sensor_loop
View sensor_loop.xml
<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 Apr 24, 2018
NEPO program: simple_loop
View simple_loop.xml
<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 Apr 2, 2018
copy of https://deb.nodesource.com/setup_8.x, but without the atrocious ssl cert related error preventing secure `curl`s
View nodesource_setup_8
#!/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 Apr 5, 2017
my sublime text user settings
View Preferences.sublime-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,
View spooky_say.js
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 Aug 29, 2015
Swift on the Command Line
View gist:0d08ad5603014efea52f
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 Aug 29, 2015
List Git Branches by Recency
View git-recent-branches
#!/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 Aug 29, 2015
Minimal Emacs Config for Fast Startup
View .emacs.minimal
; 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)
View Emacs.md

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.

You can’t perform that action at this time.