This file contains hidden or 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 getPhoto() { | |
navigator.camera.getPicture(onPhotoSuccess, onPhotoFail, | |
{quality: 70, targetWidth: 500, targetHeight: 500, | |
sourceType: navigator.camera.SourceType.PHOTOLIBRARY, | |
destinationType: navigator.camera.DestinationType.FILE_URI, | |
}); | |
} | |
function onPhotoSuccess(imageUri) { | |
var $img = $('<img/>'); |
This file contains hidden or 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
<?php | |
/** | |
* @file | |
* Helper class for encoding images as Base64. | |
* Has support for the Drupal module ImageCache, just provide it with your | |
* preset name if you'd like the class to use that version of an image instead. | |
* Is by no means dependent on Drupal though. Just a nice feature. | |
* Feel free to use it as you like. | |
* | |
* @author Simon Ljungberg <[email protected]> |
This file contains hidden or 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
1) Add new strings to php files with function __('TEXT') | |
Sample: | |
---------- | |
<?php | |
__('edit'); | |
__('delete'); | |
---------- | |
2) execute command: find . -type f -iname "*.php" | xgettext --from-code=utf-8 --keyword=__ --keyword=_e -j -f -; |
This file contains hidden or 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
// Simple debug output helper | |
function debug(message) { | |
Ti.API.info(message); | |
} | |
/** | |
* | |
* @param thisControl The control you wish to dump | |
* @param goDeep boolean Do you want deep introspection | |
* @param incFuncs boolean Do you want to include functions in the output when going deep |
This file contains hidden or 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
<?php | |
// CONFIG | |
$access_token = ''; | |
$profile_ids = ''; | |
$limit = 1; | |
$urls = array( | |
'http://feeds.feedburner.com/betabeersjobs', |
This file contains hidden or 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
// PHP >= 5.1: | |
function isWeekend($date) { | |
return (date('N', strtotime($date)) >= 6); | |
} | |
var_dump(isWeekend('2012-02-04')); | |
// PHP < 5.1: | |
function isWeekend($date) { | |
return date('w', strtotime($date)) % 6 == 0; | |
} |
This file contains hidden or 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
[ | |
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["super+alt+down"], "command": "duplicate_line" }, | |
{ "keys": ["alt+up"], "command": "swap_line_up" }, | |
{ "keys": ["alt+down"], "command": "swap_line_down" }, | |
{ "keys": ["alt+super+y"], "command": "lower_case" }, | |
{ "keys": ["alt+super+x"], "command": "upper_case" } | |
] |
NewerOlder