Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@codeincontext
codeincontext / itunes-podcast-categories.yml
Created February 7, 2011 12:50
A list of the current iTunes podcast categories - in YAML format
- Arts:
- Design
- Fashion & Beauty
- Food
- Literature
- Performing Arts
- Spoken Word
- Visual Arts
- Business:
- Business News
@codeincontext
codeincontext / Change filament gcode 0.2 nozzle
Last active November 6, 2023 12:09
Faster bambu lab filament change gcode
M620 S[next_extruder]A
M204 S9000 ; set printing and travel acceleration to 9000mm/min^2
{if toolchange_count > 1 && (z_hop_types[current_extruder] == 0 || z_hop_types[current_extruder] == 3)}
G17 ; select xy plane
G2 Z{z_after_toolchange + 0.4} I0.86 J0.86 P1 F10000 ; spiral lift a little from second lift
{endif}
G1 Z{max_layer_z + 3.0} F1200 ; raise the nozzle 3mm above what has already been printed ** only requiered when printing by object ?! otherwise going + 0.5mm should be enought
M106 P1 S0 ; turn part cooling fan off
M106 P2 S0 ; turn Aux fan off
@codeincontext
codeincontext / gist:1285806
Last active January 25, 2023 17:05
Javascript function to show how long ago a timestamp was as a pretty string
function timeAgo(time){
var units = [
{ name: "second", limit: 60, in_seconds: 1 },
{ name: "minute", limit: 3600, in_seconds: 60 },
{ name: "hour", limit: 86400, in_seconds: 3600 },
{ name: "day", limit: 604800, in_seconds: 86400 },
{ name: "week", limit: 2629743, in_seconds: 604800 },
{ name: "month", limit: 31556926, in_seconds: 2629743 },
{ name: "year", limit: null, in_seconds: 31556926 }
];
@codeincontext
codeincontext / machine.js
Created November 9, 2020 11:27
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@codeincontext
codeincontext / machine.js
Created November 9, 2020 11:24
Generated by XState Viz: https://xstate.js.org/viz
const addressMachine = Machine(
{
id: "address",
initial: "init",
states: {
init: {
on: {
"": [
{ target: "edit", cond: "alreadyHasValues" },
{ target: "search" },

Kindle Son Status Board

An e-ink status board so my mum knows what's up

Stack

Node:

const machine = Machine(
{
id: "wizard",
initial: "nameEntry",
context: { values: {} },
meta: { version: 1 },
states: {
nameEntry: {
on: {
const machine = Machine(
{
id: "wizard",
initial: "nameEntry",
context: { values: {} },
meta: { version: 2 },
states: {
nameEntry: {
on: {
const machine = Machine(
{
id: "wizard",
initial: "nameEntry",
context: { values: {} },
states: {
nameEntry: {
on: {
NEXT: {
@codeincontext
codeincontext / machine.js
Last active June 19, 2020 11:57
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions