Skip to content

Instantly share code, notes, and snippets.

View horitaku1124's full-sized avatar

Horimatsu Takuya horitaku1124

  • Tokyo
View GitHub Profile
curl -b "PHPSESSID=abcdefg" -i -s http://localhost/ | head -n 20
@horitaku1124
horitaku1124 / trick.js
Created October 24, 2014 11:31
JavaScriptの技
var pureArray = Array.apply(null, $( "#table tr" ));
@horitaku1124
horitaku1124 / align_canvas.sh
Created November 25, 2014 05:45
キャンバスの大きさを揃える
ls *.png | xargs -I FILE convert \
FILE \
-thumbnail '46x32>' \
-gravity northwest \
-extent 46x32 \
s_FILE
@horitaku1124
horitaku1124 / config.php
Last active August 29, 2015 14:10
PHP settings
<?php
ini_set('display_errors', 1);
set_error_handler(function ($errorNo, $errorMessage, $errorFile, $errorLine) {
throw new ErrorException($errorMessage, 0, $errorNo, $errorFile, $errorLine);
});
@horitaku1124
horitaku1124 / log_to_q.rb
Last active August 29, 2015 14:11
httpdのログをq用に整形
require 'date'
file = ARGV[0] == nil ? STDIN : open(ARGV[0])
puts "ip\ta1\ta1\tdate\tmethod\tquery\tprotocol\trespond\tlength\treffer\tua\n"
while line = file.gets
line = line.gsub(/[\r\n ]$/, "")
len = line.length
inQuato = false
inCase = false
values = []
@horitaku1124
horitaku1124 / resize_icon.sh
Created January 1, 2015 12:47
icon resize for AppStore
convert -resize 120x icon.png icons/[email protected]
convert -resize 180x icon.png icons/[email protected]
convert -resize 76x icon.png icons/icon-76.png
convert -resize 152x icon.png icons/[email protected]
convert -resize 29x icon.png icons/icon-29.png
convert -resize 58x icon.png icons/[email protected]
convert -resize 87x icon.png icons/[email protected]
convert -resize 80x icon.png icons/[email protected]
convert -resize 120x icon.png icons/[email protected]
@horitaku1124
horitaku1124 / window_events.js
Last active August 29, 2015 14:13
イベントハンドリングの記述
window.addEventListener('scroll', function(event) {
console.log(window.pageYOffset);
}, false);
window.addEventListener('DOMContentLoaded', function(event) {
}, false);
@horitaku1124
horitaku1124 / mysql_tips.md
Last active June 19, 2023 02:42
MySQLのログ

General LOG

my.cnf

[mysqld]
general_log_file = /var/log/mysql/general.log
general_log=1
log-slow-queries = /var/log/mysql/slow_query.log
long_query_time = 0.5
@horitaku1124
horitaku1124 / goroutine-test1.go
Last active September 17, 2015 04:26
Testing goroutines on Go
package main
import (
"fmt"
"time"
)
func main() {
result := make(chan int)
go func() {
Object.defineProperty(String.prototype, 'to_i', {get: function() { return parseInt(this); }})
"100".to_i # => 100