Skip to content

Instantly share code, notes, and snippets.

View Alhadis's full-sized avatar

John Gardner Alhadis

View GitHub Profile
"use strict";
const {TextBuffer, TextEditor, Range, Point} = require("atom");
const ScreenLineBuilder = loadFromCore("text-buffer/lib/screen-line-builder");
const {emitText} = ScreenLineBuilder.prototype;
const exoticNewlines = "\r";
ScreenLineBuilder.prototype.emitText = function(...args){
const {buffer} = this.displayLayer;
const [char] = args;
@Alhadis
Alhadis / example.xhtml
Created March 13, 2024 12:01
Mixed-namespace XHTML example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY ns_xhtml "http://www.w3.org/1999/xhtml">
<!ENTITY ns_cml "http://www.xml-cml.org/schema">
<!ENTITY ns_rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
]>
<html
xmlns="&ns_xhtml;"
xmlns:cml="&ns_cml;"
xmlns:rdf="&ns_rdf;"
@Alhadis
Alhadis / VHS85 (2023).srt
Created February 12, 2024 14:47
V/H/S/85 (2023) — Corrected subtitles
1
00:00:46,413 --> 00:00:49,724
[static crackling]
2
00:00:50,586 --> 00:00:53,275
Holy cow!
3
00:00:53,379 --> 00:00:55,896
@Alhadis
Alhadis / font-formats.txt
Created October 30, 2015 16:10
Font format file extensions
_v Adobe Type Manager Japanese font metrics
### SmartWare filled area font
#gf MetaFont
$on Steinberg Cubase fonts compressed
$tf Steinberg Cubase fonts compressed
075 Corel Ventura Publisher 75x75 DPI
085 Corel Ventura Publisher 85x85 DPI
091 Corel Ventura Publisher 91x91 DPI
096 Corel Ventura Publisher 96x96 DPI
0b Adobe PageMaker printer font
@Alhadis
Alhadis / blend-modes.c
Created February 24, 2019 03:48
blend-modes.c
/* From: http://web.archive.org/web/20090222030436/http://www.nathanm.com/photoshop-blending-math/ */
#define ChannelBlend_Normal(B,L) ((uint8)(B))
#define ChannelBlend_Lighten(B,L) ((uint8)((L > B) ? L:B))
#define ChannelBlend_Darken(B,L) ((uint8)((L > B) ? B:L))
#define ChannelBlend_Multiply(B,L) ((uint8)((B * L) / 255))
#define ChannelBlend_Average(B,L) ((uint8)((B + L) / 2))
#define ChannelBlend_Add(B,L) ((uint8)(min(255, (B + L))))
#define ChannelBlend_Subtract(B,L) ((uint8)((B + L < 255) ? 0:(B + L - 255)))
#define ChannelBlend_Difference(B,L) ((uint8)(abs(B - L)))
#define ChannelBlend_Negation(B,L) ((uint8)(255 - abs(255 - B - L)))
@Alhadis
Alhadis / scope-names.json
Last active August 1, 2023 19:43
GitHub CSS Classes for TextMate Syntax Scopes
{
"Source of truth": "https://github.com/primer/github-syntax-light",
"brackethighlighter.angle": "pl-ba",
"brackethighlighter.curly": "pl-ba",
"brackethighlighter.quote": "pl-ba",
"brackethighlighter.round": "pl-ba",
"brackethighlighter.square": "pl-ba",
"brackethighlighter.tag": "pl-ba",
"brackethighlighter.unmatched": "pl-bu",
@Alhadis
Alhadis / .editorconfig
Last active July 15, 2023 06:51
Guess supported ECMAScript version(s)
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = false
indent_style = tab
[*.{yaml,yml}]
@Alhadis
Alhadis / fs_usage.log
Created November 24, 2022 14:42
Output of `fs_usage(1)` whilst rasterising a PostScript file in Preview.app
This file has been truncated, but you can view the full file.
05:25:16.599256 lstat64 /System/Library/Frameworks 0.000019 AOSHeartbeat.5919
05:25:16.599266 lstat64 /System/Library/Frameworks/AppKit.framework 0.000008 AOSHeartbeat.5919
05:25:16.599279 lstat64 /System/Library/Frameworks/AppKit.framework/Versions 0.000005 AOSHeartbeat.5919
05:25:16.599285 lstat64 /System/Library/Frameworks/AppKit.framework/Versions/C 0.000005 AOSHeartbeat.5919
05:25:16.599290 lst
@Alhadis
Alhadis / 3D.textile
Last active October 15, 2022 10:49
Rendering tests

A block quotation.

solid cube_corner
	facet normal 0.0 -1.0 0.0
		outer loop
			vertex 0.0 0.0 0.0
			vertex 1.0 0.0 0.0
			vertex 0.0 0.0 1.0
		endloop
	endfacet
@Alhadis
Alhadis / appveyor.yml
Last active August 24, 2022 18:13
AppVeyor Configuration Reference
# -*- tab-width: 4; indent-tabs-mode: nil -*- vim: ts=4 et
# Based on https://www.appveyor.com/docs/appveyor-yml/ (July 19th, 2021)
# Notes:
# - All sections are optional; the most minimalist `appveyor.yml` is an empty file
# - All section names are case-sensitive
# - Section names should be unique on each level
#---------------------------------#
# General configuration #
#---------------------------------#