Skip to content

Instantly share code, notes, and snippets.

# watch me turn java into ruby
def try; end
def catch(*args) end
def RuntimeException(*args) end
def re; end
class Anything; def method_missing(*args) Anything.new end end
def getDialog; Anything.new end
def WebResponse(*args) end
def atUrl; '' end
<?php
// This is a PLUGIN TEMPLATE.
// Copy this file to a new name like abc_myplugin.php. Edit the code, then
// run this file at the command line to produce a plugin for distribution:
// $ php abc_myplugin.php > abc_myplugin-0.1.txt
// Plugin name is optional. If unset, it will be extracted from the current
// file name. Uncomment and edit this line to override:
class GraphsController < ApplicationController
def top
@graph = open_flash_chart_object(1200, 500, '/graphs/bar_chart')
end
def bar_chart
top = Customer.find(:all, :select => 'sum(CMS.ORD_TOTAL) AS total, CUST.COMPANY', :group => 'CMS.CUSTNUM, CUST.COMPANY', :joins => [:orders], :limit => 10, :order => 'total DESC')
bar = BarOutline.new(50, '#9933CC', '#8010A0')
<?
//$im = ImageCreate(250,45); // Blank Background
$im = ImageCreateFromPng("images/image_prev_bg.png"); // PNG Image Background
$white = ImageColorAllocate($im,255,255,255);
$black = ImageColorAllocate($im,0,0,0);
$blue = ImageColorAllocate($im,0xF2,0xFF,0xFF);
ImageTTFText($im, $textsize, 0, 10, 30, $black, "arial.ttf", $text);
@ngerakines
ngerakines / clear.erl
Created July 23, 2008 18:37
A small erlang snippet to clear ipwcore cache files.
Now = calendar:datetime_to_gregorian_seconds(erlang:universaltime()) - 14400,
DelFun = fun(File, {ok, [{{time, Time}, _}]}) when Time < Now -> file:delete(File); (_, _) -> ok end,
[DelFun(File, file:consult(File)) || File <- filelib:wildcard("cache/*")].
<h1>Hi Markus</h1>
<p>playing around with gist
<ul>
<li>how does this works ?
<li>une more line
</ul>
@jnewland
jnewland / description.txt
Created July 23, 2008 18:43
description, test case, and patches for the recent Ruby CVEs
Multiple integer overflows in the rb_str_buf_append function in
Ruby 1.8.4 and earlier, 1.8.5 before 1.8.5-p231, 1.8.6 before
1.8.6-p230, 1.8.7 before 1.8.7-p22, and 1.9.0 before 1.9.0-2
allow context-dependent attackers to execute arbitrary code or
cause a denial of service via unknown vectors that trigger memory
corruption. (CVE-2008-2662)
Multiple integer overflows in the rb_ary_store function in Ruby
1.8.4 and earlier, 1.8.5 before 1.8.5-p231, 1.8.6 before 1.8.6-p230,
and 1.8.7 before 1.8.7-p22 allow context-dependent attackers to
<?xml version="1.0" encoding="UTF-8"?>
<comments>
<comment preview="Bacon clock: http://www.mathlete.com/portfolio/wakeNbacon.php" author="Fred Garvin" date="Jul 31, 2008 12:37am CST" id="17559085">
<body>Bacon clock:
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://www.mathlete.com/portfolio/wakeNbacon.php" target="_blank"&gt;http://www.mathlete.com/portfolio/wakeNbacon.php&lt;/a&gt;</body>
<comments>
<comment preview="everything is better with bacon on it." author="boomstickah" date="Jul 31, 2008 12:38am CST" id="17559090">
<body>everything is better with bacon on it.</body>
<comments>
<comments story_id="17501593">
<comment author="username" date="timestampofsomesort" id="17499642">
<body>
Entire body of comment
</body>
<comments>
<comment author="username" date="timestampofsomesort" id="17499642">
<body>
Entire body of reply
</body>
merrily around the mistletoe
Merrily we go.. Around and around we are spinning, faster and faster as the years go by