Skip to content

Instantly share code, notes, and snippets.

View ryugoo's full-sized avatar

Ryutaro Miyashita ryugoo

View GitHub Profile
@ryugoo
ryugoo / ltsv.js
Last active December 12, 2015 07:29 — forked from tomotaka/ltsv.dart
/*jslint devel:true */
/*global window, exports */
(function (root) {
"use strict";
// Prototype extension
if (!Array.prototype.removeAt) {
Array.prototype.removeAt = function (idx) {
if (typeof idx !== "number") {
throw new TypeError("removeAt argument is required Integer");
@ryugoo
ryugoo / app.js
Created January 27, 2013 07:03
Titanium 2.1.1.GA isArray check
/*jslint devel: true */
/*global Titanium, require */
(function (Ti, require) {
"use strict";
// モジュール
var style = require("style"),
lib = require("lib"),
// UI コンポーネント
win = Ti.UI.createWindow(style.win),
thisHeadlineLabel = Ti.UI.createLabel(style.headlineLabel),
@ryugoo
ryugoo / stylus.jmk.js
Last active December 11, 2015 17:49
Stylus to Alloy JMK
var fs = require("fs");
var path = require("path");
var util = require("util");
var styl = require("stylus");
var wrench = require("wrench");
function compileTSS(root, view) {
var data = fs.readFileSync(path.join(root, view), "utf8"),
tss;
styl.render(data, function (err, css) {
@ryugoo
ryugoo / test_keyword_args.rb
Created January 16, 2013 16:50
Ruby 2.0.0 keyword arguments test
def p1(*args, **kwargs)
print args
print "\n"
print kwargs
end
p1
#=> []
#=> {}
@ryugoo
ryugoo / app.coffee
Created December 3, 2012 15:50
TiPlatformConnect with Pocket
do (Ti) ->
# Load CommonJS modules
pocket = require("pocket").Pocket
consumerKey: "" # PLEASE GET CONSUMER KEY at http://getpocket.com/developer/
accessTokenKey: Ti.App.Properties.getString "pocketAccessTokenKey", ""
pocketUserName: Ti.App.Properties.getString "pocketUserName", ""
# Build user interface component
win = Ti.UI.createWindow
backgroundColor: "#FFFFFF"
@ryugoo
ryugoo / app.js
Created November 16, 2012 05:06
HTTPClient send boolean values.
(function () {
var win = Ti.UI.createWindow({
title: "Window",
backgroundColor: "#FFFFFF"
}),
tableView = Ti.UI.createTableView({
data: []
}),
http = Ti.Network.createHTTPClient();
win.add(tableView);
@ryugoo
ryugoo / app.coffee
Created November 9, 2012 03:03
シングルコンテキストでウィンドウを開く
# Application global object
apps = apps or {}
# Entry point
do ->
# Window
win1 = require("win1").init(apps);
# Tab
tab = Ti.UI.createTab
icon: "KS_nav_ui.png"
@ryugoo
ryugoo / app.coffee
Created November 8, 2012 15:57
マルチコンテキストでウィンドウを開く
do ->
# Main window
win = Ti.UI.createWindow
url: "win1.js"
# Tab
tab = Ti.UI.createTab
title: "Apps"
icon: "KS_nav_ui.png"
window: win
tabGroup = Ti.UI.createTabGroup()
@ryugoo
ryugoo / app.js
Created October 31, 2012 02:06
iOS TableViewRow longpress event emulation (Titanium Mobile)
(function () {
// Base window
var base = Ti.UI.createWindow({
backgroundColor: "#FFFFFF",
title: "Long Press"
});
// TableView
var tableView = Ti.UI.createTableView({
data: [],
@ryugoo
ryugoo / app.js
Created October 2, 2012 16:34
TypeScript for Titanium Mobile test application
var MyTabGroup = (function () {
function MyTabGroup() {
this.tabGroup = Ti.UI.createTabGroup();
}
MyTabGroup.prototype.appendTab = function (params) {
for(var i = 0, l = params.length; i < l; i++) {
this.tabGroup.addTab(Ti.UI.createTab(params[i]));
}
};
MyTabGroup.prototype.open = function () {