Skip to content

Instantly share code, notes, and snippets.

@dsimard
Created April 27, 2012 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsimard/2509740 to your computer and use it in GitHub Desktop.
Save dsimard/2509740 to your computer and use it in GitHub Desktop.
Space 80
program HelloWorld;
begin
if 1 = 1 then
begin
writeln('Hello World');
end
else
begin
writeln('We are in Sonic the Hedgehog''s Twilight Zone');
end;
end.
// Long hard to read chain
$("#theButton").css("border", "solid 10px red").text("click here to do nothing").click(function() {
// do nothing
});
// Shorter easier to read
$("#theButton")
.css("border", "solid 10px red")
.text("click here to do nothing")
.click(function() {
// do nothing
});
function lotOfArguments(argument1, argument2, argument3, argument4,
argument5, argument6, argument7, argument8)
var bool = true;
// 3 lines if
if (bool) {
window.alert("This is true");
}
// one-liner if
if (bool) {window.alert("this is true");}
function lotOfArguments(argument1, argument2, options)
// Call the function
lotOfArguments("Lorem", "Ipsum",
{ argument4 : "sit",
argument7 : "adipiscing" }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment