Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<head>
<title></title>
<style>
.boom {
width:40px;
height:40px;
position:relative;
@kristjanmik
kristjanmik / ti.android.events.js
Last active July 25, 2016 14:58
A proper way to handle pause and resume event in titanium for android
var win = Ti.UI.createWindow({});
win.addEventListener("open", function(e) {
win.activity.addEventListener("resume", function() {
Ti.App.fireEvent('resume')
});
//Notice the pause event
win.activity.addEventListener("pause", function() {
Ti.App.fireEvent('paused')
});
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@gre
gre / easing.js
Last active April 30, 2024 04:58
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);