Skip to content

Instantly share code, notes, and snippets.

View jroesch's full-sized avatar

Jared Roesch jroesch

View GitHub Profile
@puffnfresh
puffnfresh / extensions.el
Last active May 31, 2018 09:24
Proof General under spacemacs
(defvar coq-pre-extensions
'(
proof-general
))
(defun coq/init-proof-general ()
"Initialize Proof General"
(use-package proof-site
:defer t
:mode ("\\.v\\'" . coq-mode)
@lrytz
lrytz / z-automator.png
Last active October 15, 2024 06:31
Shortcut for Syntax Highlighting in Keynote
@jtopper
jtopper / gist:8588263
Last active August 24, 2024 07:28
Add a new disk to a VMWare vagrant box
config.vm.provider :vmware_fusion do |vm|
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'
dir = "#{ENV['HOME']}/vagrant-additional-disk"
unless File.directory?( dir )
Dir.mkdir dir
end

JDBC API for Scala

Data types required

Primitives

  • Option[A] (?)
  • SQLException / A (/)
  • InvariantNotMet / A (~)
  • SqlEffect[A] (!)
@amatus
amatus / rust_for_rpi.md
Last active February 18, 2017 21:13 — forked from anonymous/gist:6664882
Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

sudo apt-get install git build-essential
test `uname -m` = x86_64 && sudo apt-get install ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target-triples=arm-unknown-linux-gnueabihf

make

@milessabin
milessabin / gist:6081113
Last active December 20, 2015 05:49
Slicing and dicing tuples in shapeless 2.0.0-SNAPSHOT.
Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless._
import shapeless._
scala> import syntax.tuple._
import syntax.tuple._
@milessabin
milessabin / gist:5831007
Created June 21, 2013 13:03
Case class members with shapeless 2.0.0-SNAPSHOT.
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless._
import shapeless._
@mslinn
mslinn / scalacDiff
Last active December 17, 2015 20:09
Shows the changes in compiled code from scalac between versions
#!/bin/bash
if [ $# -lt 3 ]; then
echo "Shows the changes in compiled code from scalac between versions"
echo "Usage: $BASH_SOURCE v1 v2 classname"
echo " Where v1 and v2 are legal Scala compiler versions, such as 2.8.0, 2.9.0 and 2.10"
echo " ... and classname is fully qualified, such as com/blah/MyClass"
exit -1
fi
function input {
import Data.Foldable
import Data.Monoid
pipeline :: [a -> a] -> a -> a
pipeline = appEndo . getDual . foldMap (Dual . Endo)
main = print $ pipeline [(+1), (*10)] 100
@milessabin
milessabin / gist:4973961
Last active December 13, 2015 20:58
Lazy pattern matching in Scala made even lazier with scalaz's Need.
Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_05).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scalaz._
import scalaz._
scala> val (foo, bar, baz) = (Need({println("foo") ; "foo"}), Need({ println("bar") ; "bar"}), Need({ println("baz") ; "baz"}))
foo: scalaz.Need[java.lang.String] = scalaz.Need$$anon$4@1d90d034
bar: scalaz.Need[java.lang.String] = scalaz.Need$$anon$4@e551516