Skip to content

Instantly share code, notes, and snippets.

View WhiteAbeLincoln's full-sized avatar

Abraham White WhiteAbeLincoln

View GitHub Profile
@WhiteAbeLincoln
WhiteAbeLincoln / vue.config.js
Last active December 23, 2021 20:56
Deduplicate entry points for vue-cli multi-page build
// @ts-check
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
/** @typedef {NonNullable<import('@vue/cli-service').ProjectOptions['pages']>[string]} Page */
/** @typedef {import('webpack-chain')} ChainConfig */
/**
* Gets the entry points defined for a page.
* @param {Page} page
@WhiteAbeLincoln
WhiteAbeLincoln / Font Width.js
Last active August 4, 2020 20:44
calculates the average character width in Open Sans 11px
function quickselect_median(arr) {
const L = arr.length, halfL = L/2;
if (L % 2 == 1)
return quickselect(arr, halfL);
else
return 0.5 * (quickselect(arr, halfL - 1) + quickselect(arr, halfL));
}
function quickselect(arr, k) {
// Select the kth element in arr
@WhiteAbeLincoln
WhiteAbeLincoln / gatsby-node.js
Created June 15, 2019 04:24
gatsby-transformer-remark with frontmatter hack
/**
* In order to resolve frontmatter as markdown using the same infrastructure
* as with the markdown body, we call the `setFieldsOnGraphQLNodeType` function
* exported by gatsby-transformer-remark
*
* We get the field to operate on using the generated MarkdownRemarkFieldsEnum
* In order to resolve field enum to a corresponding value, we must use the
* getValueAt function, which is a utility function internal to gatsby.
* We should find a more stable way of doing this.
*
@WhiteAbeLincoln
WhiteAbeLincoln / genXCompose.py
Created September 15, 2018 22:11
Generate mathematical symbol XCompose mappings
#!/usr/bin/env python3
import unicodedata
import sys
#
# Helper script to generate XCompose files
#
# Usage:
#

Keybase proof

I hereby claim:

  • I am WhiteAbeLincoln on github.
  • I am whiteabelincoln (https://keybase.io/whiteabelincoln) on keybase.
  • I have a public key whose fingerprint is 633B 90EB 9899 C7E5 914D A165 582C 55BD D37B C8B0

To claim this, I am signing this object:

@WhiteAbeLincoln
WhiteAbeLincoln / taskview.ahk
Created August 10, 2016 01:19
Autohotkey hotcorners script to activate task view
#Persistent
; The following script can define hotcorners for any number of monitors arranged in any configuration.
; Horizontally arranged monitors work best
; Vertically arranged monitors may have some difficulty (read: over sensitivity since moving your mouse too far up puts it into Bottom*, not Top*), but should still work
; ---------------------------------------
; USER CONFIGURABLE
; ---------------------------------------
@WhiteAbeLincoln
WhiteAbeLincoln / Main Mod Class
Created July 10, 2014 22:47
calling your keybinding methods
@Mod(modid = Reference.MODID, version = Reference.VERSION, name = Reference.NAME_STRING)
public class TutorialMod
{
KeyInputHandler keys = new KeyInputHandler();
@EventHandler
public void preinit(FMLPreInitializationEvent event){
FMLCommonHandler.instance().bus().register(keys);
@WhiteAbeLincoln
WhiteAbeLincoln / Key Input handling
Created July 10, 2014 22:42
Key input handling for minecraft 1.7
public class KeyInputHandler {
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
if(KeyBindings.pong.isPressed())
System.out.println("pong");
}
}
@WhiteAbeLincoln
WhiteAbeLincoln / Key Bindings
Created July 10, 2014 22:38
Key Bindings for minecraft 1.7
package com.abe.tutorial;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.registry.ClientRegistry;
import net.minecraft.client.settings.KeyBinding;
public class KeyBindings {
// Declare KeyBinding pong