Skip to content

Instantly share code, notes, and snippets.

@alexedwards
alexedwards / Makefile
Created May 2, 2023 16:04
Makefile targets for working with sqlite
## db/connect: create to the local database
.PHONY: db/connect
db/connect:
sqlite3 db.sqlite
## db/migrations/new name=$1: create a new migration
.PHONY: db/migrations/new
db/migrations/new:
go run -tags 'sqlite3' github.com/golang-migrate/migrate/v4/cmd/migrate@latest create -seq -ext=.sql -dir=./resources/migrations ${name}
@nevillepark
nevillepark / README.md
Last active March 28, 2024 14:11
CBC radio stream URLs

CBC Radio Stream URLs

Using these URLs, you can listen to CBC radio streams with applications like VLC or Transistor. The files are M3U playlists, so you can use them as-is, edit them to suit your tastes, or use individual URLs.

This playlist contains the .m3u8 URLs from the CBC Listen website, which uses the HLS (HTTP Live Streaming) protocol. The audio stream is broken up into multiple tiny files, which are then fed into the .m3u8 playlist file that delivers them to your computer in the right order. This should work with modern media players.

This legacy playlist uses good old-fashioned MP3 streams found on PublicRadioFan.com. It will work with older programs like Winamp that don't support HLS. I don't know how lo

@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@zingaburga
zingaburga / sve2.md
Last active March 28, 2024 14:08
ARM’s Scalable Vector Extensions: A Critical Look at SVE2 For Integer Workloads

ARM’s Scalable Vector Extensions: A Critical Look at SVE2 For Integer Workloads

Scalable Vector Extensions (SVE) is ARM’s latest SIMD extension to their instruction set, which was announced back in 2016. A follow-up SVE2 extension was announced in 2019, designed to incorporate all functionality from ARM’s current primary SIMD extension, NEON (aka ASIMD).

Despite being announced 5 years ago, there is currently no generally available CPU which supports any form of SVE (which excludes the [Fugaku supercomputer](https://www.fujitsu.com/global/about/innovation/

@ShabbirHasan1
ShabbirHasan1 / LowLatencyLogging.md
Last active March 28, 2024 14:07
Low Latency Logging

Low latency logging 🙋 seeking help & advice How would you design a logging system for a low latency application to not have much impact on the latency? One thing comes to my mind is, not doing any formatting on the hot path and send raw data through a channel to another thread. In that thread, format the log appropriately and use tracing, tracing-subscriber, tracing-appender to log to a file. Is there any other suggested approaches or crates for that kind of problem? Thanks in advance.

Response By u/matthieum:

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 14:09
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@nebriv
nebriv / DDM2.0.md
Last active March 28, 2024 14:06
Dell Display Manager 2.0 command line documentation

Dell Display Manager 2.0 Command Line

Decompiled DLL with ILSpy to identify various commands.

Most commands can be found in DDM2._0_UX.CmdBackground.cmdService_DoWork

Write commands can be prefixed with int:command to specify which monitor to send the command to.

.\DDM.exe /0:writebrightnesslevel 50

@moods445
moods445 / application.properties
Created April 2, 2019 09:57
spring boot rabbitmq configurations #Java
# RABBIT (RabbitProperties) https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html#common-application-properties
spring.rabbitmq.addresses= # Comma-separated list of addresses to which the client should connect.
spring.rabbitmq.cache.channel.checkout-timeout= # Duration to wait to obtain a channel if the cache size has been reached.
spring.rabbitmq.cache.channel.size= # Number of channels to retain in the cache.
spring.rabbitmq.cache.connection.mode=channel # Connection factory cache mode.
spring.rabbitmq.cache.connection.size= # Number of connections to cache.
spring.rabbitmq.connection-timeout= # Connection timeout. Set it to zero to wait forever.
spring.rabbitmq.dynamic=true # Whether to create an AmqpAdmin bean.
spring.rabbitmq.host=localhost # RabbitMQ host.
spring.rabbitmq.listener.direct.acknowledge-mode= # Acknowledge mode of container.
@SheepTester
SheepTester / explainer.md
Created May 4, 2020 19:35
Change speed of Edpuzzle video

Edpuzzle aggressively reverts the playbackRate of a <video> element, so you can't simply change it to increase the speed. Thus, a more aggressive response is necessary to combat it.

Firstly, we get the <video> element:

video = document.querySelector('video')

Then, we get the setter function for the playbackRate property using Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'playbackRate').set. It is called with the <video> element as this and with speed as the new value. This way, the <video> element is properly notified of the speed change by simulating assigning a value to playBackRate directly (ie using =).