Skip to content

Instantly share code, notes, and snippets.

View torbjornvatn's full-sized avatar
🤷‍♂️

Torbjørn Vatn torbjornvatn

🤷‍♂️
View GitHub Profile
@cb372
cb372 / jargon.md
Last active May 14, 2024 03:45
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@rvanbruggen
rvanbruggen / importtaxonomy.cql
Last active March 10, 2025 21:20
Google Product Taxonomy
//Import Google Product Taxonomy
//WITH IDENTIFIERS
//downloaded from https://support.google.com/merchants/answer/1705911
create index on :Cat1(name);
create index on :Cat2(name);
create index on :Cat3(name);
create index on :Cat4(name);
create index on :Cat5(name);
create index on :Cat6(name);
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@john2x
john2x / 00_destructuring.md
Last active February 20, 2025 05:30
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@ibdknox
ibdknox / behaviors.cljs
Created October 21, 2013 20:24
My behaviors file
{:+ {:app [(:lt.objs.style/set-skin "dark")
(:lt.objs.app/run-on-init :window.fullscreen)
(:lt.plugins.vim/map-keys {"-" "$",
"0" "^",
"<BS>" "<PageUp>",
"<Space>" "<PageDown>",
"j" "gj",
"k" "gk"})
(:lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|_site/|_cache/|__pycache__")
:lt.objs.intro/show-new-file
@jbenet
jbenet / simple-git-branching-model.md
Last active March 19, 2025 16:09
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@torbjornvatn
torbjornvatn / Solution.scala
Last active December 21, 2015 15:09
Possible solution to the InterestRateTermValueToFinancingTerm problem
package com.typesafe.slick.examples.lifted
// Use H2Driver to connect to an H2 database
import scala.slick.driver.H2Driver.simple._
// Use the implicit threadLocalSession
import Database.threadLocalSession
/**
* A simple example that uses statically typed queries against an in-memory
@willjohnson
willjohnson / README.md
Last active April 26, 2022 19:32
Server Status Widget for Dashing

Description

A Dashing widget that checks whether a server is responding to either an http or ping request. It displays either a check or alert depending on the response.

Usage

@gre
gre / deploy.sh
Last active October 8, 2021 00:33
Super-small scripts for easy PlayFramework deployment
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
rsync -va target/ $REMOTE:$REMOTE_APP/target;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
@ChickenProp
ChickenProp / gist:3037292
Created July 3, 2012 03:08
Connecting my Raspberry Pi to the internet via my laptop

After installing Arch on my Raspberry Pi, internet worked out of the box: I could plug it into the router, turn it on, ssh in and start downloading things. But the router is in my housemate's bedroom, which isn't ideal. If I want the Pi to be connected to the internet in my room, I need it to be connected to my laptop. (Another option would be a USB wifi dongle, of course.) This is how I did it. Much credit goes to the Ubuntu wiki's Connection sharing page.

I should disclaim that I don't fully understand networking stuff, and some of what I say might be wrong. I also didn't write this as I was going; so while I've consulted my browser and shell histories, it's possible I've forgotten some steps.

My laptop is running Gentoo, and this is where most of the work has to be done. It connects to the internet through wifi, on interface wlan0. The ethernet port is eth0, and eth0 is also the name of the ethernet port on the Pi.

Step zero: plug ev