Skip to content

Instantly share code, notes, and snippets.

View mariussoutier's full-sized avatar

Marius Soutier mariussoutier

View GitHub Profile
#!/usr/bin/env bash
# This script require root privileges
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
# Parse ARGS
POSITIONAL=()
@tomwwright
tomwwright / gist:f88e2ddb344cf99f299935e1312da880
Last active November 22, 2022 14:06
Dell XPS 15 9560: Ubuntu 17.10 + Nvidia 384.90 + Nvidia Prime (No Bumblebee) https://medium.com/@tomwwright/better-battery-life-on-ubuntu-17-10-4588b7f72def
# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@larsrh
larsrh / Scratch.thy
Created September 24, 2015 08:21
Scala World 2015
theory Scratch
imports Main
begin
fun insert :: "'a::linorder ⇒ 'a list ⇒ 'a list" where
"insert x [] = [x]" |
"insert x (y # ys) = (if x ≤ y then x # y # ys else y # insert x ys)"
inductive sorted :: "'a::linorder list ⇒ bool" where
empty: "sorted []" |
@baraldilorenzo
baraldilorenzo / readme.md
Last active June 13, 2024 03:07
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@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.

@luebken
luebken / docker-intro-script.md
Created June 2, 2015 09:28
Docker Intro Script

Prepartion:

docker pull docker pull giantswarm/helloworld
docker pull busybox:ubuntu-14.04
docker pull busybox
docker pull ghost
git clone https://github.com/giantswarm/giantswarm-firstapp-nodejs && make
git clone https://github.com/giantswarm/helloworld
@sgodbillon
sgodbillon / listdatabase.scala
Created April 16, 2014 08:06
List Database command example (ReactiveMongo)
import reactivemongo.core.commands._
import reactivemongo.bson._
import reactivemongo.bson.DefaultBSONHandlers._
import reactivemongo.bson.BSONInteger
import reactivemongo.bson.BSONString
import scala.Some
// { listDatabases: 1 }
/*
listDatabases returns a document for each database
@ccsevers
ccsevers / AvroUnpackedSourceTest.scala
Last active August 29, 2015 13:57
UnpackedAvroSource passing test
class AvroUnpackedSourceTest extends Specification with ScalaCheck {
"Running M/R jobs on Avro data" should {
"work for unpacked sources" in {
val prop = Prop.forAll(MyAvroRecordGenerators.myAvroGen) { (record: MyAvroRecord) =>
var res: Double = 0.0
val tempFolder = new File(System.getProperty("java.io.tmpdir"))
val tempInput = new File(tempFolder, "input")
tempInput.mkdirs
// kills long running ops in MongoDB (taking seconds as an arg to define "long")
// attempts to be a bit safer than killing all by excluding replication related operations
// and only targeting queries as opposed to commands etc.
killLongRunningOps = function(maxSecsRunning) {
currOp = db.currentOp();
for (oper in currOp.inprog) {
op = currOp.inprog[oper-0];
if (op.secs_running > maxSecsRunning && op.op == "query" && !op.ns.startsWith("local")) {
print("Killing opId: " + op.opid