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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>PhoneGap Events Example</title> | |
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script> | |
<script type="text/javascript" charset="utf-8" src="tts.js"></script> | |
<script type="text/javascript" charset="utf-8"> |
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 UILabel (dynamicSizeMe) | |
-(float)resizeToFit; | |
-(float)expectedHeight; | |
@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
@interface MoonPhase : NSObject { | |
@private | |
NSDate *now; | |
} | |
- (float) phase; | |
@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
// | |
// TransitionController.h | |
// | |
// Created by XJones on 11/25/11. | |
// | |
#import <UIKit/UIKit.h> | |
@interface TransitionController : UIViewController |
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
/* | |
* 1) Download CocoaHTTPServer from Github: https://github.com/robbiehanson/CocoaHTTPServer | |
* 2) Include the downloaded source (except the samples) in your project | |
* 3) Define the SCREENCAST macro for the target/configuration you want to enable the screencast for (SCREENCAST=1) | |
* 4) Add the code below to your main.m file before the main() method | |
*/ | |
#if SCREENCAST | |
#import "HTTPServer.h" | |
#import "HTTPConnection.h" |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
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
var cast = { | |
"Adm. Adama" : "Edward James Olmos", | |
"President Roslin" : "Mary McDonnell", | |
"Captain Adama" : "Jamie Bamber", | |
"Gaius Baltar" : "James Callis", | |
"Number Six" : "Tricia Helfer", | |
"Kara Thrace" : " Katee Sackhoff" | |
}; | |
// Stores the JavaScript object as a string |
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
// Get a reference to the image element | |
var elephant = document.getElementById("elephant"); | |
// Take action when the image has loaded | |
elephant.addEventListener("load", function () { | |
var imgCanvas = document.createElement("canvas"), | |
imgContext = imgCanvas.getContext("2d"); | |
// Make sure canvas is as big as the picture | |
imgCanvas.width = elephant.width; |
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
<figure> | |
<img id="elephant" src="about:blank" alt="A close up of an elephant"> | |
<noscript> | |
<img src="elephant.png" alt="A close up of an elephant"> | |
</noscript> | |
<figcaption>A mighty big elephant, and mighty close too!</figcaption> | |
</figure> |
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
// localStorage with image | |
var storageFiles = JSON.parse(localStorage.getItem("storageFiles")) || {}, | |
elephant = document.getElementById("elephant"), | |
storageFilesDate = storageFiles.date, | |
date = new Date(), | |
todaysDate = (date.getMonth() + 1).toString() + date.getDate().toString(); | |
// Compare date and create localStorage if it's not existing/too old | |
if (typeof storageFilesDate === "undefined" || storageFilesDate < todaysDate) { | |
// Take action when the image has loaded |
OlderNewer