Skip to content

Instantly share code, notes, and snippets.

View Alhadis's full-sized avatar

John Gardner Alhadis

View GitHub Profile
@kivikakk
kivikakk / whitelist.md
Created November 16, 2018 02:18
HTML sanitizer whitelist for user content on GitHub.com
  • Any allowed id and name attributes have "user-content-" prefixed to their value.
  • A maximum of 2 nested sub or sup tags are allowed.
  • A maximum of 10 nested ul or ol tags are allowed.
Allowed Element Allowed Attributes
All allowed elements abbr, accept, accept-charset, accesskey, action, align, alt, axis, border, cellpadding, cellspacing, char, charoff, charset, checked, clear, color, cols, colspan, compact, coords, datetime, dir, disabled, enctype, for, frame, headers, height, hreflang, hspace, id, ismap, itemprop, label, lang, maxlength, media, method, multiple, name, nohref, noshade, nowrap, open, prompt, readonly, rev, rows, rowspan, rules, scope, selected, shape, size, span, start, summary, tabindex, title, type, usemap, valign, value, vspace, width
a As above plus href (must be github-mac, github-windows, http,
@stek29
stek29 / efirestool.c
Last active January 5, 2024 13:25
efirestool -- tool to work with APPL efires archives
#include <sys/types.h>
#include <unistd.h> // write
#include <fcntl.h> // open, close
#include <stdio.h> // fprintf
#include <string.h> // strerror, strdup, strchr
#include <stdlib.h> // free, EXIT_*
#include <sys/mman.h> // mmap, munmap
#include <sys/stat.h> // fstat
#include <errno.h> // errno
#include <dirent.h> // DIR, dirent, opendir, readdir
@166MMX
166MMX / cmd.origin.sh
Last active January 13, 2024 17:24
macOS Sierra /usr/bin/ Origin
#!/usr/bin/env bash
main() {
header
find "$1" \( -type f -o -type l \) -print0 | while IFS= read -r -d ''; do
second "$REPLY"
done
}
second() {

Punctuation Scopes

Note: For the punctuation that are used in pairs there is an optional .begin & .end that can be tacked on right before the language name at the end. They are not required to be used but should be standardized where found useful.

The third level of the following scopes is open to new scopes as you see fit, however try to keep then as generic as possible to keep the total number down. Try to reuse a scope if possible before creating anew.

  • punctuation.definition

    Punctuation that is intended to delimit the bounds of a single item, generally something that will become a real singular object in compiled/interpreted code. Can also be used in markup languages for delimiters that define small conceptual units (headers, list items, etc).

@katyo
katyo / Makefile
Last active August 18, 2021 21:04
Excellon Specification
all: excellon.html excellon.pdf
excellon.html: excellon.md
@pandoc $< -o $@
excellon.pdf.md: excellon.md
@cat $< | sed 's/\.png/\.pdf/g' > $@
excellon.pdf: excellon.pdf.md
@pandoc $< --latex-engine=pdflatex -o $@
@paulirish
paulirish / what-forces-layout.md
Last active May 9, 2024 07:00
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
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber:
@kevincennis
kevincennis / v8.md
Last active May 6, 2024 05:25
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)
@kanazux
kanazux / file_types.php
Last active February 1, 2023 11:09
arrays file types php
<?php
$compressed = array(
".0" => "Hacha Split Archive File",
".000" => "DoubleSpace Compressed File",
".7z" => "7-Zip Compressed File",
".7z.001" => "7-Zip Split Archive Part 1 File",
".7z.002" => "7-Zip Split Archive Part 2 File",
".a00" => "ALZip Second Split Archive File",
".a01" => "ALZip Third Split Archive File",
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!