Skip to content

Instantly share code, notes, and snippets.

View coa00's full-sized avatar

cohe aoki coa00

View GitHub Profile
@coa00
coa00 / fullScreen.js
Created June 28, 2018 02:52
fullscreen を切り替えるライブラリ
export function enableFullScreen() {
const doc = window.document;
return (
doc.fullscreenEnabled ||
doc.webkitFullscreenEnabled ||
doc.mozFullscreenEnabled ||
doc.msFullscreenEnabled
);
}
@coa00
coa00 / file0.txt
Last active May 31, 2018 02:54
[webpack] [jest] Mac で動作するのに CI 環境だけ テストや ビルドが通らない ref: https://qiita.com/coa00/items/af442850013324aef486
● Test suite failed to run
Configuration error:
Could not locate module Core/api/server/BaseApi (mapped as /home/jenkins/workspace/bsr4b/BsrLib/src/js/core//api/server/BaseApi)
"resolver": undefined
// first we need to create a stage
var stage = new Konva.Stage({
container: 'container', // id of container <div>
width: 500,
height: 500
});
// then create layer
var layer = new Konva.Layer();
sips -Z 16 source.png --out icon16.png
@coa00
coa00 / file0.txt
Last active March 17, 2016 03:18
フリックでタブの切り替え表示を実装する(hammer.js) ref: http://qiita.com/coa00@github/items/dc1aa5fedd8e4ed8b1ff
var mc = new Hammer(document.getElementById("swiper"));
mc.on("swipe", function(e){処理});
@coa00
coa00 / file0.java
Last active January 22, 2016 06:36
Java Servletでリクエストパラメータの存在確認 ref: http://qiita.com/coa00@github/items/1e33fdaa5fbb2d337878
String [] keys = {"u","email"};
String ret = checkKeys(request,keys);
@coa00
coa00 / file1.js
Last active December 12, 2019 18:17
JavaScriptでユニークな文字列をさくっと生成する ref: https://qiita.com/coa00/items/679b0b5c7c468698d53f
var uuid = getUniqueStr()
@coa00
coa00 / file1.swift
Last active December 16, 2015 16:53
Swift2.0で正規表現を簡単に扱う。 ref: http://qiita.com/coa00@github/items/ae9c38dc92f3626dcd19
let pattern = "http://([a-zA-Z0-9]|.)+"
let str:String = "銘柄コード:1557,銘柄名:SPDR S&P500 ETF TRUST板価格:25270.0,板数量:10000にいびつな板(寄与率:81.20178%)を検出しました。http://oreore.com/servlets/Action?SRC=1234"
Regexp(pattern).isMatch(str) //マッチした結果 ここではtrue
let ret:[String] = Regexp(pattern).matches(str)! //http以下を取得
@coa00
coa00 / LoginController
Last active October 21, 2015 05:37
会員向けのコンテンツのLogin確認まわりを実装してみる ref: http://qiita.com/coa00@github/items/7a8e8a6433e3b1af9429
class LoginController < ApplicationController
def getPath
#何もしない
end
def in
path = session[:member_contents_path]
#保存したパスがあれば
if path.blank?
@coa00
coa00 / AppDelete.swift
Last active October 9, 2015 06:59
Swift2.0でdeviceTokenをNSUserDefaultsに保存 ref: http://qiita.com/coa00@github/items/7172665c414cfc913cc0
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// for APNs
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge], categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
// Override point for customization after application launch.
return true
}