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 [email protected] 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 / dropbox
Created September 23, 2010 00:19
/etc/init.d/dropbox
# /etc/init.d/dropbox
### BEGIN INIT INFO
# Provides: dropbox
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog $remote_fs
# Should-Start: $named $time
# Should-Stop: $named $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the dropbox daemon for debian/ubuntu
@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 = "[email protected]"
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