Skip to content

Instantly share code, notes, and snippets.

View carbontwelve's full-sized avatar
🎯
Focusing

Simon Dann carbontwelve

🎯
Focusing
View GitHub Profile
@melroy89
melroy89 / mastodon-docker-setup.md
Last active December 8, 2024 08:29 — forked from akuechl/mastodon-docker-setup.md
Mastodon Docker Setup - most complete and easiest guide online
@Phate6660
Phate6660 / lobsters-dark.css
Last active January 16, 2022 08:42
A dark userstyle for https://lobste.rs that aims to be simple and robust.
body, textarea, input, button {
font-size: 11px;
}
a {
color: green;
}
p>a {
color: green !important;
@paintmeyellow
paintmeyellow / gist:913fd91150f6259cd9cee70712bb1e15
Last active July 16, 2024 12:05
AES-128-GSM Cipher Golang+PHP
<?php
function handle(): void
{
$method = 'AES-128-GCM';
$msg = 'message';
$pass = 'password';
$tagLength = 16;
$key = hash('md5', $pass, true);
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active May 29, 2024 12:35
My growing list of Rust programs to use.
@carbontwelve
carbontwelve / wordsmith.css
Last active December 17, 2019 18:05
increment.com inspired css for writefreely
body {
background-color: #efefef;
}
/* Blog header on index and post pages */
#blog-title a {
color: #fff;
background-color: #7a629d;
padding: 0.5em;
display: inline-block;
@dirtystylus
dirtystylus / eleventy-figure-shortcode.md
Last active January 3, 2023 13:33
Eleventy Figure Shortcode
module.exports = (image, caption, className) => {
  const classMarkup = className ? ` class="${className}"` : '';
  const captionMarkup = caption ? `<figcaption>${caption}</figcaption>` : '';
  return `<figure${classMarkup}><img src="/img/${image}" />${captionMarkup}</figure>`;
  // the line below does all this in one line, but is more confusing:
  // return `<figure${className ? ` class="${className}"` : ''}><img src="/img/${image}" />${caption ? `<figcaption>${caption}</figcaption>` : ''}</figure>`;
};
@DragonBe
DragonBe / Vagrantfile-php7.2
Created March 20, 2018 09:29
A quick Vagrant file to get started with PHP 7.2
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
# Fix for https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250
if ! grep -q "ubuntu-xenial" /etc/hosts; then
echo "127.0.0.1 ubuntu-xenial" >> /etc/hosts
fi
@dsample
dsample / README.md
Last active December 18, 2024 03:43
ASCII art diagrams

ASCI art characters for creating diagrams

Characters:

Single line

  • ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
  • ASCII code 192 = └ ( Box drawing character single line lower left corner )
  • ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
  • ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
@timargra
timargra / variableHash.js
Last active March 20, 2023 13:47 — forked from bminer/variableHash.js
Generate a variable-length hash of `data` in Node.js
var crypto = require("crypto");
/* variableHash - Generate a variable-length hash of `data`.
Adapted node version 8.x
------------------------
Similar to the answer here: http://crypto.stackexchange.com/a/3559/4829
If you want a b-bit hash of the message m, then use the first b bits of AES-CTR(SHA256(m)).
Rather than using the suggested algorithm in the stackexchange answer above, I developed
@Aerijo
Aerijo / making_language_grammar.md
Last active September 1, 2024 19:58
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help: