Skip to content

Instantly share code, notes, and snippets.

View dawsontoth's full-sized avatar

Dawson Toth dawsontoth

View GitHub Profile
#cs ----------------------------------------------------------------------------
Version: v1
Author: Dawson Toth
Script Function:
Taps the tiny unit deselection arrow in They Are Billions 1 to 10 times.
To use, download AutoIt, then drop this in a file named TheyAreBillions-Hotkeys.au3.
Run the script, and then whenever you press `, you can then press ESC or ` to cancel,
or 1, 2, 3, 4 ... 9, or 0 (which means 10) to left click on the deselect arrow in TAB.
function getStackTrace() {
let obj = {};
Error.captureStackTrace(obj, getStackTrace);
return obj.stack;
}
window.activeFuncs = {};
window.originalSetTimeout = window.setTimeout;
window.originalClearTimeout = window.clearTimeout;
window.originalSetInterval = window.setInterval;
@dawsontoth
dawsontoth / hideFBElements.js
Created June 21, 2016 22:43
Hide Facebook Elements I Don't Like
// ==UserScript==
// @name Hide Facebook Elements I Don't Like
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Hides various Facebook elements such as the app nav, advertisting, and suggested pages.
// @author Dawson Toth
// @match https://www.facebook.com/
// @grant none
// ==/UserScript==
@dawsontoth
dawsontoth / generateSplash.js
Last active December 2, 2020 22:55
Start with a 1000x1000 PSD with an icon in the middle. In Photoshop select File > Scripts > Browse... generateSplash.js. Saves out to ../Resources/iphone and android.
/*
Define our various sizes.
*/
var AndroidSizes = {
'android/images/res-ldpi/splash.9.png': 240,
'android/images/res-mdpi/splash.9.png': 360,
'android/images/res-hdpi/splash.9.png': 480,
'android/images/res-xhdpi/splash.9.png': 720,
'android/images/res-xxhdpi/splash.9.png': 960,
'android/images/res-xxxhdpi/splash.9.png': 1440
@dawsontoth
dawsontoth / app.js
Created January 14, 2014 03:02
NodeJS server side simple JSON based socket communications. The Titanium client side counterpart to this is here: https://gist.github.com/dawsontoth/8412167
// We'll use cluster to split work across all of our CPUs.
var cluster = require('cluster');
// Are we the master process ...
if (cluster.isMaster) {
// Monitor the workers for failures.
cluster.on('exit', function(worker) {
console.log('Worker ' + worker.process.pid + ' died. Forking another...');
cluster.fork();
});
@dawsontoth
dawsontoth / app.js
Last active January 3, 2016 04:58
Titanium client side simple JSON based socket communications. The NodeJS server side component to this is available here: https://gist.github.com/dawsontoth/8412318
var lox = require('lib/lox');
lox.start();
lox.exampleOfSendWithoutCallback();
lox.exampleOfSendWithCallback(function(result) {
console.log('Got data back! ' + result);
});
(function() {
function ViewModel(data) {
this.notes = data.rowData.notes;
this.win = lib.ui.actionBarWindow.create({
title: lib.language.translate('common','notes-text')
});
this.display = display;
this.display();
return this.win;
@dawsontoth
dawsontoth / app.js
Created October 10, 2013 18:13
Record to YouTube
var win = Ti.UI.createWindow({ backgroundColor: '#000' });
var progress = Ti.UI.createProgressBar({ max: 1, min: 0, value: 0, visible: true });
var videoBlob, videoName = 'todo.mp4';
// Get your own API key from the following URL: http://code.google.com/apis/youtube/dashboard/
var yourApiKey = '<< YOUR API KEY GOES HERE >>';
function checkToken() {
win.add(progress);
var sessionToken = Ti.App.Properties.getString('GoogleAuthSubSessionToken', '');
@dawsontoth
dawsontoth / app.js
Created May 1, 2013 07:44
SMTP to colored terminal NodeJS app.
/*
Drop this in an app.js, customize the port, and:
> npm install simplesmtp cli-color
> node app.js
*/
try {
var port = 10025,
simplesmtp = require('simplesmtp'),
clc = require('cli-color'),
smtp = simplesmtp.createServer();
@dawsontoth
dawsontoth / animations.js
Created February 19, 2013 20:22
CommonJS module to make animations easier, like fading stuff out. Tested on iOS, Android, and Mobile Web.
/*
State.
*/
var simplify = Ti.Platform.osname === 'mobileweb';
var currentFlashes = {};
/*
Public API.
*/
exports.chainAnimateForever = chainAnimateForever;