Skip to content

Instantly share code, notes, and snippets.

View astro's full-sized avatar

Astro astro

View GitHub Profile
@astro
astro / flake.lock
Created October 29, 2023 01:04
microvm.nix CHV + tap example
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
@astro
astro / flash-arduboy.sh
Created February 19, 2017 23:22
Flash .hex on Arduboy
PORT=/dev/ttyACM1
HEX=hollow_v0.31.hex
ard-reset-arduino --caterina $PORT --verbose
avrdude -P /dev/ttyACM1 -p atmega32u4 -c avr109 -b 57600 -D -Uflash:w:$HEX:i
@astro
astro / keybase.md
Created October 12, 2014 00:11
keybase.md

Keybase proof

I hereby claim:

  • I am astro on github.
  • I am astro (https://keybase.io/astro) on keybase.
  • I have a public key whose fingerprint is A5EE 826D 645D BE35 F9B0 9933 5851 2AE8 7A69 900F

To claim this, I am signing this object:

@astro
astro / scrape.js
Last active August 29, 2015 14:05
// npm i crawler && node scrape.js && less scraped.json
var fs = require('fs');
var resolve = require('url').resolve;
var Crawler = require("crawler").Crawler;
function trim(s) {
return s.replace(/^\s+/gm, "").replace(/\s+$/gm, "");
}
<canvas id="myCanvas" width="400" height="300" style="border:1px solid #000000;"> </canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var width = c.width / 6;
var height = c.height / 4;
var o = 0;
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
@-webkit-keyframes fader {
/*from {
background-color: rgb(255, 0, 0);
}
25% {
background-color: rgb(255, 255, 0);;
var width = window.innerWidth,
height = window.innerHeight;
var force = d3.layout.force()
.charge(-120)
.size([width, height]);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
@astro
astro / hlsdump.js
Created September 5, 2013 15:45
Reliably record an HTTP Live Stream with node.js
var fs = require('fs');
var request = require('request');
var joinUrl = require('url').resolve;
if (process.argv.length != 3) {
console.log("Please pass playlist URL");
process.exit(1);
}
var plsUrl = process.argv[2];
var INTERVAL = 5 * 1000;
{-# LANGUAGE OverloadedStrings, RankNTypes #-}
module Main where
import Data.Conduit
import Data.Conduit.Binary
import qualified Data.Conduit.List as CL
import Data.XML.Types
import Text.XML.Stream.Parse
import System.IO
import qualified Data.Text as T
@astro
astro / zmqchat.hs
Last active December 16, 2015 12:28
Winning the 0MQ book at #RealtimeConfEu
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad
import System.IO
import System.ZMQ3.Monadic
import qualified Data.ByteString.Char8 as CS
import Control.Concurrent (forkIO)
main :: IO ()