Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View matsubo's full-sized avatar

Yuki Matsukura matsubo

View GitHub Profile
<VirtualHost *:80>
RewriteEngine on
RewriteRule ^/(.*) blah [R=503]
</VirtualHost>
@Craftworks
Craftworks / mymemcheck
Created December 8, 2010 15:14
MySQL memory configuration check tool
#!/usr/bin/env perl
use strict;
use warnings;
my @GLOBAL_BUFFERS = qw(
key_buffer_size
innodb_buffer_pool_size
innodb_log_buffer_size
innodb_additional_mem_pool_size
@u1tnk
u1tnk / image magick fill resize
Created April 18, 2011 13:13
ImageMagickで指定サイズで空白を埋める。
convert input.jpg -resize 1024x1024\> -size 1024x1024 xc:white +swap -gravity center -composite output.jpg
@robflaherty
robflaherty / csv-to-json.php
Created September 1, 2011 02:26
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@kinopyo
kinopyo / rspec_shared_context_example.rb
Created October 13, 2011 10:08
rspec shared_context sample codes.
shared_context "shared stuff" do
before { @some_var = :some_value }
def shared_method
"it works"
end
let(:shared_let) { {'arbitrary' => 'object'} }
subject do
'this is the subject'
end
end
@tanakahisateru
tanakahisateru / gist:1344162
Created November 7, 2011 04:18
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@leesmith
leesmith / commit-message-syntax.txt
Created December 31, 2011 06:05
Pivotal Tracker post-commit message syntax
https://www.pivotaltracker.com/help/api?version=v3#github_hooks
https://www.pivotaltracker.com/help/api?version=v3#scm_post_commit_message_syntax
SCM Post-Commit Message Syntax
To associate an SCM commit with a specific Tracker story, you must include a special syntax in the commit message to indicate one or more story IDs and (optionally) a state change for the story. Your commit message should have square brackets containing a hash mark followed by the story ID. If a story was not already started (it was in the "not started" state), a commit message will automatically start it. For example, if Scotty uses the following message when committing SCM revision 54321:
[#12345677 #12345678] Diverting power from warp drive to torpedoes.
@matope
matope / NoSQLデータモデリング技法.markdown
Created April 16, 2012 03:35
NoSQLデータモデリング技法

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@michaelcox
michaelcox / xdr.js
Created May 10, 2012 18:56
Adds XDomainRequest IE CORS support to jQuery
// Based on https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js
(function( jQuery ) {
if ( window.XDomainRequest && !jQuery.support.cors ) {
jQuery.ajaxTransport(function( s ) {
if ( s.crossDomain && s.async ) {
if ( s.timeout ) {
s.xdrTimeout = s.timeout;
delete s.timeout;