This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($, window, undefined) { | |
var m = document.createElement('i'), | |
m_style = m.style, | |
// TODO support other browsers easings - based on Safari's easing options and ported to Emile easing. | |
stanardEasing = { | |
'ease-in-out' : function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,4);}return -0.5*((pos-=2)*Math.pow(pos,3)-2);}, | |
'ease-in' : function(pos){return Math.pow(pos,4);}, | |
'ease-out' : function(pos){return Math.pow(pos,0.25);}, | |
'linear': function (i) {return i;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>TouchEvent detection for iPhone/iPod/iPad</title> | |
<script type="text/javascript"> | |
var isTouch = (function() { | |
var event, feature = false, | |
support = function() { feature = true; }, | |
element = document.createElement('div'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(h){return '#000000'.substr(0,7-h.length)+h})((~~(Math.random()*(1<<24))).toString(16)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSArray+IndexHelper.h | |
// C_POS | |
// | |
// Created by Tomohisa Takaoka on 6/14/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface BLZLabelWithInset : UILabel | |
@property (nonatomic) UIEdgeInsets insets; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSArray+NegativeIndexes.m | |
// Allow Negative Array Literals | |
// | |
// Created by Matthew Robinson on 25th October 2012. | |
// Copyright (c) 2012 Matthew Robinson. All rights reserved. | |
// | |
// WARNING: This is a proof of concept and should not be used | |
// in production code. This could break at anytime. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Promises are started in parallel. | |
// Resolves with the first resolved value in array order. | |
// If there's no winner, it rejects with last rejection. | |
Promise.preferred = function (promisesOrdered) { | |
return new Promise((resolve, reject) => { | |
var resolvedValues = new WeakMap(); | |
var resolvables = promisesOrdered.slice(); // copy | |
function onMemberResolved(value, member) { | |
resolvedValues.set(member, value); | |
if (member == resolvables[0]) |
OlderNewer