Skip to content

Instantly share code, notes, and snippets.

@JacobHsu
JacobHsu / thumbnails.html
Last active August 29, 2015 14:04
#angular.js :Display All Thumbnails
<!DOCTYPE html>
<html ng-app="gemStore">
<head>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
</head>
<body class="list-group" ng-controller="StoreController as store">
<!-- Product Container -->
<div class="list-group-item" ng-repeat="product in store.products">
@JacobHsu
JacobHsu / GalleryController.html
Last active August 29, 2015 14:04
#angular.js :Using Gallery Controller
<!DOCTYPE html>
<html ng-app="gemStore">
<head>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js"></script>
</head>
<body class="list-group" ng-controller="StoreController as store">
<header>
<h1 class="text-center">Flatlander Crafted Gems</h1>
@JacobHsu
JacobHsu / review.html
Last active August 29, 2015 14:05
#angular.js :Creating Review Controller
<!DOCTYPE html>
<html ng-app="gemStore">
<head>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
</head>
<body ng-controller="StoreController as store">
<!-- Store Header -->
@JacobHsu
JacobHsu / Element- Directive .html
Last active August 29, 2015 14:05
#angular.js :Creating an Element Directive
<!DOCTYPE html>
<html ng-app="gemStore">
<head>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js"></script>
</head>
<body ng-controller="StoreController as store">
<!-- Store Header -->
@JacobHsu
JacobHsu / substr.php
Created August 11, 2014 08:30
#php : strlen(string), rand(min, max), and substr(string, start, length)
<html>
<p>
<?php
// Use rand() to print a random number to the screen
echo rand();
?>
</p>
<p>
<?php
// Use your knowledge of strlen(), substr(), and rand() to
@JacobHsu
JacobHsu / rsort.php
Created August 12, 2014 07:33
#php : rsort , join
<html>
<p>
<?php
// Create an array with several elements in it,
// then sort it and print the joined elements to the screen
$array = array(5, 3, 7, 1);
sort($array);
print join(", ", $array);
?>
</p>
@JacobHsu
JacobHsu / arrayrand.php
Created August 12, 2014 07:58
#PHP - random value from array of name
<html>
<p>
<?php
// Create an array and push on the names
// of your closest family and friends
$arr = array();
array_push($arr,"Tom");
array_push($arr,"Mary");
array_push($arr,"Tony");
<!DOCTYPE html>
<html>
<head>
<title>Place Autocomplete Hotel Search</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@JacobHsu
JacobHsu / AngularServices.js
Created August 13, 2014 01:15
#Angular.ls : Services
(function() {
var app = angular.module('gemStore', ['store-directives']);
app.controller('StoreController', ['$http',function($http){
var store = this;
store.products = [];
$http.get('/store-products.json').success( function(data){ store.products = data;}
);
}]);
@JacobHsu
JacobHsu / gdrive_picker.html
Last active August 29, 2015 14:05
#google drive :Basic Picker
<script>
var clientId = '720409271749-hqv3lb4u0q82t68vperem5oi3kosskol.apps.googleusercontent.com';
var developerKey = 'AIzaSyBTEWsJ4aXdoOzB4ey81eX9-ja7HejL4Qc';
var accessToken;
function onApiLoad() {
gapi.load('auth', authenticateWithGoogle);
gapi.load('picker');
}
function authenticateWithGoogle() {
window.gapi.auth.authorize({