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
// Start of code | |
protected override void CreateChildControls() | |
{ | |
base.CreateChildControls(); | |
// Form label | |
Label qLabel = new Label(); | |
qLabel.Text = "Label text"; |
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
// 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 |
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
// 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)] |
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
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) |
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
<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> |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" | |
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> |
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
stop(); |
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
// 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 |
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
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 |
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 'sinatra' | |
require 'pathname' | |
get "/" do | |
html = "<h1>Your files, sir.</h1>" | |
dir = "./files/" | |
Dir[dir+"*"].each do |file| | |
html+=file_link(file) | |
end | |
html |