Skip to content

Instantly share code, notes, and snippets.

@mdmarek
mdmarek / YouTubeMusic
Last active October 29, 2023 18:06
Links to music on YouTube
Classic
https://www.youtube.com/watch?v=xtLoaMfinbU Tchaikovsky, The Nutcracker
https://www.youtube.com/watch?v=7w7vIQe4HU0 Ravel, Piano Concerto for the Left Hand
https://www.youtube.com/watch?v=T5oVgqIbOqw Ravel, Ma mère l'oye
https://www.youtube.com/watch?v=ydKwY0tqAXQ Beethoven, Sonata Claro de Luna
https://www.youtube.com/watch?v=t3217H8JppI Beethoven, Symphony No. 9
https://www.youtube.com/watch?v=arMu4f8rnBk Beethoven, Moonlight Sonata
https://www.youtube.com/watch?v=CMc00D8J7i4 Beethoven, Para Elisa
https://www.youtube.com/watch?v=eqksy-991sI Georg Friedrich Handel, Concerti Grossi Op 6
https://www.youtube.com/watch?v=DxtAHpYIXdU Dvořák, String Quartet No. 12 in F major, Op. 96 American
@mdmarek
mdmarek / PDFs
Last active January 22, 2018 16:11
Links to Papers in Comp Sci, Bio Sci, etc
Comp Sci (Leslie Lamport)
http://research.microsoft.com/en-us/um/people/lamport/pubs/state-machine.pdf
Comp Sci (Stats & ML)
http://jmlr.org/papers/volume9/vandermaaten08a/vandermaaten08a.pdf
http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf
https://arxiv.org/pdf/1611.07004.pdf
https://arxiv.org/pdf/1703.01619.pdf
https://cdn1.sph.harvard.edu/wp-content/uploads/sites/1268/2017/03/hernanrobins_v1.10.32.pdf
https://cdn1.sph.harvard.edu/wp-content/uploads/sites/1268/2017/03/hernanrobins_v2.17.17.pdf
@mdmarek
mdmarek / service-checklist.md
Created September 15, 2016 20:34 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@mdmarek
mdmarek / fileatomic.go
Created October 13, 2015 01:08
Write a file atomically under Linux.
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Write file to temp and atomically move when everything else succeeds.
func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error {
dir, name := path.Split(filename)
f, err := ioutil.TempFile(dir, name)
if err != nil {
return err
@mdmarek
mdmarek / multiparam.go
Last active August 29, 2015 14:08
Vertex shader that passes color information to fragment shader.
package main
import (
"fmt"
"runtime"
"github.com/go-gl/gl"
glfw "github.com/go-gl/glfw3"
)
@mdmarek
mdmarek / twotriangles.go
Last active August 29, 2015 14:08
Modern OpenGL to draw using multiple Vertex Attribute Objects.
// Copyright 2014 The go-gl Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"runtime"
@mdmarek
mdmarek / check-user-limits.sh
Created November 19, 2013 20:46
Find the nofile limit for a user, which may or may not have a valid user shell
#!/bin/bash
USR=$1
su $USR --shell /bin/bash --comman "ulimit -n"

Set values in:

/etc/security/limits.conf

Needs to be enabled in:

/etc/pam.d/common-session
/etc/pam.d/common-session-noninteractive

by adding:

@mdmarek
mdmarek / example-cut.sh
Created September 21, 2013 22:26
How to use the cut command
# Use white space as delimiter and return the 1st
# field and all fields including and after the
# 7th field.
cut -d' ' -f1,7-
@mdmarek
mdmarek / WaiApp4.hs
Created May 21, 2012 02:09
Wai+Warp file server with routes. Used GHC 7.4, Wai 1.1, Warp 1.1 versions.
{-# LANGUAGE OverloadedStrings #-}
-- | Wai+Warp file server with routes. Used GHC 7.4, Wai 1.1, Warp 1.1 versions.
module Main where
import Network.HTTP.Types (status200)
import Network.Wai (Application,responseLBS)
import Network.Wai.Middleware.Router (router,dir)
import Network.Wai.Handler.Warp (run)
import Network.Wai.Application.Static