Skip to content

Instantly share code, notes, and snippets.

@darktempla
darktempla / Vagrantfile
Last active December 23, 2023 21:44
Example of running k0s using vagrant and the k0sctl binary to install on the 2 nodes.
# Defines our Vagrant environment
#
# -*- mode: ruby -*-
# vi: set ft=ruby :
nodeCount = 2
image = "debian/buster64"
ipRangeStart = 40
Vagrant.configure("2") do |config|
@timpulver
timpulver / pandoc_watch.js
Created May 28, 2016 18:15
Watches a markdown-folder for changes and re-generates .icml (InCopy / Adobe InDesign CC) files on every change
var exec = require('child_process').exec;
var chokidar = require('chokidar');
/*
* Watches a folder for changes in markdown (*.md) files and compiles them to ICML (Adobe InDesign CC / InCopy format)
*
* Dependencies:
* - Install Pandoc: pandoc.org
* - Run "npm install chokidar"
*
@jonathantneal
jonathantneal / README.md
Last active August 25, 2022 04:10
CSS Modules in PHP

CSS Modules lets you write and use simple class names rather than remembering and maintaining long unique class names for every component. CSS Modules mutates all of your classnames from each partials into new, completely unique classnames that will not conflict when they are bundled together into your main CSS file. Then, a JSON file is generated that maps the happy classnames from each file to the unique classname in the combined file. You load this map in PHP, and begin using the easy-to-remember classnames as you wish.

@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 12:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 14, 2024 14:27
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@chrisyco
chrisyco / power.sh
Created May 24, 2011 03:38
Suspend, hibernate, restart or shutdown the computer without sudo!
#!/bin/sh
# Suspend, hibernate, restart or shutdown the computer without sudo!
# by Chris Wong
# Released to the public domain.
NAME=$0
usage() {
echo "Usage: $NAME suspend|hibernate|restart|shutdown"