Skip to content

Instantly share code, notes, and snippets.

View oppara's full-sized avatar
:octocat:
::

oppara oppara

:octocat:
::
View GitHub Profile
@oppara
oppara / phpStylist.sh
Created October 6, 2011 14:25
phptidy(phpStylist)
#!/bin/sh
# http://sourceforge.net/projects/phpstylist/
php=`which php`
stylist="/path/to/phpStylist.php"
$php $stylist "$@" \
--indent_size 4 \
--line_before_comment_multi \
@oppara
oppara / truncate.css
Created December 2, 2011 15:57
Truncating text using only CSS
/* http://amix.dk/blog/post/19661 */
.link_truncated {
display: inline-block;
width: 275px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
vertical-align: top;
}
@oppara
oppara / expand-input-maxlen.patch
Created April 15, 2012 14:49 — forked from yoshikaw/Screenx.rb
開発版GNU Screenにあてているパッチ
Patch: expand-input-maxlen.patch
Probrem: More than 100 characters cannot be set to the caption
Solution: expands the text buffer size to 255.
Author: Kazuhiro Yoshikawa <[email protected]>
Files: src/input.c
src/process.c
--- a/src/input.c 2010-02-27 02:30:55.000000000 +0900
+++ b/src/input.c 2010-06-21 00:19:43.000000000 +0900
@@ -43,7 +43,7 @@
@oppara
oppara / gist:2590148
Created May 3, 2012 22:53 — forked from splhack/gist:2583086
Use Xcode 4.3.2 as Xcode 4.2 or earlier without Command Line Tools
sudo mkdir /Developer
cd /Developer
sudo chown `id -u` .
ln -s /Applications/Xcode.app/Contents/Developer/* .
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs .
@oppara
oppara / dot.zshrc_comp
Created May 8, 2012 13:59
Zshでサブコマンドとファイル名を手抜き補完する
compdef _hogecmd hoge
function _hogecmd {
local -a cmds
if (( CURRENT == 2 ));then
cmds=('init' 'update' 'upgrade' 'commit')
_describe -t commands "subcommand" cmds
else
_files
fi
@oppara
oppara / md2tt.pl
Created May 10, 2012 04:52
markdown記法をtextile記法に適当に変換
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
#
# markdown記法をtextile記法に変換
# 超簡易版
#
# Usage:
@oppara
oppara / gist:2761041
Created May 21, 2012 07:53
jQueryをロードする際のナイス!と思った書き方
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
function assert(condition, opt_message) {
if (!condition) {
if (window.console) {
// メッセージの表示
console.log('Assertion Failure');
if (opt_message) console.log('Message: ' + opt_message);
// スタックトレースの表示

author thinca date 2012/05/27 place yokohama.vim #3 font VL ゴシック 26 font Migu_2M:h38:cSHIFTJIS

quickrun.vim の 詳解

2012/05/27 yokohama.vim #3 thinca

@oppara
oppara / bootstrap-button-group.html
Created May 30, 2012 16:25
bootstrap-button-group
<section>
<div id="sex-btns" class="btn-group" data-toggle="buttons-checkbox">
<button id="male" value="male" class="btn">男</button>
<button id="female" value="female" class="btn">女</button>
<button id="unknown" value="unknown" class="btn">不明</button>
</div>
<form action="javascript:alert($('#sex').val());">
<input id="sex" type="hidden" name="sex" value="">
<input type="submit">