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 / forms.cs
Created September 28, 2014 02:07
xamarin.forms sample
return new TabbedPage {
Children = {
new ContentPage {
Title = "Home",
Content = new StackLayout {
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Children = {
new Label {
Text = "Xamarin.Forms",
@YutaWatanabe
YutaWatanabe / index.jade
Created September 14, 2014 01:42
jade sample
html
head
title!= title
body
h1!= message
@YutaWatanabe
YutaWatanabe / server.js
Created September 14, 2014 01:41
Getting started with jade & express
var express = require('express');
var app = express();
app.set('view engine', 'jade');
app.set('views', './views')
app.get('/', function(req, res){
//res.send('Hello World');
res.render('index', { title: 'Express', message: 'Rendered by Jade'});
}).listen(3000);
@YutaWatanabe
YutaWatanabe / server.js
Created September 14, 2014 01:16
Getting started with Express
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hello World');
}).listen(3000);
@YutaWatanabe
YutaWatanabe / jmlist.html
Created September 8, 2014 06:40
jQuery Mobile ListView Sample
<ul data-role="listview" data-inset="true" data-filter-placeholder="Search products..." data-filter="true">
<li><a href="#">Windows</a></li>
<li><a href="#">Office</a></li>
<li><a href="#">XBOX</a></li>
<li><a href="#">Windows Phone</a></li>
<li><a href="#">Visual Studio</a></li>
<li><a href="#">Microsoft Azure</a></li>
</ul>
@YutaWatanabe
YutaWatanabe / linqtoxmlmonotouchdialog.cs
Created September 3, 2014 13:51
LINQ to XML with Monotouch.Dialog
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
//XMLファイルを読み込み
var doc = XDocument.Load ("SessionData.xml");
// LINQ to XML & Monotouch.Dialog
@YutaWatanabe
YutaWatanabe / save-geo.js
Created August 31, 2014 10:32
Save location data to mobile service
var locationTable = client.getTable("Location");
locationTable.insert({
'Latitude' : position.coords.latitude,
'Longitude' : position.coords.longitude,
'Altitude' : position.coords.altitude,
'Accuracy' : position.coords.accuracy,
'AltitudeAccuracy' : position.coords.altitudeAccuracy,
'Heading' : position.coords.heading,
'Speed' : position.coords.speed
});
@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>
@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 に対する処理
});
});