Skip to content

Instantly share code, notes, and snippets.

View tdtsh's full-sized avatar

T.Hanazaki tdtsh

View GitHub Profile
@tdtsh
tdtsh / 20120921_test
Created September 21, 2012 10:11
テストです
String httpProtocol = request.getScheme();
timSrv.deleteComment(owner, commentID, httpProtocol);
Map<String, String> jsonData = new HashMap<String, String>();
Titanium Alloy での ListView のイベントハンドリング
Alloyでのclickイベント制御の書き方の一例です。
```/app/controller/sample.js
var data = [];
...
data.push({
@tdtsh
tdtsh / gist:53c8372f690cd0b018f9
Created August 23, 2014 23:14
underscore.js の debounce を使うと Android でコケるの発生条件
index.xml
<Alloy>
<Window>
<Button onClick="testMe">Button</Button>
</Window>
</Alloy>
index.js
$.index.open();
@tdtsh
tdtsh / app.tss
Last active August 29, 2015 14:06
app.tss template - Titanium Alloy
'Window': {
backgroundColor: '#ffffff', // 画面背景色
barColor: "aqua", // ナビゲーションバーの背景色
tintColor : "red", // 配下のViewの色合いに影響 (TextAreaのキャレット色とか)
navTintColor : "blue", // 子Windowで戻るのクチバシの色とか
@tdtsh
tdtsh / Electron quick start main.js
Last active April 19, 2016 22:20
Electron quick start main.js
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow = null;
@tdtsh
tdtsh / index.html
Created June 14, 2015 02:06
Electron quick start index.html
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using io.js <script>document.write(process.version)</script>
and Electron <script>document.write(process.versions['electron'])</script>.
</body>
{
"env": {
"node": true,
"es6": true,
"modules": true
},
"ecmaFeatures": {
"jsx": true,
"blockBindings": true,
"forOf" : true,
@tdtsh
tdtsh / CameraViewController.swift
Last active January 17, 2016 07:01
Swift2 で AVCaptureStillImageOutput を使ったカメラ撮影
//
// CameraViewController.swift
//
// Created by Tadatoshi Hanazaki on 2016/01/17.
// Copyright © 2016年 close-to.biz. All rights reserved.
//
import UIKit
import AVFoundation
@tdtsh
tdtsh / MasterViewController.swift
Created January 17, 2016 02:28
Swift2 で NavigationBar の 右にボタンを複数追加
override func viewDidLoad() {
super.viewDidLoad()
// ボタン達
let addButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Add, target: self, action: "insertNewObject:")
let cameraButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Camera, target: self, action: "insertNewObject:")
let myRightButtons = [addButton, cameraButton]
// テンプレはこうだった
@tdtsh
tdtsh / MasterViewController.swift
Last active January 17, 2016 02:34
Swift2 で Alert を表示
class MasterViewController: UITableViewController {
...
override func viewDidLoad() {
...
let cameraButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Camera, target: self, action: "doCamera:")
...
}
...
func doCamera(sender: UIButton) {