Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Stephen Solka trashhalo

:shipit:
View GitHub Profile
@trashhalo
trashhalo / Component.py
Last active Sep 19, 2021
Python plotting demo in astro
View Component.py
#!/usr/bin/env python
import sys
import matplotlib.pyplot as plt
import numpy as np
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
@trashhalo
trashhalo / serverlist.json
Created Jan 5, 2021
servers supported by fediverse.0qz.fun
View serverlist.json
[
{
"type": "mastodon",
"name": "101010.pl"
},
{
"type": "mastodon",
"name": "aana.site"
},
{
@trashhalo
trashhalo / comma.patch
Created Dec 1, 2020
csv-to-parquet commas
View comma.patch
diff --git a/main.go b/main.go
index 2d4ec9e..e7ea896 100644
--- a/main.go
+++ b/main.go
@@ -101,7 +101,7 @@ func run(c *cli.Context) error {
return err
}
csvReader := csv.NewReader(f)
- csvReader.Comma = '\t'
+ csvReader.Comma = ','
View main.go
package main
import (
"bufio"
"errors"
"fmt"
"image"
"net/http"
"os"
View replication.go
package main
func exec(query string, args string) (string, error) {
return "", nil
}
func requireNil(err error) {
}
// in vim to trigger the issue: set synmaxcol=80
View keybase.md

Keybase proof

I hereby claim:

  • I am trashhalo on github.
  • I am trashhalo (https://keybase.io/trashhalo) on keybase.
  • I have a public key ASAiltIMXIBB6Ig-KmeWTQ2FY0VDN2bmGU3AqkBuzpih4Ao

To claim this, I am signing this object:

View listNth.js
(function() {
var jb = ["Out_of_memory", 0],
$a = ["Sys_error", -1],
Q = ["Failure", -2],
$ = ["Invalid_argument", -3],
Ea = ["End_of_file", -4],
Y = ["Division_by_zero", -5],
V = ["Not_found", -6],
Fa = ["Match_failure", -7],
Pa = ["Stack_overflow", -8],
@trashhalo
trashhalo / node
Created Jul 8, 2018
Webassembly Vs Node
View node
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
View ipfs.js
import IPFS from 'ipfs';
import Promise from 'bluebird';
let ipfs;
const settings = {
repo: String(Math.random() + Date.now()),
IpfsDataDir: '/ipfs',
Addresses: {
API: '/ip4/127.0.0.1/tcp/0',
@trashhalo
trashhalo / index.js
Created Aug 31, 2017
node cache proxy
View index.js
'use strict';
require('perish');
var Redis = require('ioredis');
var redis = new Redis();
const http = require('http');
const httpProxy = require('http-proxy');
const streamToPromise = require('stream-to-promise');
const proxy = httpProxy.createProxyServer({
changeOrigin: true