Skip to content

Instantly share code, notes, and snippets.

View jordanbtucker's full-sized avatar

Jordan Tucker jordanbtucker

View GitHub Profile
@jordanbtucker
jordanbtucker / json5.pegjs
Last active March 17, 2024 11:14
PEG.JS file for JSON5
/*
MIT License
Copyright (c) 2019 Jordan Tucker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@jordanbtucker
jordanbtucker / index.d.ts
Created April 5, 2019 05:09
@types/feathersjs__feathers using `export =` instead of `export default`
// Type definitions for @feathersjs/feathers 3.1
// Project: http://feathersjs.com/
// Definitions by: Jan Lohage <https://github.com/j2L4e>
// Abraao Alves <https://github.com/AbraaoAlves>
// Tim Mensch <https://github.com/TimMensch>
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript
// TypeScript Version: 2.3
/// <reference types="node" />
#include "pch.h"
#include <windows.h>
#include <bthsdpdef.h>
#include <bthdef.h>
#include <BluetoothAPIs.h>
#include <strsafe.h>
#include <tchar.h>
#pragma comment(lib, "Bthprops.lib")
Date
= FourDigits '-' TwoDigits '-' TwoDigits 'T' TwoDigits ':' TwoDigits ':' TwoDigits { return new Date(text()) }
FourDigits
= Digit Digit Digit Digit
TwoDigits
= Digit Digit
Digit
@jordanbtucker
jordanbtucker / prompt-for-password.js
Last active November 10, 2023 20:00
Database encryption with NeDB
/**
* This is an example of app that uses an ecrypted NeDB database. It prompts the
* user for a password, decrypts the database, displays any existing records,
* promtps the user for a new record to store, encrypts that record, then exits.
* The password must be given each time the app is started.
*/
const crypto = require('crypto')
const inquirer = require('inquirer')
const scrypt = require('scryptsy')
const app = require('@feathersjs/feathers')
const service = require('feathers-knex')
const knex = require('knex')
const db = knex({
client: 'mysql',
connection: 'mysql://user:pass@localhost/test',
})
app.use('todos', service({
10.0.1.2 - - [16/Jul/2020:03:57:51 +0000] "POST /dns-query HTTP/1.1" 200 1300 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:57:52 +0000] "POST /dns-query HTTP/1.1" 200 722 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:57:54 +0000] "POST /dns-query HTTP/1.1" 200 826 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:57:54 +0000] "POST /dns-query HTTP/1.1" 200 1299 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:58:13 +0000] "POST /dns-query HTTP/1.1" 200 1299 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:58:14 +0000] "POST /dns-query HTTP/1.1" 200 783 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:58:21 +0000] "POST /dns-query HTTP/1.1" 200 1303 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:58:45 +0000] "POST /dns-query HTTP/1.1" 200 1300 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:58:53 +0000] "POST /dns-query HTTP/1.1" 200 1289 "-" "Chrome"
10.0.1.2 - - [16/Jul/2020:03:58:54 +0000] "POST /dns-query HTTP/1.1" 200 917 "-" "Chrome"
@jordanbtucker
jordanbtucker / README.md
Created October 18, 2020 17:56
Big Endian Types for Cheat Engine

Big Endian Types for Cheat Engine

These auto assembly scripts add big endian value types for Cheat Engine, which is useful for games like Breath of the Wild.

How to add big endian types to Cheat Engine

  1. Open Cheat Engine.
  2. Attach to any process.
  3. Right-click on the Value Type drop down box.
  4. Click Define new custom type (Auto Assembler).
@jordanbtucker
jordanbtucker / parse.js
Created July 21, 2021 20:11
JSON5 parsing simple references as strings
// see https://github.com/json5/json5/issues/249
const util = require('./util')
let source
let parseState
let stack
let pos
let line
let column
// See https://github.com/json5/json5/issues/91#issuecomment-197048166 for motivation and documentation.
function regExpReviver(name, value) {
const ID_Continue =
/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0