View gist:2870
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
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); |
View del
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
#!/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 |
View inline_filter.rb
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
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 |
View .vimrc
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
" 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> |
View google_analytics.rb
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
# 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"; |
View unicorn
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/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 | |
## |
View gist:558762
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
fib = Hash.new {|h,k| h[k] = k < 2 ? 1 : h[k-2] + h[k-1]} |
View fw_isb.rb
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
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' |
View dropbox
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
# /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 |
View fw_isb.rb
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
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 |
OlderNewer