Skip to content

Instantly share code, notes, and snippets.

View horitaku1124's full-sized avatar

Horimatsu Takuya horitaku1124

  • Tokyo
View GitHub Profile
@horitaku1124
horitaku1124 / htdigest.md
Last active August 29, 2015 14:03
ダイジェスト認証

.htaccess

AuthType Digest
AuthName "Secret Zone"
AuthUserFile /etc/httpd/.htdigest
Require valid-user
htdigest -c /etc/httpd/.htdigest 'Secret Zone' username
@horitaku1124
horitaku1124 / httpd.conf
Created June 22, 2014 04:31
Apache 2.4の設定
<Directory />
AllowOverride All
Require all granted
</Directory>
@horitaku1124
horitaku1124 / laravel.md
Last active August 29, 2015 14:02
Laravel

Blade

return View::make('posts.index', ['id' => '<b>123</b>']);
Direct output : {{ $id }}

Escaped output : {{{ $id }}}
data = [7,13,17,24]
primes = [3,11]
pubkey1 = primes[0] * primes[1]
pubkey2 = (primes[0] - 1) * (primes[1] - 1)
key2 = 3
encd = data.map do |e|( e ** key2 )% pubkey1 end
p encd
@horitaku1124
horitaku1124 / scalar-objects-test.php
Created May 4, 2014 17:26
PHP Scalar Objectのテスト
<?php
class StringExtension {
public function replace($search, $replace) {
return str_replace($search, $replace, $this);
}
public function preg_replace($pattern, $replacement) {
return preg_replace($pattern, $replacement, $this);
}
@horitaku1124
horitaku1124 / daily_copy.sh
Created April 21, 2014 12:24
1日以内に更新された、htmlとcssをコピー
find . -mtime -1 -name "*.html" -o -name "*.css" | xargs -I FILE cp FILE /path/to/FILE
@horitaku1124
horitaku1124 / linux_commands.md
Created April 4, 2014 07:18
Linuxでのコマンド組み合わせ

ログファイルの最後のN行

find . -name '*.log' | xargs tail -n 4
@horitaku1124
horitaku1124 / curl_usage.md
Last active August 29, 2015 13:57
curlのオプションの指定の仕方

Cookieを保存

$ curl -c cookie URL

Cookieを送信

$ curl -b cookie URL
@horitaku1124
horitaku1124 / 2.htaccess
Created February 15, 2014 12:43
ダイジェスト認証をする
# htdigest -c /etc/httpd/.htdigest 'Secret Zone' username
AuthType Digest
AuthName "Secret Zone"
AuthUserFile /etc/httpd/.htdigest
Require user username
find | grep .zip | xargs -I file cp file ./dist/
unzip \*.zip