Skip to content

Instantly share code, notes, and snippets.

View kent013's full-sized avatar

ISHITOYA Kentaro kent013

View GitHub Profile
sudo amazon-linux-extras install epel
sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo amazon-linux-extras install postgresql14
sudo yum -y install libxslt httpd-mmn libXpm libraqm gd3php ncurses-compat-libs
sudo yum -y install php php-cli php-common php-gd php-mbstring php-mysqlnd php-pdo php-pecl-zip php-xml php-pgsql php-pecl-redis --enablerepo=epel,remi,remi-php82 --disablerepo=amzn2-core,amzn2extra-php8.0
sudo yum -y install redhat-indexhtml gperftools-libs
sudo yum -y install nginx php-fpm --enablerepo=epel,remi,remi-php82 --disablerepo=amzn2-core,amzn2extra-php8.0
@kent013
kent013 / showlogs.php
Created February 3, 2015 06:04
ログを読むやつ
<?php
$dir = _getArgOrDie("dir", "needs dir option");
$date = _getArgOrDie("date", "needs date");
$range = _getArg("range", 3600);
$date = strtotime(trim($date));
$logfiles = glob("$dir/*/*");
$out = false;
$timere = '/(([0-9: ]+ )?(Jan|JAN|Feb|FEB|Mar|MAR|Apr|APR|May|MAY|Jun|JUN|Jul|JUL|Aug|AUG|Sep|SEP|Oct|OCT|Nov|NOV|Dec|DEC)[0-9: ]+ |(?=\[)?(201[0-9][^ \]]+))/';
@kent013
kent013 / replace_codesign.php
Last active August 29, 2015 14:14
replace codesign
<?php
$action = _getArgOrDie("action", "action must be specified[apply, revert, set-stampcheck]");
if(!in_array($action, ["apply", "revert", "set-stampcheck"])){
_error("action must be specified and one of apply, revert");
}
$pbxproj_filename = getFilename("pbxproj");
$pbxproj_backupfilename = $pbxproj_filename . ".back";
if($action == "apply"){
@kent013
kent013 / gist:ef819f6efd707338edd4
Last active August 29, 2015 14:09
エングラ2014旅行行程表
#1日目
- 7:55 石戸谷・佐藤・西田はニコニコレンタカー杉並井草店に集合
- 8:00 レンタカー借り受け
- 8:30 石田夫妻及び電車で行く人以外は、阿佐ケ谷駅南口セブンイレブン前に集合
- https://www.google.co.jp/maps/place/%E3%82%BB%E3%83%96%E3%83%B3%E3%82%A4%E3%83%AC%E3%83%96%E3%83%B3%E3%83%BB%E9%98%BF%E4%BD%90%E8%B0%B7%E9%A7%85%E5%8D%97%E5%8F%A3%E5%BA%97/@35.70398,139.636046,15z/data=!4m2!3m1!1s0x0:0x244cde42c25ca1ab
- 8:45 車3台に分乗し出発(基本、遅刻者は待ちません電車で追いかけてください)
- 13:00 そば処あかふで昼食
- http://tabelog.com/gunma/A1003/A100301/10001973/
- http://tabelog.com/gunma/A1003/A100301/10000156/ (ポマトというのも良さそう)
@kent013
kent013 / util.php
Last active August 29, 2015 14:09
Utility functions for **** php spaghetti codes.
<?php
function _findRequestFlag($name){
if(isset($_REQUEST[$name])){
return true;
}
return false;
}
function _getRequestOrDie($name, $message){
$value = _getArg($name);
@kent013
kent013 / gist:1291d28c9f2c50c5801a
Created November 17, 2014 09:47
github issue list to str
var items = $('ul > li');
$.each(items, function(k, v){
var item = $(v);
var title = item.find('.issue-title > a').text().trim();
var number = item.data('issue-id');
var datetime = item.find('time').attr('title');
console.debug('#' + number + ' ' + title);
});
@kent013
kent013 / chatworkLogger.js
Last active August 29, 2015 14:09
chatworkLogger.js
//Open Chatwork and login
//Paste this script into JS Console.
var users = {};
var data = {}
//Do not change this value to lower than 1sec...
var loadingInterval = 1000;
var lastMessageId = null;
var loadRoomTimerId = null;
var currentRoomIndex = 0;
@kent013
kent013 / dropboxsdk.diff
Created June 5, 2012 04:22
(iOS)DropboxSDK1.2.3b1 + Add feature to push DBConnectView to specified UINavigationController
diff -crN -x '*Base64*' -x .DS_Store -x '*.pch' -x '*.plist' dropbox-ios-sdk-1.2.3-b1/DropboxSDK/Classes/DBConnectController.m DropboxSDK/DBConnectController.m
*** dropbox-ios-sdk-1.2.3-b1/DropboxSDK/Classes/DBConnectController.m 2012-06-05 11:38:42.000000000 +0900
--- DropboxSDK/DBConnectController.m 2012-06-05 13:16:39.000000000 +0900
***************
*** 37,42 ****
--- 37,43 ----
@implementation DBConnectController
@synthesize alertView;
+ @synthesize isModal;
@kent013
kent013 / gist:2035173
Created March 14, 2012 08:48
Objective-c ARC/Non-ARC compiler flag adder for tottepost
<?php
if(isset($_SERVER['argv'][1]) == false){
die("Please set xcode project file url¥n");
}
$filename = $_SERVER['argv'][1];
if(file_exists($filename) == false){
die("Project file not exist¥n");
}
@kent013
kent013 / gist:1977237
Created March 5, 2012 07:26
Converting Resources/*.lproj/Localizable.strings to one combined strings.txt
<?php
$ens = file_get_contents("tottepost/en.lproj/Localizable.strings");
$jas = file_get_contents("tottepost/ja.lproj/Localizable.strings");
$ens = mb_convert_encoding($ens, "utf-8", "utf-16");
//$jas = mb_convert_encoding($jas, "utf-8", "utf-16");
$ens = explode("\n", $ens);
$jas = explode("\n", $jas);
$strings = array();
foreach($ens as $en){