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
format.xml { render :xml => @post } | |
format.plist { | |
send_data( | |
@post.to_plist, | |
:type => "application/plist", | |
:filename => "post-#{@post.id}.plist", | |
:disposition => 'inline' | |
) | |
} |
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 Jeena | |
def Jeena::tuwas | |
puts "klassenmethode" | |
end | |
def tuwas | |
puts "instanzmethode" | |
end | |
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
- (void)postNewEntry { | |
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys: | |
@"A title", @"title", | |
@"Some text for body", @"body", nil]; | |
NSData *data = [NSPropertyListSerialization dataFromPropertyList:dict | |
format:NSPropertyListBinaryFormat_v1_0 | |
errorDescription:nil]; | |
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/lua | |
secretword = "llama" -- the secret word | |
write ("What is your name? ") | |
name = read ("*l") | |
if name == "Randal" then | |
print ("Hello, Randal! How good of you to be here!") | |
else |
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 id="preview"></div> | |
<%= javascript_include_tag ["showdown"] %> | |
<script> | |
document.observe("dom:loaded", function() { | |
var converter = new Showdown.converter(); | |
$("post_content").observe("keyup", function(e) { | |
$("preview").innerHTML = converter.makeHtml($("post_content").value); | |
}); |
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
- (void)openMoreAfterDelay:(id)sender { | |
UIMenuController *menuController = [UIMenuController sharedMenuController]; | |
[self becomeFirstResponder]; | |
NSMutableArray *menuItems = [[NSMutableArray alloc] initWithCapacity:5]; | |
UIMenuItem *item; | |
NSInteger i = 0; | |
for (SquaceMLAction *action in [[dataSource.squaceML.squaregrid.squares objectAtIndex:activeIndex] actions]) { |
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 LocalizedAttributes | |
def localize(*methods) | |
methods.each do |method| | |
class_eval %Q[ | |
def #{method} | |
text = self.send(("#{method}_" << I18n.locale.to_s.downcase).to_sym) | |
text = self.#{method}_#{I18n.default_locale.to_s.downcase} if text.blank? | |
text | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>test</title> | |
<script type="text/javascript" charset="utf-8"> | |
var t = 1; | |
</script> | |
</head> | |
<body onload="start()"> | |
<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> |
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
function fireEvent(obj,evt){ | |
var evObj = document.createEvent('MouseEvents'); | |
evObj.initEvent( evt, true, false ); | |
obj.dispatchEvent(evObj); | |
} |
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> | |
<html> | |
<head> | |
<title>Test</title> | |
<script> | |
var obj = { | |
a: 0, | |
add: function () { | |
console.log("a: " + this.a); | |
} |