Skip to content

Instantly share code, notes, and snippets.

View chromy's full-sized avatar
👩‍🎤

Hector Dearman chromy

👩‍🎤
View GitHub Profile
@chromy
chromy / update_avatar.sh
Created June 25, 2013 17:32
A bash scrip to get your Gravatar and save it as an image and a favicon.
#!/bin/bash
# This script downloads a gravatar image associated with EMAIL and saves it at
# AVATAR_OUTPUT_PATH then creates a favicon icon and saves it at
# FAVICON_OUTPUT_PATH.
EMAIL="hector.dearman@gmail.com"
AVATAR_OUTPUT_PATH="static/img/avatar.png"
FAVICON_OUTPUT_PATH="static/favicon.ico"
import {wgsl, linkBundle, bindBundle, extractBindings, bundleToAttributes} from "@use-gpu/shader/wgsl";
const bundle = bindBundle(wgsl`
struct VertexOut {
@builtin(position) position : vec4f,
@location(0) color : vec4f
}
struct Uniforms {
modelViewProjectionMatrix : mat4x4<f32>,
<html>
<head>
</head>
<body>
<script>
function openTrace(arrayBuffer, title) {
const PERFETTO_ORIGIN = "https://ui.perfetto.dev";
config("abseil_config") {
include_dirs = [ "." ]
configs = [ ":public_suppress_warnings_config" ]
}
config("public_suppress_warnings_config") {
cflags = [ "-Wno-deprecated-builtins" ]
}
config("suppress_warnings_config") {
<!doctype html>
<html lang="en-us">
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<body>
<style>
pre {
border: 1px solid #eee;
margin: 10px 0;
font-family: monospace;
@chromy
chromy / generators_in_lua.lua
Last active November 13, 2020 08:40
Python yield syntax in Lua by abusing coroutines.
function make_iter(f)
return function(...)
local args = ...
local co = coroutine.create(f)
return function()
if coroutine.status(co) == "dead" then
return nil
end
_, result = coroutine.resume(co, args)
return result
@chromy
chromy / micro_test_framework.js
Created June 27, 2013 22:04
A tiny Javascript test framework.
function AssertionError(message) {
this.name = "AssertionError";
this.message = message || "Assertion Error";
}
AssertionError.prototype = new Error();
AssertionError.prototype.constructor = AssertionError;
function Tests() {
this.tests = [];
}
@chromy
chromy / .block
Created October 10, 2019 16:28 — forked from heybignick/.block
D3.js v4 Force Directed Graph with Labels
license: gpl-3.0
height: 600

Click to drag nodes. Dashed links are resolved suits; green links are licensing.

Thomson Reuters published a rather abysmal infographic showing the "bowl of spaghetti" that is current flurry of patent-related suits in the mobile communications industry. So, inspired by a comment by John Firebaugh, I remade the visualization to better convey the network. That company in the center? Yeah, it's the world's largest, so little wonder it has the most incoming suits.

Implemented in D3.js.

@chromy
chromy / HeapDumpViewer-TimelineRawData-20170125T203028
Created January 25, 2017 20:39
Timeline of heap dump viewer initial render
This file has been truncated, but you can view the full file.
[{"pid":79498,"tid":1295,"ts":216941129400,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc","src_func":"PushOntoImmediateIncomingQueueLocked"},"dur":71,"tdur":60,"tts":1096954},
{"pid":79498,"tid":1295,"ts":216941129427,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":14,"tdur":11,"tts":1096974},
{"pid":79498,"tid":1295,"ts":216941129447,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":8,"tdur":5,"tts":1096994},
{"pid":79498,"tid":1295,"ts":216941129457,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":8,"tdur":4,"tts":1097004},
{"pid":79498,"tid":17463,"ts":216941