Skip to content

Instantly share code, notes, and snippets.

View zenlor's full-sized avatar
⚖️
balancing terrain generation

Lorenzo Giuliani zenlor

⚖️
balancing terrain generation
View GitHub Profile
@zenlor
zenlor / 55-bytes-of-css.md
Created September 28, 2022 17:15 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@zenlor
zenlor / alpine-chroot.sh
Last active May 12, 2019 10:15 — forked from emolitor/alpine-chroot.sh
chroot script for testing aarch64
#!/bin/sh
#
# This simple script is setting up a Alpine Linux installation in a chroot.
# chroot will be placed in the current working directory.
#
# Most parts of this script are written down at
# http://wiki.alpinelinux.org/wiki/Setting_up_the_build_environment_in_chroot
#
# Licensed under GPLv2
#
@zenlor
zenlor / pretty-pragmata.el
Created November 30, 2016 22:47 — forked from plaidfinch/pretty-pragmata.el
Mappings for prettify-symbols-mode to enable Pragmata Pro's ligatures in Emacs. I've taken some slight liberties with the original ligature map, to suit my own tastes.
;; PRETTIFY SYMBOLS (with Pragmata Pro)
(defun setup-pragmata-ligatures ()
(setq prettify-symbols-alist
(append prettify-symbols-alist
'(("!!" . ?)
("!=" . ?)
("!==" . ?)
("!≡" . ?)
("!≡≡" . ?)
("!>" . ?)
@zenlor
zenlor / hook.sh
Last active November 21, 2016 10:56 — forked from jimmycuadra/hook.sh
letsencrypt.sh hook script for dns-01 challenge using AWS Route 53
#!/bin/sh
HOSTED_ZONE="Route53 zone ID"
payload() {
local action=$1
cat <<EOF
{
"Changes": [
{ "Action": "${action}",
@zenlor
zenlor / sql-tdd.markdown
Created November 14, 2016 16:54 — forked from abrkn/sql-tdd.markdown
Migrations and testing for PostgreSQL using node.js and Travis-CI

Migrations and testing for PostgreSQL using node.js and Travis-CI

We're looking to add a column to the table user called admin (boolean) in an existing database.

Project layout

migrations
# -- Conky settings -- #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
@zenlor
zenlor / onchange.sh
Last active August 29, 2015 14:15 — forked from shello/onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute a command
# when a file or directory is created, modified or deleted.
#
# Modified from the original by: Senko Rasic <senko.rasic@dobarkod.hr>
# https://gist.github.com/senko/1154509
#
# Requires:
# bash
@zenlor
zenlor / bookmarklet
Last active August 29, 2015 14:13 — forked from mauricecruz/readme.md
(function(d, u) {
var s = d.createElement('script');
s.src = u;
s.async = !!1;
(d.head || d.getElementsByTagName('head')[0]).appendChild(s);
}(document, 'https://gist.githubusercontent.com/mauricecruz/d20345b25b5c3ca0a4d7/raw/3f0a90112026a1e51a401dcb2fe6f3ca7bf299c0/snippet.js'));
(function(d){var a=d.createElement("script");a.src="https://gist.githubusercontent.com/mauricecruz/d20345b25b5c3ca0a4d7/raw/3f0a90112026a1e51a401dcb2fe6f3ca7bf299c0/snippet.js";a.async=!0;d.head.appendChild(a);}(document))();
{
"base_url":"http://example.com/launcher/v1",
"server_id":"",
"name": "MagiTech Madness",
"news":"http://example.com/launcher/v1/index.html",
"address":"",
"revision":"0.0.1",
"version":"1.6.4"
}
@zenlor
zenlor / Benchmark-ish.js
Created December 26, 2011 15:35
walk(dirname, callback, finished) - asynchronous directory traversal in node.js
var fs = require('fs')
, path = require("path")
, cp = require('child_process')
, Step = require('step')
, colors = require('colors')
, start = Date.now();
walk = (function() {
var counter = 0;
var walk = function(dirname, callback, finished) {