This is a simple way of having an in-memory DB which is safe to use across multiple goroutines without needing to use any kind of mutex for updates.
type FooDB interface {| #!/bin/bash | |
| #apt-get install html-xml-utils | |
| bridgeURL="http://howmanydayssincemontaguestreetbridgehasbeenhit.com" | |
| hookURL="http://example.com" | |
| days=$(echo "$bridgeURL" | \ | |
| wget -O- -i- 2>/dev/null | hxnormalize -x | hxselect -i '.day_box' \ | |
| | grep -o -E '[0-9+]') |
| 11300841 ['1775','10921','3583','5838','15519','1794'] | |
| 11300841 ['10761','9251','69928','78022','10459','5188','120504','120506','128530','94604'] | |
| 1345 ['10761','9251','69928','78022','10459','5188','120504','120506','128530','94604'] |
Mini Bus is a drastically simplified version of D-BUS, specifically for plain text communication between terminal UIs / shell scripts and terminal multiplexers.
Minibus daemon monitors /tmp/minibus for newly created UNIX Domain sockets (SOCK_STREAM) and connects to them based on their location:
| package main | |
| import ( | |
| "bufio" | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "os" |
| const reg = /\s*([^\s\{,]+(?:\s+[^\s\{,]+)*)|\s*\{[^\}]*\}/gm | |
| css = ` | |
| .car, div.train, #bus | |
| div.jetski:nth-child(4n)!important { | |
| display: none; | |
| } | |
| .banana , | |
| #fruit.ap_ple.pear { |
Bard is a commandline utility for running code tests in multiple languages using Markdown files as the source. Bard has two basic concepts:
At CampJS this week there were a lot of talks about frontend web components, mostly focused on views. It struck me, as a mostly backend engineer that we could do with some better abstractions around client side/server side data sync to go with the new view model systems out there. Here's a few thoughts I had over the weekend..
A client side, in memory data store:
Anvil is a golang lib and wrapper for database/sql that aims to provide:
Anvil isn't: