Skip to content

Instantly share code, notes, and snippets.

const sketch = function(p) {
p.setup = function() {
p.colorMode(p.HSB, 1);
p.createCanvas(p.windowWidth, 100);
};
p.draw = function() {
p.background(1, 1, 1);
p.fill(1);
p.rect(p.mouseX, p.mouseY, 50, 50);
var ST_APP_NAME = 'SourceTree';
var resize = function(windowObject, opt) {
opt = opt || {};
opt.style = "bar-resize:screenSizeX * .6";
var ST_BOOKMARKS_WIDTH = 500;
switch (windowObject.app().name()) {
case ST_APP_NAME:
opt.style = "bar-resize:screenSizeX - " + ST_BOOKMARKS_WIDTH;
@geecu
geecu / vim.textarea.js
Created April 24, 2014 08:12
Enable vim mode for <textarea>s in a page
// add our keyamp from github
var vimBinding = document.createElement('script');
vimBinding.setAttribute('src', 'https://rawgit.com/jakub-m/vim-in-textarea/master/jsvim.js');
// browser support for onload may be iffy ...
vimBinding.onload = function () {
var vim = new VIM();
Array.prototype.forEach.call(document.querySelectorAll('textarea'), function (instance){
@geecu
geecu / vim.jsbin.js
Created April 24, 2014 08:11
enable vim mode for jsbin editors
var vimBinding = document.createElement('script');
vimBinding.setAttribute('src','https://raw.github.com/marijnh/CodeMirror/master/keymap/vim.js');
var mirrors = document.querySelectorAll('.CodeMirror');
// browser support for onload may be iffy ...
vimBinding.onload = function () {
Array.prototype.forEach.call(mirrors, function (instance){
instance.CodeMirror.setOption('keyMap','vim');
});
@geecu
geecu / jquery.dbg.js
Created October 1, 2010 14:53
jquery.dbg.js
/**
* dbg jQuery plugin - http://jquery.5s.ro/
*
* Easy debug of your jQuery objects.
*
* @author Gunther Konig <[email protected]>
*/
(function($)
{
$.dbg = function()
function dbg(o)
{
Ti.API.info(o);
}
var win = Ti.UI.createWindow({backgroundColor: '#444'});
var btnProperties = {
backgroundImage: 'enabled.png',
backgroundDisabledImage: 'disabled.png',
width: 70,
var t = setTimeout(function()
{
var alert = Titanium.UI.createAlertDialog(
{
title: 'Timeout fired!',
message: ''
}
);
alert.show();
}, 1000000);
var t = setTimeout(function()
{
var alert = Titanium.UI.createAlertDialog({
title: 'Timeout fired!',
message: ''
});
alert.show();
}, 1000000);
var b = Ti.UI.createButton({