Skip to content

Instantly share code, notes, and snippets.

View jpwilliams's full-sized avatar
🟪
Building Inngest

Jack Williams jpwilliams

🟪
Building Inngest
View GitHub Profile
@jpwilliams
jpwilliams / fn_findSpace.sqf
Created July 12, 2013 11:45
AW_fnc_findSpace function, created to allow Side Mission and Priority Target developers the freedom to select specific areas of a map without needing to write their own functions.
/*
File: fn_findSpace.sqf
Author: Rarek [AW]
Description
| A simple way to find empty space using a series of parameters.
| Designed for Side Mission / Priority Target creators who wish
| to easily find space without having to faff around with findSafePos,
| randomPos and isFlatEmpty.
|
@jpwilliams
jpwilliams / regex.js
Last active September 29, 2016 08:14
Simple Markdown Single Regex
// Very simple regex that supports ```big code blocks```,
// `code highlights`, *bold*, _italic_ and ~strikethrough~,
// isolating each group.
/(`{3}([\S\s]+?)`{3})|(`(.+?)`)|(\*(.+?)\*)|(_(.+?)_)|(~(.+?)~)|(\n)|(.+?)/gm
@jpwilliams
jpwilliams / infiniteObject.js
Last active August 11, 2016 11:13
For if you ever wanted to do something insane and pointless.
function proxy () {
return new Proxy(function () {
return proxy()
}, {
apply (target, name) {
return proxy()
},
get (target, name) {
switch (name) {
@jpwilliams
jpwilliams / scramble.js
Last active November 23, 2016 17:05
Scramble strings, retaining their readability. This is pointless.
function scramble (message) {
message = message || ''
var ret = ''
var re = /([a-zA-Z]+)|([^a-zA-Z]+)/g
var match
while (match = re.exec(message)) {
if (match[2]) {
ret += match[2]
@jpwilliams
jpwilliams / increment-dates.js
Created December 9, 2016 14:33
Add methods to the Date class to allow incrementing and decrementing dates
var types = [
'Date',
'FullYear',
'Hours',
'Milliseconds',
'Minutes',
'Month',
'Seconds',
'UTCDate',
'UTCFullYear',
@jpwilliams
jpwilliams / treeView.sh
Created December 12, 2016 16:18
List node.js apps all pretty, like
# Requires http://brewformulas.org/Tree
alias t="tree -I node_modules -C"
@jpwilliams
jpwilliams / EMPLOYER.md
Last active April 16, 2018 14:43
Versioned and revised ideas for how to run a good tech company.

EMPLOYER.md

Versioned and revised ideas for how to run a good tech company.

Edits can just be plain edited. Redactions must be turned into strikethrough and a comment added stating why the text/point is being removed.

Contents

@jpwilliams
jpwilliams / semver-prerelease.md
Created January 8, 2017 18:43
A good description of how to use Semver for major pre-release versions

TLDR

I have not seen prelease versions utilized pre-1.0.0. It seems fairly pointless since the public API is not finalized yet. They become useful after 1.0.0 is released.

So when are prelease versions useful?

From semver.org:

Version 1.0.0 defines the public API. The way in which the version number is incremented after this release is dependent on this public API and how it changes.

@jpwilliams
jpwilliams / glog.md
Last active March 16, 2017 09:19
Log recent git commits

Installation

# For realpath, gfind and emojify
brew install coreutils findutils emojify
echo "alias glog='~/glog.sh'" >> ~/.bashrc

Usage

@jpwilliams
jpwilliams / valid-breaks.js
Last active March 16, 2017 10:22
Valid places to break chained and function calls
// Always break for args > 2
// All of the following are valid examples
// usual
myFunc(one, two)
// > 2 args
myFunc(
one,
two,