Skip to content

Instantly share code, notes, and snippets.

@clausasbjorn
clausasbjorn / Duplicates.fs
Created August 24, 2015 11:52
Find duplicate files in folder
open System
open System.IO
// Structure to keep track of names for identical files
type Identical = {
Files: seq<string>
}
// Traverse and find all file paths and sizes
let rec getAllFiles minLength (root : DirectoryInfo) =
@clausasbjorn
clausasbjorn / agenda.json
Last active August 29, 2015 14:22
NDC 2015 Agenda
{
"name":"NDC Oslo 2015",
"days":[
{
"order":"0",
"name":"Wednesday",
"slots":[
{
"id":"09:00-10:00",
"from":"09:00",
@clausasbjorn
clausasbjorn / gist:12bca904d49c5f4edb00
Created September 30, 2014 19:44
Randomizes background color for all elements with background color.
(function() {
var diff = 50; // max difference (% of 0-255)
$('*').each(function() {
var o = $(this);
var rgb = o.css('background-color');
if (rgb.indexOf('rgb') == -1) return;
var adjusted = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/).map(function(c) {
var t = parseInt(c) + (((Math.random() * 2) - 1) * (255 * (diff / 100)));
if (t < 0) t = 0;
if (t > 255) t = 255;