Skip to content

Instantly share code, notes, and snippets.

View Bluebie's full-sized avatar

Phoenix Fox Bluebie

View GitHub Profile
@Bluebie
Bluebie / index.xhtml
Created February 16, 2009 22:17 — forked from ELLIOTTCABLE/index.xhtml
weird thing elliott's doing
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="css/main.css" type="text/css" media="screen"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>This is new thought.</title>
<script type="text/javascript" charset="utf-8"
src="js/vendor/mootools-1.2.1-core-jm.js"></script>
<script type="text/javascript" charset="utf-8"
@Bluebie
Bluebie / gist:66043
Created February 17, 2009 22:48
A simple smilies parser class for MooTools, broken
var SmiliesParser = new Class({
initialize: function(smiledata) {
this.data = smiledata;
this.sensor = new RegExp($H(smiledata).getValues().map(function(item) {
return item.map(function(i) {
return '(' + i.escapeRegExp() + ')';
}).join('|');
}).join('|'), 'g');
},
OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to disarray.yreality.net [75.101.138.129] port 22.
debug1: Connection established.
debug1: identity file /Users/bluebie/.ssh/identity type -1
debug3: Not a RSA1 key file /Users/bluebie/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
file_handler = Rack::File.new('.')
#...
proc { |env|
if !env['HTTP_IF_MODIFIED_SINCE'] || File.mtime(env['PATH_INFO'].sub(/\//, '')) > Time.rfc2822(env['HTTP_IF_MODIFIED_SINCE'])
r = file_handler.call(env)
r[1]['Expires'] = (Time.now + 60*60*24).httpdate if env['PATH_INFO'] =~ /(script|style)/
r
else
[304, {}, ['']]
end
class CreateTempRoom < R '/rooms/create-temporary'
def get
require 'json'
room_id = "--#{rand(2 ** 16 - 1).to_s(36)}" until !File.exist?("rooms/#{room_id}")
default_settings = {
:title => input.name || "Temporary Talkie Room",
:desc => input.desc || "",
:owners => [],
:type => 'democracy',
@Bluebie
Bluebie / stiffbot.rb
Created March 5, 2009 03:10
A simple bot for Talkie that pretends to be _why by saying strange things
#!/usr/bin/ruby
require '../../../paths' # remove this before using, it's only relevent on creativepony.com servers
require 'rubygems'
require 'rack'
require 'json'
Lines = "this sky is chalk wherewith to sharpen my pool cue
oh for the sky to be just once made of all mouths,
from the licky crocodile kinds to those types
which consume of the powdered donut gems
8:50pm: feeling mildly musical, enjoying the beat a lot, calmer than before, cutting communication
8:51: Killed aim. Test begins
---: Making slight effort to maintain communication channel.
---: kinda depressed
--- why so sad?
--- no reason
--- Just am
--- life sucks
--- musics fun tho
8:52: Music is less fun now.. but still enjoyable, good distraction.. more downer....
$(document.body).adopt(
(new Element('form', {method: 'post', enctype: 'multipart/form-data', action: '/alter-avatar/' + kind + '/upload'})).adopt(
(new Element('div')).adopt(
new Element('input', {'type': 'file', name: 'upload'}),
new Element('input', {'type': 'submit', value: 'Send Picture'})
)
)
);
// In this example, the private_thing is more like a private class variable than a private instance variable.
var F=function(){
var private_thing = '';
this['private_thing'] = function(){ return private_thing; }; // get…
this['set_private_thing'] = function(o){ private_thing = o; }; // set…
this['public_thing'] = '';
};
require 'rubygems'
require 'ruby-audio'
# Info at http://www.horrorseek.com/home/halloween/wolfstone/Motors/svoint_RCServos.html
class ServoAnimation
SampleRate = 48000 # samples per second
RePulse = 200 # hertz
CentreWidth = 1.5 # mSec
ScaleWidth = 0.9 # mSec
PulseEvery = SampleRate / RePulse