Skip to content

Instantly share code, notes, and snippets.

@creationix
creationix / jsonparse.js
Last active May 10, 2024 14:36
A streaming JSON parser as an embeddable state machine.
// A streaming byte oriented JSON parser. Feed it a single byte at a time and
// it will emit complete objects as it comes across them. Whitespace within and
// between objects is ignored. This means it can parse newline delimited JSON.
function jsonMachine(emit, next) {
next = next || $value;
return $value;
function $value(byte) {
if (!byte) return;
if (byte === 0x09 || byte === 0x0a || byte === 0x0d || byte === 0x20) {
@tresf
tresf / scale-zpl.js
Last active May 10, 2024 14:36
(Experimental) Scales a Raw ZPL file from 203 DPI (dots per inch) to 300 DPI
/*
* author: Tres Finocchiaro
* date: 2015-05-22
* license: Public Domain; Use as you wish.
* source: http://qz.io
*/
/*
* Scales text from a raw ZPL label from 203 DPI to 300 DPI
*/
@alethea
alethea / scale-zpl.js
Last active May 10, 2024 14:35 — forked from tresf/scale-zpl.js
(Experimental) Scales a Raw ZPL file from 203 DPI (dots per inch) to 300 DPI
/*
* author: Tres Finocchiaro, updated by Alethea Rose
* date: 2017-07-10
* license: Public Domain; Use as you wish.
* source: http://qz.io
*/
const cmds = {
FO: 2,
PW: null,
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active May 10, 2024 14:35
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

@jstanden
jstanden / gist:1489447
Last active May 10, 2024 14:35
Simplex Noise in C# for Unity3D - Adapted from James Livingston's MinePackage: http://forum.unity3d.com/threads/minepackage-minecraft-starter-package.69573/
using UnityEngine;
using System.Collections;
public class SimplexNoiseGenerator {
private int[] A = new int[3];
private float s, u, v, w;
private int i, j, k;
private float onethird = 0.333333333f;
private float onesixth = 0.166666667f;
private int[] T;
@tresf
tresf / sign-message.deno.js
Created March 23, 2023 14:46
Signing using Deno + QZ Tray
/**
* Author: A. Tres Finocchiaro
* License: Public Domain
*/
import "https://raw.githubusercontent.com/qzind/tray/v2.2.2/js/qz-tray.js";
import { encode, decode } from "https://deno.land/std/encoding/base64.ts";
// Load certificate
qz.security.setCertificatePromise(function(resolve, reject) {
@heroheman
heroheman / ranger-cheatsheet.md
Last active May 10, 2024 14:35
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@tresf
tresf / create_apple_installer.sh
Last active May 10, 2024 14:34
create_apple_installer.sh
#!/bin/bash
#title :create_applet_installer.sh
#description :Creates Apple ".app" bundle for LMMS
#author :Tres Finocchiaro
#date :20140331
#version :1.0
#usage :bash create_applet_installer.sh
#notes :See also https://github.com/LMMS
#notes :Troubleshooting try: export DYLD_PRINT_LIBRARIES=1
#requires :deploymacqt
@josh64x2
josh64x2 / mac-notes.md
Last active May 10, 2024 14:34
mac notes

disable gatekeeper sudo spctl --master-disable

disable verification defaults write com.apple.LaunchServices LSQuarantine -bool NO

reset launchpad defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock

Remove OmniFocus v2 unread news

@lcenchew
lcenchew / macos.md
Last active May 10, 2024 14:34
Notes - macOS #notes