Skip to content

Instantly share code, notes, and snippets.

default
{
state_entry()
{
vector fwd = <llSqrt(2)/2, llSqrt(2)/2, 0.0>;
vector left = < 0.0, 1.0, 0.0>;
vector up = < 0.0, 0.0, 1.0>;
rotation rot = llAxes2Rot(fwd, up % fwd, up);
llSay(DEBUG_CHANNEL, (string) rot);
@migrs
migrs / del
Created August 30, 2009 00:06 — forked from javascripter/del
#!/usr/bin/env ruby
# vim: ft=ruby
def mk_uniq_name_by(filename, path)
uniq_name = filename
prefix = 0
while FileTest.exist?(File.join(path, uniq_name))
prefix += 1
uniq_name = sprintf("%d.%s", prefix, filename)
end
uniq_name
module Inline
include Haml::Filters::Base
def self.[](key)
@@data[key.to_s] rescue nil
end
def render(str)
@@data = Hash[*str.split(/^\s*@@\s*(\w+)\s*\n/m)[1..-1]]
return nil
" Tabs
nnoremap <D-t> :<C-u>tabnew<CR>:tabmove<CR>
nnoremap <D-w> :<C-u>tabclose<CR>
nnoremap <D-}> :<C-u>tabnext<CR>
nnoremap <D-{> :<C-u>tabprevious<CR>
@migrs
migrs / google_analytics.rb
Created August 18, 2010 01:54
Google Analytics Mobile for Rails Metal
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class GoogleAnalytics
extend Rack::Utils
G_COOKIE_NAME = '__utmmobile'
GIF_DATA = "GIF89a\001\000\001\000\200\000\000\377\377\377\377\377\377!\371\004\001\n\000\001\000,\000\000\000\000\001\000\001\000\000\002\002L\001\000;"
UTM_GIF_LOCATION = "http://www.google-analytics.com/__utm.gif";
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
fib = Hash.new {|h,k| h[k] = k < 2 ? 1 : h[k-2] + h[k-1]}
@migrs
migrs / fw_isb.rb
Created September 22, 2010 04:53
i.softbank.jp 宛のメールを Gmail に転送するスクリプト
require 'net/imap'
require 'time'
sb_account = %W(USERNAME PASSWORD)
gm_account = %W(USERNAME PASSWORD)
sb = Net::IMAP.new 'imap.softbank.jp', 993, true
sb.login *sb_account
sb.select 'INBOX'
@migrs
migrs / fw_isb.rb
Created September 25, 2010 01:27
i.softbank.jp のメールをすべて Gmail に移動する
SB_ACCOUNT = ['USERNAME', 'PASSWORD']
GM_ACCOUNT = ['USERNAME', 'PASSWORD']
BOXCAR_ADDR = "123456.123456@push.boxcar.io"
sb.select 'INBOX'
imap_each(sb, %w(UNDELETED)) do |mail, m|
Net::SMTP.start('127.0.0.1', 25) {|smtp| smtp.send_mail mail.attr['BODY[HEADER]'], m[:from], BOXCAR_ADDR}
gm.append 'INBOX', m[:src], nil, m[:date]
sb.store mail.seqno, '+FLAGS', [:Deleted]
end
@migrs
migrs / .screenrc
Created April 6, 2011 09:09
minimum dotfiles
escape ^Tt
defbce on
vbell off
termcapinfo xterm* ti@:te@
startup_message off
defhstatus ^En:^Et
maptimeout 0
autodetach on
altscreen on
defscrollback 10000