Skip to content

Instantly share code, notes, and snippets.

@masayuki5160
masayuki5160 / q02.php
Created February 16, 2016 13:49
プログラマ脳を鍛える数学パズルQ02
<?php
error_reporting(0);// division by zeroのワーニング回避
$expression = array("+","-","*","/","");
for($num = 1000; $num <= 9999;$num++){
foreach($expression as $i){
// 1つめの間
foreach($expression as $j){
// 2つ目の間
@masayuki5160
masayuki5160 / q01.php
Created January 31, 2016 05:26
プログラマ脳を鍛える数学パズルQ01
<?php
for($i = 10; $i <= 1000; $i++){
if($i == strrev($i)
&& decbin($i) == strrev(decbin($i))
&& decoct($i) == strrev(decoct($i))){// 回文数だったら
echo $i. "\n";
echo decbin($i). "\n";
echo decoct($i). "\n";
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
ls -l /etc/yum.repos.d/
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum install jenkins
service jenkins start
chkconfig jenkins on
@masayuki5160
masayuki5160 / OnsenUI_Web.html
Created December 24, 2015 06:49
WebサイトでOnsenUIを使う
<!DOCTYPE html>
<html>
<head>
<title>Onsen UI</title>
<link rel='stylesheet' href='https://cdn.rawgit.com/OnsenUI/OnsenUI/1.3.11/build/css/onsenui.css' />
<link rel='stylesheet' href='https://cdn.rawgit.com/OnsenUI/OnsenUI/1.3.11/build/css/onsen-css-components.css' />
<script src='https://cdn.rawgit.com/OnsenUI/OnsenUI/1.3.11/build/js/angular/angular.min.js'></script>
<script src='https://cdn.rawgit.com/OnsenUI/OnsenUI/1.3.11/build/js/onsenui.min.js'></script>
<script>
@masayuki5160
masayuki5160 / apache-import.conf
Last active January 31, 2016 12:07
elasticsearchをちゃんとさわってみたときの作業ログ
input {
stdin { }
}
filter {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
@masayuki5160
masayuki5160 / google-big-queryの場合のconf
Last active June 3, 2016 10:23
fluentdの設定をいろいろ試して検証している
<source>
type forward
</source>
## Processor Server
<match apache.access>
type bigquery
method insert
@masayuki5160
masayuki5160 / OnsenUI_lesson
Created December 14, 2015 08:04
動的に追加をしたときはコンポーネントの再コンパイルが必要になる
動的にOnsenUIのコンポーネントを追加したいとき
//メニュー画面に遷移するボタンを表示させる
var btn = $("<ons-button onclick='quizNavi.resetToPage(\"menu.html\")'>メニューに戻る</ons-button>");
btn.appendTo($("#question"));
ons.compile(btn[0]);
参考:OnsenUIの要素をJavaScriptで動的に表示する場合
http://mb.cloud.nifty.com/doc/current/tutorial/monaca_quiz_02.html
@masayuki5160
masayuki5160 / td-agent, s3 plugin
Last active December 16, 2015 07:10
td-agentのs3 Pluginを使っている
$curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh
$sudo /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-parser
$sudo /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-s3
$sudo /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-bigquery
$sudo chmod 755 -R /var/log/httpd/
$sudo vi /etc/td-agent/td-agent.conf
###
## Output descriptions:
@masayuki5160
masayuki5160 / メモ
Last active November 2, 2015 05:26
ログ収集
Check! はじめての Fluentd 〜 IAMロールで Amazon EC2 と S3 間をセキュアに
http://qiita.com/dz_/items/224607c84112ccafa2d6
AWS EC2上にfluentd + fluent-plugin-twitter + elasticsearch + kibana インストールするメモ
http://qiita.com/ayaniimi213/items/4197a295c13b59166e8c
@masayuki5160
masayuki5160 / BuildBatch.cs
Last active March 7, 2018 02:38
UnityでAndroid,iOSビルドを自動化するために試行錯誤
using UnityEngine;
using UnityEditor;
using System.Collections;
public class BuildBatch : MonoBehaviour {
// build iOS app
[UnityEditor.MenuItem("Tools/Build Project AllScene iOS")]
private static void BuildiOS(){