Skip to content

Instantly share code, notes, and snippets.

@ken-b4u
ken-b4u / index.php
Last active September 6, 2018 10:14
Backlog Webhook
<?php
/**
* Created by IntelliJ IDEA.
* User: kmuramatsu
* Date: 2018/09/05
* Time: 18:41
*/
// 設定
const SPACE_NAME = 'space-name';
@ken-b4u
ken-b4u / cloudwatch.sh
Created July 18, 2018 02:22
CloudWatch定期実行用スクリプト(C5,M5対応済)
#!/bin/bash
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_DEFAULT_REGION=ap-northeast-1
export AWS_DEFAULT_OUTPUT=json
function exec_command() {
$1
RETURN_CODE=$?
@ken-b4u
ken-b4u / UiColor+Hex.swift
Last active October 4, 2017 06:30
AnyUIView.backgroundColor = UIColor.hexStr(hexStr: "FFFFFF", alpha: 1)
import Foundation
import UIKit
extension UIColor {
class func hexStr (hexStr : String, alpha : CGFloat) -> UIColor {
let scanner = Scanner(string: hexStr.replacingOccurrences(of: "#", with: "") as String)
var color: UInt32 = 0
if scanner.scanHexInt32(&color) {
let r = CGFloat((color & 0xFF0000) >> 16) / 255.0
let g = CGFloat((color & 0x00FF00) >> 8) / 255.0
@ken-b4u
ken-b4u / FelloPush.cs
Created June 12, 2015 22:29
修正済ソース
using UnityEngine;
#if UNITY_EDITOR || UNITY_STANDALONE
#elif UNITY_5_0 && UNITY_IPHONE
using UnityEngine.iOS;
#endif
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using LitJson;
@ken-b4u
ken-b4u / gist:70c908ae2dfc35fe0d5f
Created March 17, 2015 11:28
Cygwin環境ドットファイル
#.bash_profile
google(){
if [ $(echo $1 | egrep "^-[cfs]$") ]; then
local opt="$1"
shift
fi
local url="https://www.google.co.jp/search?q=${*// /+}"
"/cygdrive/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" "${url}"
}
if [ -f ~/.ssh-agent ]; then
@ken-b4u
ken-b4u / gist:8842026
Created February 6, 2014 10:50
UbuntuでrbenvとrubyをUbuntuユーザーの環境から呼ぶ。
sudo usermod -G ubuntu ${USER}
echo 'export PATH="/home/ubuntu/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
echo 'export PATH=$PATH:/home/ubuntu/.rbenv/shims' >> ~/.bash_profile
exec $SHELL -l
<?php
ini_set('memory_limit' ,'-1');
class SpeedTest
{
private $loop;
public function SpeedTest($num) {
$this->loop = range(0, $num);
}
/*!
* Reel JavaScript Library v1.2
*
* Copyright 2012, GREE, Inc.
*
* zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License
*
* Tue Jul 3 13:26:58 JST 2012
*/
(function () {
@ken-b4u
ken-b4u / suck while
Created May 25, 2013 06:57
generace-ken-mac:test muramatsu$ php test.php foreach int(2135035824) 0.6540470123291sec generace-ken-mac:test muramatsu$ php test.php while int(2135035824) 7.0930850505829sec
<?php
ini_set('memory_limit' ,'-1');
class TestClass
{
private $testArray;
public function setTestArray($num) {
$this->testArray = range(0, $num);
}
<?php
// -GameBaseController
class GameBaseController extends AppController {
protected $name = 'test';
}
// -GameAController
class GameAController extends GameBaseController {
public $components = array('GameExecute');