Skip to content

Instantly share code, notes, and snippets.

View TheyAreBillions-Hotkeys.au3
#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.
View traceIntervalsAndTimeouts.js
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 Jun 21, 2016
Hide Facebook Elements I Don't Like
View hideFBElements.js
// ==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 Aug 27, 2016
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.
View generateSplash.js
/*
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 Jan 14, 2014
NodeJS server side simple JSON based socket communications. The Titanium client side counterpart to this is here: https://gist.github.com/dawsontoth/8412167
View app.js
// 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 Jan 3, 2016
Titanium client side simple JSON based socket communications. The NodeJS server side component to this is available here: https://gist.github.com/dawsontoth/8412318
View app.js
var lox = require('lib/lox');
lox.start();
lox.exampleOfSendWithoutCallback();
lox.exampleOfSendWithCallback(function(result) {
console.log('Got data back! ' + result);
});
View gist:6978964
(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 Oct 10, 2013
Record to YouTube
View app.js
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
SMTP to colored terminal NodeJS app.
View app.js
/*
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 Feb 19, 2013
CommonJS module to make animations easier, like fading stuff out. Tested on iOS, Android, and Mobile Web.
View animations.js
/*
State.
*/
var simplify = Ti.Platform.osname === 'mobileweb';
var currentFlashes = {};
/*
Public API.
*/
exports.chainAnimateForever = chainAnimateForever;
You can’t perform that action at this time.