Skip to content

Instantly share code, notes, and snippets.

View dezinezync's full-sized avatar
🏠
Working from home

Nikhil Nigade dezinezync

🏠
Working from home
View GitHub Profile
@boydlee
boydlee / PhotoSelector.js
Created August 20, 2012 12:38
CommonJS module to access photo gallery and camera and return resulting image
/*
PhotoSelector.js
Gets a photo from camera or gallery
Usage:
var ps = require('PhotoSelector');
var select = new ps.PhotoSelector();
//get a photo from the camera
select.fromCamera(false, true, function(success){}, function(failed){}, function(cancelled){});
@omkarkhair
omkarkhair / hexstr2float.html
Last active October 8, 2015 09:47
Hex string to Float (32bit) IEEE 754
<html>
<head>
<script>
/*
Converts a 32bit HEX string (42883EFA) to Float 68.1229476928711
Complies to IEEE 754 Standards.
Tested with a range of sample inputs. Feel free to report a bug.
*/
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@tzmartin
tzmartin / video.thumbnail.js
Created July 10, 2012 17:46
Create Thumbnail Image From Video File, Titanium Mobile
/**
Create Thumbnail of Video File
This snippet captures a thumbnail JPG image, based on a frame @ 2 second time-lapse.
Titanium Mobile
*/
var movie = Titanium.Media.createVideoPlayer({
contentURL:FILENAME,
@freddymontano
freddymontano / test4.js
Created July 5, 2012 19:51
Testing TableView performance using a variable (function) instead of calling Ti.UI.createTableViewRow inside the loop. (see https://gist.github.com/2989311)
var win = Ti.UI.createWindow({
backgroundColor: '#ccc'
});
win.open();
var table = Ti.UI.createTableView();
win.add(table);
var SELECTION_STYLE_BLUE = Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE;
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 13, 2025 05:15
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@pec1985
pec1985 / test1.js
Created June 25, 2012 15:37
Optimizing Appcelerator's Titanium
/**
* Test #1
* Adding 10,000 Ti.UI.TableViewRows to a Ti.UI.TableView
* The rows have the Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE constant in them
*
* Total time in my Mac: 1228ms
*/
var win = Ti.UI.createWindow({
backgroundColor: '#ccc'
@ksafranski
ksafranski / Common-Currency.json
Last active April 23, 2025 09:47
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@paulgibbs
paulgibbs / html5-notifications.md
Created June 12, 2012 14:04
OS X Notification Center in Safari 5.2

OS X Notification Center in Safari 5.2

OS X Mountain Lion adds Notification Center for managing alerts. Just like growl, but better.

Safari 5.2 exposes HTML5 notifications API to sites. Every site need to have permission for showing notifications.

Specification is very new and completely different from older version Chrome has. Developer doesn't have to watch for complicated NotificationCenter.

The syntax is very simple:

@gre
gre / easing.js
Last active May 9, 2025 01:18
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 = {