Skip to content

Instantly share code, notes, and snippets.

View ikuwow's full-sized avatar

Ikuo Degawa ikuwow

View GitHub Profile
@ikuwow
ikuwow / AppController.php
Created September 19, 2015 14:30
CakePHP2系で画像がなかったらnoimage画像を出す ref: http://qiita.com/ikuwow/items/29f950a7d7924ba92035
class AppController extends Controller {
public $helpers = array(
'Html' => array('className' => 'CustomHtml')
);
(略)
}
@ikuwow
ikuwow / file1.txt
Last active December 25, 2015 02:14
GitLabからwebhook+PHPで超簡易自動デプロイシステムを作る ref: http://qiita.com/ikuwow/items/5794123bf4c379771d1c
http://webhook.mydomain.com/release.php?key=secretkey
@ikuwow
ikuwow / UsersController.php
Created August 15, 2015 09:39
CakePHP2でのElementキャッシュで見た目から処理を減らしていく ref: http://qiita.com/ikuwow/items/bf2e0e4c2ca289a3655d
public function getUserRanking() {
if ($this->request->is('requested')) {
// requestAction()時のみrankingを返す
return $this->UserRanking->getUserRanking();
}
throw new BadRequestException();
}
@ikuwow
ikuwow / .gitignore
Created May 2, 2015 04:06
CakePHP2をComposerでサクッとセットアップする ref: http://qiita.com/ikuwow/items/748613ba234415cc7b0b
/vendors
/plugins
/app/tmp/*
/app/Config/core.php
/app/Config/database.php
@ikuwow
ikuwow / gist:911e9f9ec88d673c9671
Last active August 29, 2015 14:19
fizzbuzz_by_VBA
Sub fizzBuzz()
maxNumber = 100
Message = ""
For num = 1 To maxNumber
Message = Message & ", "
@ikuwow
ikuwow / file1.txt
Last active September 20, 2015 02:01
簡便なSafariとChromeのメモリ使用量の測定方法 ref: http://qiita.com/ikuwow/items/976166b30610f33f4643
$ sh safari_vs_chrome.sh &
@ikuwow
ikuwow / 0_reuse_code.js
Last active August 29, 2015 14:17
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
ASK: [List Installed Vagrant Plugins] ****************************************
ok: [localhost]
TASK: [Install Vagrant Plugins] ***********************************************
skipping: [localhost] => (item=vagrant-omnibus)
skipping: [localhost] => (item=vagrant-vbguest)
skipping: [localhost] => (item=vagrant-cachier)
skipping: [localhost] => (item=vagrant-vbox-snapshot)
skipping: [localhost] => (item=vagrant-aws)
skipping: [localhost] => (item=vagrant-digitalocean)
@ikuwow
ikuwow / file0.txt
Created March 15, 2015 09:13
'No backend type is specified. Fall back to :exec type.'が大量に出てくる場合の対処法 ref: http://qiita.com/ikuwow/items/abdce2b4118f07241bc8
$ kitchen verify
-----> Starting Kitchen (v1.3.1)
-----> Verifying <default-ubuntu-1410>...
Removing /tmp/busser/suites/serverspec
Uploading /tmp/busser/suites/serverspec/base_spec.rb (mode=0644)
-----> Running serverspec test suite
/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.2.2/lib:/tmp/busser/gems/gems/rspec-core-3.2.2/lib /opt/chef/embedded/bin/rspec --pattern /tmp/busser/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/busser/suites/serverspec
Command "getenforce"
stdout
@ikuwow
ikuwow / file0.txt
Last active August 22, 2016 11:06
opensslコマンドで簡単なファイル暗号化 ref: http://qiita.com/ikuwow/items/1cdb057352c06fd3d727
$ openssl aes-256-cbc -e -in rawtext.txt -out encrypted.txt
enter aes-256-cbc encryption password: # パスワード入力
Verifying - enter aes-256-cbc encryption password: # もう一度