This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;scratch の初期メッセージを消す | |
(setq initial-scratch-message "") | |
;;ツールバー不要 | |
(tool-bar-mode -1) | |
;;スタートアップ画面を表示しない | |
(setq inhibit-startup-message t) | |
;; 対応するカッコを強調表示 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Ruby >= 2.0.0 | |
class Rubyist | |
def initialize | |
@ibukuro = Ibukuro.new | |
end | |
def mgmg(takoyaki) | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ねえねえ今どんな気持ち? | |
// @namespace http://udzura.jp/kokubun | |
// @description 国分太一fier | |
// @include https://www.facebook.com/* | |
// @version 0.0.1.20121205 | |
// ==/UserScript== | |
(function () { | |
function pingTaichi () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install cairo | |
brew link cairo | |
brew install pango | |
brew install gtk+ | |
brew install poppler --with-glib | |
brew install librsvg | |
brew tap homebrew/versions | |
brew install gstreamer010 | |
brew install gst-plugins-base010 | |
PKG_CONFIG_PATH=/usr/local/opt/libxml2/lib/pkgconfig gem i rabbit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '#include <stdio.h>' > source.c | |
cat $1 >> source.c | |
gcc source.c | |
rm source.c | |
./a.out | |
rm a.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 から n までの連続数を足す関数 | |
def sum_one_to(n) | |
(1+n)*(n/2)+(1+n)/2*(n%2) | |
end | |
# ↑のほうが↓よりも圧倒的に高速 | |
def sum_one_to(n) | |
(1..n).inject(0){|m,n| m+=n} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..100).to_a.each_slice(15).to_a | |
#=> [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], | |
# [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30], | |
# [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], | |
# [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60], | |
# [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75], | |
# [76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], | |
# [91, 92, 93, 94, 95, 96, 97, 98, 99, 100]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var total = 0; | |
var year = '2012'; | |
function init(num) { | |
num = (typeof num !== 'number' ? 0 : num); | |
if(num === 0) { | |
$('<div/>').css({ | |
position: 'fixed', | |
left: 0, | |
top: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PostgreSQL 9.2 で動作確認 | |
create extension tablefunc | |
; | |
select * | |
from crosstab(' | |
select year, month, 5 | |
from generate_series(2009, 2013) as year | |
cross join generate_series(1, 12) as month', ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"8A4682B382F182B182F182C982BF82CD". | |
split(""). | |
each_slice(2). | |
map{|a| a.join.hex}. | |
each_slice(2). | |
map{|a| a.pack("c*").encode("utf-8", "Shift_JIS")}. | |
join |
OlderNewer