Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View YutaWatanabe's full-sized avatar

Yuta Watanabe YutaWatanabe

  • Civitas, Inc.
  • Tokyo, Japan
View GitHub Profile
@YutaWatanabe
YutaWatanabe / angular-scope-apply.js
Created August 13, 2014 11:07
AngularJS $scope.$apply
$scope.$apply(function(){
//$scopeの更新処理
});
// または
// $scopeの更新処理
$scope.$apply();
@YutaWatanabe
YutaWatanabe / delete-item-ams.js
Created August 22, 2014 01:09
Delete the item in Azure Mobile Service
(function(){
// MobileServiceClient のインスタンスを作成
// URL, KEY は管理画面に表示されているものを貼り付け
var client = new WindowsAzure.MobileServiceClient(
"URL",
"KEY"
);
// Item テーブルのインスタンス取得
@YutaWatanabe
YutaWatanabe / update-item-with-ams.js
Created August 22, 2014 01:00
Update the created item in Azure Mobile Service
(function(){
// MobileServiceClient のインスタンスを作成
// URL, KEY は管理画面に表示されているものを貼り付け
var client = new WindowsAzure.MobileServiceClient(
"URL",
"KEY"
);
// Item テーブルのインスタンス取得
@YutaWatanabe
YutaWatanabe / index.html
Created August 22, 2014 00:08
Import the azure mobile services library.
<script src="http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.1.3.min.js"></script>
@YutaWatanabe
YutaWatanabe / create-read-mobile-service.js
Created August 22, 2014 00:34
Create and read items with Azure Mobile Service.
(function(){
// MobileServiceClient のインスタンスを作成
// URL, KEY は管理画面に表示されているものを貼り付け
var client = new WindowsAzure.MobileServiceClient(
"URL",
"KEY"
);
// Item テーブルのインスタンス取得
@YutaWatanabe
YutaWatanabe / MobileServiceClientInit.js
Last active August 29, 2015 14:05
Initialization of azure mobile service client.
(function(){
var client = new WindowsAzure.MobileServiceClient(
"URL",
"KEY"
);
// URL, KEY は管理画面に表示されているものを貼り付け
//このあと client を使ってモバイル サービス のデータにアクセスしていきます
@YutaWatanabe
YutaWatanabe / dstest.js
Created August 28, 2014 08:21
dynamic-scheme-test
var itemTable = client.getTable("Item");
itemTable.insert(
{text: "Sample Item", dynamic: true, date: "2014-08-28T12:00:00Z"}
);
@YutaWatanabe
YutaWatanabe / data-read-advanced.js
Created August 28, 2014 09:08
data read method of azure mobile services
// テーブルのすべての項目の読出します
itemTable.read()
.then(function(items){
// 配列で項目が返ってきます
$each(items, function(i, e){
// 項目 i に対する処理
});
});
@YutaWatanabe
YutaWatanabe / getgeo.js
Created August 31, 2014 10:31
PhoneGap get geo code
var onSuccess = function(position) {
alert('Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Altitude: ' + position.coords.altitude + '\n' +
'Accuracy: ' + position.coords.accuracy + '\n' +
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' +
'Heading: ' + position.coords.heading + '\n' +
'Speed: ' + position.coords.speed + '\n' +
'Timestamp: ' + position.timestamp + '\n');
@YutaWatanabe
YutaWatanabe / button.html
Created August 31, 2014 10:29
Button sample
<button id="eventButton">Click</button>