Skip to content

Instantly share code, notes, and snippets.

@wcauchois
wcauchois / spec.json
Created September 19, 2023 00:17
Vega-Lite spec from Mon Sep 18 2023
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A scatterplot showing body mass and flipper lengths of penguins.",
"data": {
"values": [
{"duration": 574, "file": "tmp/batch-100.json"},
{"duration": 351, "file": "tmp/batch-100.json"},
{"duration": 355, "file": "tmp/batch-100.json"},
{"duration": 567, "file": "tmp/batch-100.json"},
{"duration": 470, "file": "tmp/batch-100.json"},
@wcauchois
wcauchois / spec.json
Last active September 19, 2023 00:16
Vega-Lite spec from Tue Sep 05 2023
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A scatterplot showing body mass and flipper lengths of penguins.",
"data": {
"values": [
{"duration":574,"file":"tmp/batch-100.json"},{"duration":351,"file":"tmp/batch-100.json"},{"duration":355,"file":"tmp/batch-100.json"},{"duration":567,"file":"tmp/batch-100.json"},{"duration":470,"file":"tmp/batch-100.json"},{"duration":653,"file":"tmp/batch-100.json"},{"duration":549,"file":"tmp/batch-100.json"},{"duration":577,"file":"tmp/batch-100.json"},{"duration":447,"file":"tmp/batch-100.json"},{"duration":408,"file":"tmp/batch-100.json"},{"duration":590,"file":"tmp/batch-100.json"},{"duration":745,"file":"tmp/batch-100.json"},{"duration":530,"file":"tmp/batch-100.json"},{"duration":596,"file":"tmp/batch-100.json"},{"duration":497,"file":"tmp/batch-100.json"},{"duration":813,"file":"tmp/batch-100.json"},{"duration":457,"file":"tmp/batch-100.json"},{"duration":557,"file":"tmp/batch-100.json"},{"duration":675,"file":"tmp/batch-
@wcauchois
wcauchois / machine.js
Created November 19, 2020 15:55
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'module-net-machine',
on: {
"BLE_CONNECT": [{ actions: [], target: "#ble-connection", },
],
},
initial: 'no-connection',
states: {
"no-connection": {
id: "no-connection",

t is a small wrapper around tmux. Its usage is as follows.

  • t list: List available tmux sessions (equiv to tmux list-sessions).
  • t new NAME: Create a new session with the specified name (equiv to tmux new-session -s NAME).
  • t NAME: Attach to the named session (equiv to tmux attach -t NAME); t attach NAME also works.
  • t (no arguments): Runs tmux attach || tmux which will either attach to the last session or start a new tmux instance.
#!/bin/bash
for f in *.flac; do
avconv -i "$f" -qscale:a 0 "${f[@]/%flac/mp3}"
done
module Main where
import Core
import Endpoint
import FoursquareEndpoint
import FoursquareModel
import GeocoderEndpoint
import GeocoderModel
targetAddress = "568 Broadway, New York, NY"
-- | Main entry point to the application.
module Main where
import Core
import Endpoint
import FoursquareEndpoint
import FoursquareModel
import GeocoderEndpoint
import GeocoderModel
(GeocodeResponse latLng) <- (callJsonEndpoint $ GeocodeEndpoint targetAddress False :: IO GeocodeResponse)
let venuesTrendingEndpoint = VenuesTrendingEndpoint latLng Nothing Nothing `authorizeWith` creds
(VenuesTrendingResponse venues) <- (callJsonEndpoint venuesTrendingEndpoint :: IO VenuesTrendingResponse)
let printVenue v = putStrLn $ "- " ++ name v
mapM_ printVenue venues
import sbt._
import Keys._
import com.github.retronym.SbtOneJar._
object BuildBroBuild extends Build {
val install = TaskKey[Unit]("install", "Installs the JAR and a launcher script into your homedir")
private def installTask = task {
println("Hello world!")
}
Network/HTTP/Server.hs:127:7:
Couldn't match expected type `IO b'
against inferred type `Socket -> b1'
In a stmt of a 'do' expression: conn <- socketConnection name sock
In the expression:
do { let name = ppSockAddr addr "";
logInfo lg 0 ("Accepted connection from " ++ name);
conn <- socketConnection name sock;
setStreamHooks
conn