Skip to content

Instantly share code, notes, and snippets.

View wiredsister's full-sized avatar
🏠
Working from home

Gina wiredsister

🏠
Working from home
View GitHub Profile
open System.Collections.Generic
(* Helper Functions for Dicts *)
module Dict =
let toSeq d = d |> Seq.map (fun (KeyValue(k,v)) -> (k,v))
let toList (d:IDictionary<_,_>) = d |> toSeq |> Seq.toList
(*
Input: votes = ["ABC","ACB","ABC","ACB","ACB"]
@wiredsister
wiredsister / windbg clr
Created April 20, 2018 15:04 — forked from vchekan/windbg clr
Windbg for clr cheatsheet
### making a memory dump
adplus.exe -hang -iis -o c:\dumps
Symbol search path: srv*c:\symbols*http://msdl.microsoft.com/download/symbols
.loadby sos clr
!threads
!threadpool
~* e !clrstack ### show all clr stacks
.cls ### clear screen
@wiredsister
wiredsister / syslog_message.mli
Last active June 7, 2016 15:29
Syslog Interface per RFC 3164
(** Taken from https://github.com/verbosemode/syslog-message/blob/4bde2739d889d553559ab823a976ea2556c9aad9/src/syslog_message.mli **)
(** The type for Facilities *)
type facility =
Kernel_Message
| User_Level_Messages
| Mail_System
| System_Daemons
| Security_Authorization_Messages
| Messages_Generated_Internally_By_Syslogd
var len = function (list) {
var num = 0;
var getLen = function() {
var index = list[num];
var isNull = function (thing) {
if (thing == null) {
return true;
} return false;
}
if (isNull(index)) {
@wiredsister
wiredsister / us.json
Created January 18, 2014 16:45
Dummy US Shape data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wiredsister
wiredsister / dummy.tsv
Created January 18, 2014 16:44
example tsv lat long
0 1
-73.427242 40.871873
-73.996700 40.750000
-73.992363 40.740134
-87.525537 37.942482
-89.564576 44.501590
-118.819400 34.192900
-73.897400 42.774700
-101.886595 35.149460
-71.769200 42.249000
var margin = {top: 20, right: 20, bottom: 30, left: 50},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.time.scale()
.range([0, width]);
var y = d3.scale.linear()
.range([height, 0]);
@wiredsister
wiredsister / looping.js
Created November 14, 2013 21:30
This is for Jim!
//carousel header
(function(){
function fromScratch(){
function clearDots(){
$('.dots').each(function(){
$(this).removeClass('active-dot');
});
}
function clearSlides(){
$('.slides').each(function(){
@wiredsister
wiredsister / steamy.js
Created November 14, 2013 17:03
responsive steam graph made with d3 :)
//steam graph
(function(){
var n = 20, // number of layers
m = 200, // number of samples per layer
stack = d3.layout.stack().offset("wiggle"),
layers0 = stack(d3.range(n).map(function() { return bumpLayer(m); })),
layers1 = stack(d3.range(n).map(function() { return bumpLayer(m); }));
var width = 1280,
height = 450;
@wiredsister
wiredsister / new_g_unit.js
Created October 21, 2013 19:08
Why is this looking like:
// Compute the new tree layout.
var nodes = tree.nodes(root).reverse();
// Normalize for fixed-depth.
nodes.forEach(function(d) { d.y = d.depth * 180; });
// Update the nodes…
var node = vis.selectAll("g.node")
.data(nodes, function(d) { return d.id || (d.id = ++i); });