Skip to content

Instantly share code, notes, and snippets.

View aereal's full-sized avatar

aereal aereal

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OViRjbGFzc1xOU0NvbG9yU3BhY2VVTlNSR0KAAhAC
TxAnMC4yNTM2Njg4MDU5IDAuNDgwNDczMDg4NSAwLjY3ODYxNjQzMTUA0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
$ padrino console
pry(main)> Page.find_by_title("Vimperator").revisions.last.parent
DEBUG - [16/Aug/2011 20:06:10] "MONGODB wiki_ps_development['pages'].find({:title=>"Vimperator"})"
NoMethodError: undefined method `find_by_id' for Revision:Class
from /Users/aereal/.rvm/gems/ruby-1.9.2-p290/gems/mongo_mapper-0.9.1/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb:40:in `find_target'
pry(main)> (vimp_page = Page.find_by_title("Vimperator")).revise(created_at: Time.now, body: "hogefuga", parent: vimp_page.revisions.first)
DEBUG - [16/Aug/2011 20:08:07] "MONGODB wiki_ps_development['pages'].find({:title=>"Vimperator"})"
DEBUG - [16/Aug/2011 20:08:07] "MONGODB wiki_ps_development['pages'].update({:_id=>BSON::ObjectId('4e4a4ec2fadbabd39f000008')}, {"_id"=>BSON::ObjectId('4e4a4ec2fadbabd39f000008'), "title"=>"Vimperator", "created_at"=>2011-08-16 11:04:34 UTC, "updated_at"=>2011-08-16 11:08:07 UTC, "revisions"=>[{"_id"=>BSON::ObjectId('4e4a4ec2fadbabd39f00000a'), "body"=>"Make Firefox look and behave
@aereal
aereal / gist:1234345
Created September 22, 2011 08:34
my MacVim version
% /Applications/MacVim.app/Contents/MacOS/Vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 19 2011 13:30:39)
MacOS X (unix) 版
適用済パッチ: 1-315
Compiled by sakamoto@macbook.local
Huge 版 with MacVim GUI. 機能の一覧 有効(+)/無効(-)
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
require 'formula'
class RubyRefm < Formula
url 'http://doc.ruby-lang.org/archives/201107/ruby-refm-1.9.2-dynamic-20110729.tar.gz'
homepage 'http://redmine.ruby-lang.org/projects/rurema/'
md5 '537f4f50272cea1ae20f5e08a025aa51'
def options
[
['--1.8.7', 'search the 1.8.7 manuals by default.']
$ ./configure --version
configure
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
@aereal
aereal / ruby-1.9.2-p290-with-ruby-build.rb
Created October 20, 2011 18:36
RbConfig::CONFIG in Ruby 1.9.2 p290 which built with RVM or ruby-build
{"DESTDIR"=>"",
"MAJOR"=>"1",
"MINOR"=>"9",
"TEENY"=>"1",
"PATCHLEVEL"=>"290",
"INSTALL"=>"/usr/bin/install -c",
"EXEEXT"=>"",
"prefix"=>"/Users/aereal/.rbenv/versions/1.9.2-p290",
"ruby_install_name"=>"ruby",
"RUBY_INSTALL_NAME"=>"ruby",
@aereal
aereal / gist:1307468
Created October 23, 2011 15:20
Awesome breaking music
(t + Math.sqrt(t<<3) | t*80)*5 << Math.sin(3.14 | Math.sqrt(t))*128%3
school =
case @user.age
when 6..12
:junior
when 13..15
:junior_high
when 16..18
:high
when 19..22
:undergraduate
#!/usr/bin/env ruby
ALPHABETS = 'a'..'z'
def alpha_to_num(alpha) #1
ALPHABETS.find_index(alpha.downcase).succ #2
end
if $0 == __FILE__
p ARGV[0].
@aereal
aereal / gist:1401637
Created November 28, 2011 19:26
Colorful and exciting Vim
function! s:caprice_colorscheme()
let candidates = map(
\ split(globpath(&runtimepath, 'colors/*.vim'), '\n'),
\ 'fnamemodify(v:val, ":t:r")')
if len(candidates) <= 0
return
endif
if has('reltime')