Skip to content

Instantly share code, notes, and snippets.

View mhkeller's full-sized avatar

Michael Keller mhkeller

View GitHub Profile
@mhkeller
mhkeller / package.json
Last active March 26, 2024 18:09
Convert a parquet file to bytes representing an arrow table
{
"name": "parquet-to-arrow",
"version": "1.0.0",
"description": "",
"scripts": {
},
"dependencies": {
"apache-arrow": "^15.0.2",
"arrow-js-ffi": "^0.4.1",
"parquet-wasm": "^0.6.0-beta.2"
const { Pool, Client } = require('pg');
const namespaceQuery = `SELECT nspname
FROM pg_namespace
WHERE oid = pg_my_temp_schema();`;
const fnQuery = `CREATE OR REPLACE FUNCTION pg_temp.increment(i integer)
RETURNS integer
LANGUAGE plpgsql
AS $function$
AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY
@mhkeller
mhkeller / README.md
Last active April 15, 2022 19:54
HTML, CSS and JavaScript tutorials

HTML, CSS and JavaScript tutorials

Here's a collection of guidebooks and tutorials that give the basics of HTML, CSS and JavaScript – three languages that form the basis for the modern web. The Mozilla links are documents that you can read through. The CodeCademy and other sites are interactive tutorials to get used to writing code.

For future projects, install Visual Studio Code, which is a handy text editor, useful for more than just web development (you can take interview notes in it, for example). Also, you'll want to install XCode on your mac, which you can access via the App Store on your computer. It's a big download (around 3gb) so it takes a while.

HTML - Creating elements and text (the structure of a page)

@mhkeller
mhkeller / inject-css.js
Last active December 6, 2021 04:57
Bookmarklet for injecting new css
javascript: (function() {
var newcss = `PUT NEW CSS HERE`;
var tag = document.createElement("style");
tag.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(tag);
tag[(typeof document.body.style.WebkitAppearance == "string") ? "innerText" : "innerHTML"] = newcss
})();
@mhkeller
mhkeller / group.js
Last active December 3, 2021 04:19
d3-array's group and groups functions
class InternMap extends Map {
constructor(entries, key = keyof) {
super();
Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
if (entries != null) for (const [key, value] of entries) this.set(key, value);
}
get(key) {
return super.get(intern_get(this, key));
}
has(key) {
@mhkeller
mhkeller / .block
Created February 24, 2021 05:04 — forked from syntagmatic/.block
d3-hierarchy tree
license: gpl-3.0
border: no
height: 500
/**
* Copyright 2017 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

#393939 #747369 #515151 #a09f93 #2d2d2d #d3d0c8 #74736930 #cc99cc #f2777a #6699cc