Skip to content

Instantly share code, notes, and snippets.

// Start of code
protected override void CreateChildControls()
{
base.CreateChildControls();
// Form label
Label qLabel = new Label();
qLabel.Text = "Label text";
// Start of code
protected override void RenderContents(HtmlTextWriter writer)
{
// Writing a simple h1
// You have to prepare your tag attributes before opening the tag
writer.AddAttribute(HtmlTextWriterAttribute.Id, "my_h1");
// Open h1 tag
// Start of code
private string customMessage = "My lovely heading";
[WebBrowsable(true),
Category("GRP Custom"),
WebDescription("Displays a custom message"),
WebDisplayName("Display Message"),
Personalizable(PersonalizationScope.User)]
@joecorcoran
joecorcoran / gist:186552
Created September 14, 2009 08:00
Multiple select helper for Rails
def multi_select(id, name, objects, selected_objects, value, content = {})
options = ""
objects.each do |o|
selected = selected_objects.include?(o) ? " selected=\"selected\"" : ""
option_value = escape_once(o.send(value))
text = [option_value]
unless content[:text].nil?
text = []
content[:text].each do |t|
text << o.send(t)
<div xmlns:dc="http://purl.org/dc/elements/1.1/#" about="http://www.example.com/books/my_great_book.pdf">
<p>
<span property="dc:title">My Great Book</span> by
<span property="dc:creator">Joe Corcoran</span>, published
<span property="dc:date">2009-10-01</span>.
</p>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
// declare your variable
var clickedItem:String;
// clickable_mc can obviously be the
// instance name of anything you want
// the user to click
clickable_mc.onRelease = function() {
// set the variable to anything - this
// will be grabbed in mc_omn and assigned
stop();
// this sets the component's pageName param to
// something we'll define in the next step
cmp_omn.pageName = _root.clickedItem;
// check it's working
trace(cmp_omn.pageName);
// this waits for 0.3 seconds and then calls the
require 'sinatra'
require 'pathname'
get "/" do
html = "<h1>Your files, sir.</h1>"
dir = "./files/"
Dir[dir+"*"].each do |file|
html+=file_link(file)
end
html