Skip to content

Instantly share code, notes, and snippets.

View daluu's full-sized avatar

David Luu daluu

View GitHub Profile
@daluu
daluu / QEMU_ON_M1.md
Created May 5, 2022 05:34 — forked from citruz/QEMU_ON_M1.md
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6

@daluu
daluu / go_get_private_repos.txt
Last active March 26, 2023 08:51 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
```bash
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
```
@daluu
daluu / d3.legend.js
Last active March 10, 2020 20:58 — forked from bunkat/index.html
Sample trendline and linear, polynomial, exponential, logarithmic, and power regression analysis using regression.js
// d3.legend.js
// (C) 2012 ziggy.jonsson.nyc@gmail.com
// MIT licence
(function() {
d3.legend = function(g) {
g.each(function() {
var g= d3.select(this),
items = {},
svg = d3.select(g.property("nearestViewportElement")),
@daluu
daluu / some_probability_distributions_graphing_with_d3.js
Last active February 4, 2021 21:28 — forked from paul-english/gist:4752760
Some work graphing a few probability distributions using d3.js
var probability = {
normal: function(x, mean, stddev) {
var y = (1 / (stddev * Math.sqrt(2 * Math.PI))) * Math.pow(Math.E, - (Math.pow(x - mean, 2) / (2 * Math.pow(stddev, 2))));
//console.log('normal', x, mean, stddev, y);
return y;
},
logNormal: function(x, mean, stddev) {
var y = (1 / (x * Math.sqrt(2 * Math.PI * Math.pow(stddev, 2)))) * Math.pow(Math.E, - (Math.pow(Math.log(x) - mean, 2) / (2 * Math.pow(stddev, 2))));
//console.log('logNormal', x, mean, stddev, y);
y = isFinite(y) ? y : 0;
@daluu
daluu / index.html
Last active January 31, 2016 23:19 — forked from jltran/index.html
Histogram Overlaid with CDF line to replicate Excel functionality
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
shape-rendering: crispEdges;
}
@daluu
daluu / JSONView Dark Theme.css
Created October 9, 2015 23:21 — forked from timnew/JSONView Dark Theme.css
This is a dark theme for JSONView chrome extension
body {
white-space: pre;
font-family: consolas;
color: white;
background: black;
}
.property {
color: orange;
font-weight: bold;