smolYAML is a minimal zero-dependency yaml parser. Well, subset-of-yaml parser.
name: Lea
import { XMLParser } from "fast-xml-parser"; | |
import fetch from "node-fetch"; | |
const RSS_URL = "https://jakelazaroff.com/rss.xml"; | |
const ACTIVITYPUB_HOST = "https://shine-thunder-forgery.glitch.me"; | |
const OUTBOX_URL = ACTIVITYPUB_HOST + "/test/outbox"; | |
const CREATE_URL = ACTIVITYPUB_HOST + "/admin/create"; | |
const ADMIN_USERNAME = "jake"; | |
const ADMIN_PASSWORD = "test"; |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
So there were a few threads going around recently about a challenge to write the longest sequence of keywords in Javascript:
There are, however, a few problems:
// Assume `dispatch` and `fetchFromNetwork` are defined elsewhere. | |
// ## 1. CPS With Nodebacks | |
// This is the old-school-style fetch. Mostly here for | |
// historical reasons. | |
// | |
// Yet, contrary to the arguments against using it, | |
// it‘s not that hard to maintain this code when you are | |
// careful and know what you are doing. |
require 'faraday' | |
class PasswordCracker | |
ALPHABET = (('a'..'z').to_a + ('0'..'9').to_a).shuffle | |
SUBJECT = 'password' | |
def initialize(api) | |
@api = api | |
@password = '' | |
end |
I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.
There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*
, e.g.:
:vs **/*<partial file name><Tab>
# | |
# Needless to say, I (Volkan Ozcelik) take no responsibility, whatsoever, | |
# about what will happen to your NAS when you try these. | |
# When did it to mine, I observed *ENORMOUS* performance gain and a zen-like silence. | |
# | |
# +----------------------------------------------------------+ | |
# | WHAT YOU ARE GOING TO DO CAN LIKELY VOID YOUR WARRANTY | | |
# | SO PROCEED WITH CAUTION | | |
# +----------------------------------------------------------+ | |
# |
This is a copy of this presentation by Michael Covington
function trimSvgWhitespace() { | |
// get all SVG objects in the DOM | |
var svgs = document.getElementsByTagName("svg"); | |
// go through each one and add a viewbox that ensures all children are visible | |
for (var i=0, l=svgs.length; i<l; i++) { | |
var svg = svgs[i], | |
box = svg.getBBox(), // <- get the visual boundary required to view all children |