Skip to content

Instantly share code, notes, and snippets.

View GoodNovember's full-sized avatar
🖍️
Why can't I write my code in Crayon?

Victor GoodNovember

🖍️
Why can't I write my code in Crayon?
  • 951 Gaspra
View GitHub Profile
@GoodNovember
GoodNovember / blink.md
Last active February 13, 2017 06:42
A strange noise in the park
<canvas id="screen"></canvas>
<div class="overlay">PAINT #1</div>
@GoodNovember
GoodNovember / PGPWordList.json
Created July 30, 2017 23:08
The PGP word list converted to JSON, data taken from Wikipedia.
[
{
"hex": "00",
"evenWord": "aardvark",
"oddWord": "adroitness"
},
{
"hex": "01",
"evenWord": "absurd",
"oddWord": "adviser"
@GoodNovember
GoodNovember / EventButtonsParser.js
Created August 13, 2017 01:21
Event Buttons Parser, allows you to check which buttons are pressed in a more english friendly way.
function CreateEventButtonsParser(buttonNamesArray){
var buttonCount = buttonNamesArray.length
var variationsNeeded = Math.pow(2, buttonCount)
var seq = makeSequence(0, variationsNeeded, 1)
var vals = seq.map(function(value){ return getBinary(buttonCount, value) })
var map = vals.reduce(function(acc, binaryString, index){
acc[index] = parseBinaryString(buttonNamesArray, binaryString)
@GoodNovember
GoodNovember / roasted-cauliflower.md
Last active January 2, 2018 21:26
Delicious Spicy Tangy Cauliflower Recipe

Ingredients

  • 2 1/2 cups dry white wine
  • 1/3 cup olive oil
  • 1/4 cup kosher salt
  • 3 tablespoons fresh lemon juice
  • 2 tablespoons unsalted butter
  • 1 tablespoon crushed red pepper flakes
  • 1 tablespoon sugar
@GoodNovember
GoodNovember / SmoothStep.md
Last active January 8, 2018 22:26
Generic Javascript SmoothStep Algorithm

Inspired by this answer: https://stackoverflow.com/a/41196499

This implementation improves upon the above answer by only running the PascalTriangle functions once during initialization and using the compiled results in all subsequent calls to the function.

// (nthOrder should be a positive integer, not a float.)
// values higher than 15 show some strange behavior.
@GoodNovember
GoodNovember / index.html
Last active February 25, 2019 17:45
Electron Boilerplate Without Comments
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src https://*; child-src 'none';">
</head>
<body>
<h1>Hello World!</h1>
</body>
@GoodNovember
GoodNovember / StepsToReproduce.md
Last active June 12, 2018 18:18
Sample code for Apostrophe CMS which illustrates the 'You were unable to take control of the document'

I realize that this is a stupid widget, I only made it to illustrate the issue at hand.

  1. Add an instance of the Double Content widget to an area.
  2. Add an Image to one of the newly instantiated areas. (should work fine)
  3. Edit the Double Content widget, saving changes (no actual editing options should be shown)
  4. Repeat step 2. (should now tell you You were unable to take control of the document)
  5. Cry softly.
  6. Refresh page and attempt to add another Image as in Step 2 (should work again, till you try to edit Double Content again.)
@GoodNovember
GoodNovember / alice.js
Created August 20, 2018 00:36
Sending data between window instances with Electron.
const { ipcRenderer } = require('electron')
ipcRenderer.on('postal-error',(event, errorPayload)=>{
const {
error,
sender,
destination,
payload
} = errorPayload
@GoodNovember
GoodNovember / harsh.js
Created September 24, 2018 21:27
A Little Harsh
import shortId from "shortid"
export const HashToArray = (hash) => Object.keys(hash).map((key)=>hash[key])
export const ArrayToHash = (array) => array.reduce((acc, item)=>{
const {id} = item
acc[id] = item
return acc
},{})
export const Add = (hash, itemObject) => {