Skip to content

Instantly share code, notes, and snippets.

Isaiah Odhner 1j01

Block or report user

Report or block 1j01

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@1j01
1j01 / undo-redo-history.js
Last active Jun 10, 2019
Undo/redo history pattern example in JavaScript
View undo-redo-history.js
// first setup our stacks of history states
// (const refers to the reference to the arrays, but they arrays themselves are mutable)
const undos = [];
const redos = [];
// undo and redo are symmetrical operations, so they *could* be factored to use an "undoOrRedo" / "stepHistory" function that takes two stacks as arguments, but it might be clearer as two functions
const undo = () => {
if (undos.length < 1) { return false; }
@1j01
1j01 / blob_to_buffer.js
Last active Aug 24, 2018 — forked from davemackintosh/blob_to_buffer.js
Electron blob to buffer, I made this to use with the nativeImage class.
View blob_to_buffer.js
function blob_to_buffer(blob, callback) {
const file_reader = new FileReader()
file_reader.addEventListener("loadend", event => {
if (file_reader.error) {
callback(file_reader.error)
} else {
callback(null, new Buffer(file_reader.result))
}
}, false)
@1j01
1j01 / 1. symmetrical-text.js
Last active Jun 8, 2018
|[<-'*/]^[\*'->]| ):\<^/A]H[A\^>/:( |[<-'*/]^[\*'->]|
View 1. symmetrical-text.js
function generateSymmetricTextLine() {
const selfSymmetricChars = "*#^!+=-.':oO08|HAIX_WMVT";
const chars1 = ">>><<</\*^:_.-'|!~)()()][[{}{";
const chars2 = "<<<>>>\/*^:_.-'|!~()()([]]}{}";
const maxWidth = 10;
const maxNumChars = maxWidth - 2;
const numChars = maxNumChars - Math.floor(Math.random() * 5);
let string = selfSymmetricChars[~~(Math.random() * selfSymmetricChars.length)];
for (let i = 0; i < numChars; i += 1) {
@1j01
1j01 / 1. onemorepixel.gml
Last active Jun 7, 2018
An old code doodle made in GameMaker 8.0 GML, of phantasmagorical circuitry. See the output here: https://imgur.com/a/ze0tV4o
View 1. onemorepixel.gml
var f,t,w,h,c,l,wires;
f=10; //cell size
c=2/5; //circle size
l=1/5; //line width
t=4;//only used here
w=128*t;
h=128*t;
@1j01
1j01 / Sux, Bro.bytebeat.js
Last active May 29, 2018
A mashup of bytebeat songs people have made. Not super finessed, but it was fun making, as I recall (just "cutting it together" with conditionals, and figuring out how to organize it). HTML5 Bytebeat link: https://goo.gl/sXnsqt
View Sux, Bro.bytebeat.js
////\ _
(//( ( _ _ _ _ | | _ __ __
0///\ \/ / / \/ / | -.| / _\/ \
/1/// / / / ) ( | ()|| / ( 0 |
//0 \/\__/ /_/\_\9 |___/|_| \__/ &copy rly bad ascii co.
///1 j 0 1
////j 0 1
/////0 1
//////1 A mish-mash of a ton of other people's bytes.
@1j01
1j01 / Color Picker with color strip previews on the sliders.json
Created May 11, 2018
Based on an example color picker (http://aprt.us/editor/?load=doc/examples/Color%20Picker.json), this adds color strips as previews of what moving an individual slider will do. Try it on http://aprt.us/editor/
View abstract-art.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View WINDOWS93 3D windows effect.js
/**
* Paste the following (or this entire file) into the Terminal app on windows93.net (or your browser's devtools console)
*
* You can then run toggle3D() to toggle the effect (it starts enabled)
*
* I originally made this as the Konami Code effect on 98.js.org
* So this is a port of that to work on windows93.net
* (where it's much more thematically fitting :P)
*/
View npm uninstall emojis-list -ddd.txt
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\Isaiah\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'uninstall',
npm verb cli 'emojis-list',
npm verb cli '-ddd' ]
npm info using npm@5.5.1
npm info using node@v6.10.0
npm verb npm-session 71c9cc4b23c86eae
npm sill install loadCurrentTree
@1j01
1j01 / README.md
Last active Oct 7, 2018
GitHub Desktop 1.0 dark theme stylesheet (obsolete)
View README.md

Deprecated! 🎉

There's now a dark theme (currently in beta) built into GitHub Desktop.

Access it from File > Options... > Appearance


GitHub Desktop Dark Theme

You can’t perform that action at this time.