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
# This is an example of a shoes terminal | |
# Created by Devyn Cairns | |
Shoes.app do | |
background "#FFF" | |
@win = flow do | |
@header = para('shoes console', :family => 'monospace', :fill => "#000", :stroke => "#FFF", :align => 'center', :margin => 8) | |
para "\n" | |
@console = para('$ ', :family => 'monospace', :stroke => "#000") | |
@cursor = para(' ', :fill => "#FFF", :family => 'monospace') | |
@nodelete = 2 |
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
# fast way to include too many stylesheets | |
def include_stylesheets | |
sheets = %w(dropdown style calendar/red/style facebox) | |
sheets.collect{|sheet|stylesheet_link_tag(sheet)}.join | |
end |
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
# a quick file indexer for ruby | |
def checksum(file_loc) | |
sum = 0 | |
File.open(file_loc){|f|f.each_byte{|b|sum^=b}} | |
sum | |
end | |
$index = [] | |
def enter dir | |
(Dir.entries(dir) - %w(. ..)).each do |ent| | |
if File.directory? File.join(File.expand_path(dir), ent) |
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 | |
# RedFS (Fuse) | |
# RedFS is a mountable block system | |
# To make a RedFS virtual system, use the following shell command: | |
# $ dd if=/dev/zero of=(yourfile) bs=4096 count=(number of blocks) | |
# To run: | |
# # ./redfs-fuse.rb (yourfile) (mountpoint) | |
# or: | |
# $ sudo ./redfs-fuse.rb (yourfile) (mountpoint) | |
# Also, please note that if when you write a block and it is larger than 4096 bytes, RedFS will cut off at that point. |
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
# DoughTracker, a GUI for creating goals of money. | |
require 'yaml' | |
class ::DTGoal | |
attr_accessor :name, :goal, :so_far | |
def initialize(name, goal) | |
@name, @goal = name, goal | |
@so_far = 0.0 | |
end | |
def fraction | |
@so_far/@goal |
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
# Shoes-IRB made by ~devyn | |
require 'irb' | |
Shoes.app do | |
background black | |
@p = para '', :family => 'monospace', :color => white | |
@sreader, @swriter = StringIO.new, StringIO.new | |
Thread.start do | |
@irb = IRB::Irb.new(nil, @sreader, @swriter) | |
loop do |
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 'uri' | |
module CrumbleURL; extend self | |
def crumble_to_url c | |
c =~ /^([A-Za-z0-9_-]+)\((\d+)\) ([A-Za-z0-9_.-]+)/ | |
uri = URI::Generic.build(:scheme => $1, :port => $2, :host => $3.split('.').reverse.join('.')) | |
if c =~ /> ([A-Za-z0-9()_.-^]+)/ | |
uri.path = "/" + $1.split('.').collect{|pt|pt.gsub(/\(\d+\)$/){|o|'/'+o[1..-2]}.gsub("^", ".")}.join("/") | |
end | |
if c =~ /\{(.*)\}$/ | |
uri.query = $1.gsub(": ", "=").gsub(", ", "&") |
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(dyndata). | |
-export([new/0, data_process/1, set_data/2, get_data/1, destroy/1, add/2, at/2]). | |
%%% Dynamic Data by ~devyn %%% | |
new() -> | |
spawn(dyndata, data_process, [[]]). | |
data_process(DynData) -> | |
receive |
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
class ARF | |
attr :coords | |
def initialize map, follow, size, app | |
@map, @follow, @size, @app, @coords = (map.is_a?(Array) ? map : [map]), follow, size, app, [follow.left,follow.top] | |
@vx, @vy = 0,0 # velocity | |
animate_loop | |
end | |
def [](x,y) | |
@coords[0] += x | |
@coords[1] += y |
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 | |
require 'rubygems' | |
require 'json' | |
require 'uri' | |
require 'net/http' | |
$tw_user = "<twitter_username>" | |
$tw_pass = "<twitter_password>" | |
case ARGV[0] |
OlderNewer