Skip to content

Instantly share code, notes, and snippets.

View mitsuruog's full-sized avatar
🏄‍♂️
Surfing

Mitsuru Ogawa mitsuruog

🏄‍♂️
Surfing
View GitHub Profile
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@mitsuruog
mitsuruog / 0_reuse_code.js
Created August 5, 2014 01:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mitsuruog
mitsuruog / bind.js
Last active April 6, 2018 01:11
multiple property databinding on SAPUI5
new sap.m.Text({
text: {
parts: [
{path: "Width"},
{path: "Depth"},
{path: "Height"},
{path: "DimUnit"}
],
formatter: function(width, depth, height, dimUnit){
return width + " x " + depth + " x " + height + " " + dimUnit;
@mitsuruog
mitsuruog / jsbin.rowib.coffee
Last active February 18, 2019 10:50
OpenUI5 Google map demo on JSBin. http://jsbin.com/rowib/1/edit
@dialog = new sap.m.Dialog
title: "Google Map"
content: [
new sap.ui.core.HTML
content: "<div id='mapConteiner'></div>"
]
#ダイアログ閉じる処理
beginButton: sap.m.Button
text: "close"
button = new sap.m.Button
text: "Action!!"
press: [message: "Hello :)", (evt, param) ->
jQuery.sap.require "sap.m.MessageToast"
sap.m.MessageToast.show param.message
]
button.placeAt "content"
@mitsuruog
mitsuruog / settings.js
Created May 19, 2014 02:41
Fiddler2でのリバースプロキシ設定ルール例
if (oSession.HostnameIs("localhost") && oSession.uriContains("/odata/")) {
oSession.host = "10.100.100.100:8000";
oSession.PathAndQuery = oSession.PathAndQuery.replace("bank/", "");
}
@mitsuruog
mitsuruog / proxy.py
Created May 19, 2014 01:00
SublimeText2のPackageControlがProxy環境下でインストールが出来ない場合のメモ
http://qiita.com/n_morioka/items/a7a52314aeb2ab86fa61
import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler({'http': 'http://proxyアドレス:8080'})) ); by = urllib2.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
@mitsuruog
mitsuruog / Detail.fragments.coffee
Last active December 29, 2019 01:46
Fragments in SAPUI5
sap.ui.jsfragment "util.Detail",
createContent: (oController) ->
# ここに普通のJSViewのcreateContentと同様にUIコントロールを追加して
# 最後にreturnします。
@mitsuruog
mitsuruog / setting.js
Created April 1, 2014 15:12
Fidder2 reverse proxy rule.
static function OnBeforeRequest(oSession: Session) {
// ...
//services.odata.orgへのリバースプロキシ設定
//
//localhostdで/Northwind/というコンテキストがある場合に
//services.odata.org:80ドメインへリクエストを投げます。
if (oSession.HostnameIs("localhost") && oSession.uriContains("/Northwind/")) {
oSession.host = "services.odata.org:80";
@mitsuruog
mitsuruog / Gruntfile1.js
Last active August 29, 2015 13:57
CoffeeScriptのコンパイルタスク
coffee: {
compile: {
files: {
// 1:1 コンパイル
'path/to/result.js': 'path/to/source.coffee',
// コンパイルして1つのファイルに結合
'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee']
}
}
}