Skip to content

Instantly share code, notes, and snippets.

View begin-again's full-sized avatar
🍩
working

Todd Hogarth begin-again

🍩
working
View GitHub Profile
@begin-again
begin-again / AppTray.js
Last active January 19, 2022 21:27
From a tutorial using electron v9 though trying to get it to work with v12.2.3
const { app, Menu, Tray } = require('electron');
// eslint-disable-next-line no-unused-vars
const MainWindow = require('./MainWindow');
class AppTray extends Tray {
/**
* Creates an instance of AppTray.
* @param {string} icon
* @param {MainWindow} mainWindow
* @memberof AppTray
@begin-again
begin-again / error-test.cfml
Last active January 4, 2021 21:57
error instance
<cfscript>
// run with Adobe 2018 engine cuz i'm lazy with semi-colons
public function doSomething(
any error = {}
){
var result = {SUCCESS: false, ERRORS: []};
if(isErrorObject(error)){
arrayAppend(result.errors, {
@begin-again
begin-again / swap-keys.js
Created October 17, 2019 18:10
Transposing keys
// The problem is that I need to change an objetc's key names
// the question then is which is better?
// method brute force
const toLocal = (item) => {
const newItem = {};
newItem.itemId = item.ITEM_ID;
newItem.itemTitle = item.ITEM_TITLE
newItem.checklistIntId = item.CHECKLIST_INSTANCE_ID
// ...
@begin-again
begin-again / CodeEval-FizzBizz.rb
Created October 20, 2016 21:45
My attempt at CodeEval.com's FizzBizz challenge.
# FizzBizz
# https://www.codeeval.com/open_challenges/1/
# Each line of input file: X Y Z
# where: X = first divisor, Y = second divisor, Z = number to count up to
# example:
# 3 5 10 => 1 2 F 4 B F 7 8 F B
# 2 7 15 => 1 F 3 F 5 F B F 9 F 11 F 13 FB 15
myfile = ARGV[0]