-
When exporting an
.app
for macOS in Debug mode, everything works as-expected. -
When exporting an
.app
for macOS in Release mode, the buttons do nothing at all.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (window.clearTimers) { | |
console.log('clearTimers snippet already available. execute "clearTimers()" in your console.') | |
return | |
} | |
const clearTimers = () => { | |
try { | |
const noop = () => {} | |
const nextId = setTimeout(noop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Controller = () => { | |
const controller = { | |
__VERSION__: '1.0.0', | |
plugins: {}, | |
installPlugin (plugin, override) { | |
if (!plugin || !('__pluginName__' in plugin)) { | |
throw new Error(`Controller was unable to install plugin - Invalid plugin was provided.`) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Promise catch order explained | |
// When catch() comes before then() in the promise chain, | |
// exceptions that occur in the then() handler will not be caught. | |
// If the promise rejects, the catch() handler will be called. | |
// If the catch() handler returns a value or a promise that resolves, | |
// the then() handler will be called. | |
mayThrowAnException() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scaleValueToRange = ({ | |
value = 0, | |
fromMinimum = 0, | |
fromMaximum = 1000, | |
toMinimum = -100, | |
toMaximum = 100 | |
}) => { | |
const scaledValue = (( value - fromMinimum) / (fromMaximum - fromMinimum)) * (toMaximum - toMinimum) + toMinimum | |
return { | |
fromMinimum, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.toasts-container { | |
position: fixed; | |
z-index: 65535; | |
right: 0; | |
max-width: 250px; | |
display: flex; | |
flex-direction: column-reverse; | |
} | |
.toasts-container > .toast-container { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const maxProduct = numbers => { | |
const count = numbers.length | |
let left = 0 | |
let right = 0 | |
for (let i = 0; i < count; i += 1) { | |
if (numbers[i] > left || numbers[i] > right) { | |
if (left < right) { | |
left = numbers[i] | |
} else { | |
right = numbers[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def move_sprite(sprite, dt, key_up, key_down, key_left, key_right): | |
""" | |
returns the x and y tuple offset for normalized 8-directional movement | |
sprite is expected to have x, y, x_speed, and y_speed properties | |
speed is expected to be represented in pixels per second | |
""" | |
# Note: using legacy "mm" and "mt" variable names | |
# whose original meaning has been forgotten over the last 20 years | |
mm = [0, 0, 1, 3, 1, 2, 0, 0, 3, 1, 5, 5, 5, 4, 0, 0, 2, 1, 4, 5, 4, 4] | |
mt = [0, 0.0, 1.0, -1.0, 0.7071067811865475, -0.7071067811865475] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Image Crop Tool v1.0 | |
# (C) Rambling Indie Games, LLC | |
# Developed by Richard Marks <[email protected]> | |
# depends on Pillow third party library for PIL in Python 3.6 | |
# pip3 install pillow | |
from PIL import Image | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <random> | |
#include <iterator> | |
#include <string> | |
#include <sstream> | |
#include <cassert> | |
class Card { |
NewerOlder