Skip to content

Instantly share code, notes, and snippets.

View edenworky's full-sized avatar

Lēctia Landau edenworky

View GitHub Profile
@edenworky
edenworky / pend
Created August 5, 2021 12:12
Runs whatever command it receives every time enter is pressed until interrupted.
#!/usr/bin/env ruby
cmd = ARGV.join ' '
while true
system cmd
$stdin.gets
end
@edenworky
edenworky / machine.js
Last active January 23, 2020 14:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@edenworky
edenworky / machine.js
Last active January 21, 2020 12:11
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@edenworky
edenworky / next-image.js
Last active June 3, 2017 19:08
Go to next image
window.location = makeBumpedUrl();
function makeBumpedUrl() {
const imageNumber = getImageNumberInUrl();
const newImageNumber = bumpTrailingNumber(imageNumber);
return window.location.href.replace(imageNumber, newImageNumber);
}
function getImagePathInUrl() {
const urlComponents = window.location.href.split("/");