Skip to content

Instantly share code, notes, and snippets.

View darkfrog26's full-sized avatar
🦊
Crazy like a fox

Matt Hicks darkfrog26

🦊
Crazy like a fox
View GitHub Profile
@darkfrog26
darkfrog26 / javascript
Created June 12, 2012 19:06
JavaScript DSL
var x = 5;
var y = 6;
var entries = [1, 2, 3, 4];
var message = 'Testing';
entries[4] = 5;
if (x == y) {
alert('Hello World!');
}
else if (x <= y) {
alert(message);
@darkfrog26
darkfrog26 / Generated.html
Created June 13, 2012 19:57
TodoMVC Template
<!DOCTYPE html>
<html>
<head>
<title>Webframework - TodoMVC</title>
<link rel="stylesheet" href="css/base.css"/>
<link rel="stylesheet" href="css/app.css"/>
</head>
<body>
<section id="todoapp">
<header id="header">
val f = () => {
val x = 5
val y = 6
val z = 7
}
trait Lazy[T <: Persistable] extends Function0[T]
case class LazyValue[T <: Persistable](id: util.UUID, collection: DatastoreCollection[T]) extends Lazy[T] {
private lazy val value = collection.byId(id).getOrElse(null)
def apply() = value
}
import org.hyperscala._
import org.hyperscala.js.JavaScript
import org.hyperscala.style._
import org.hyperscala.tags._
import org.hyperscala.tags.attributes._
import org.sgine.Color
object TelefloraImport extends WebPage("TelefloraImport") {
head.title := "Flowers, Florist Flower Delivery - Send Flowers Online - Teleflora"
head.contents += new Meta(httpEquiv = "content-type", content = "text/html; charset=ISO-8859-1")
<!DOCTYPE html>
<html>
<head>
<title>Ajax POST Example</title>
<script src="/js/jquery-1.7.2.js"></script>
</head>
<body>
<form id="postForm" action="/">
<label>Name</label>
<input name="name" type="text"/>
import org.hyperscala._
import org.hyperscala.js.JavaScript
import org.hyperscala.style._
import org.hyperscala.tags._
import org.hyperscala.tags.attributes._
import org.powerscala.Color
object ExampleExport extends WebPage("ExampleExport") {
head.title := "Adopcje króliczków, Stowarzyszenie Pomocy Królikom"
head.contents += new Link(rel = "stylesheet", media = "screen", mimeType = "text/css", href = "example_files/style.css")
{
"error": null,
"message": null,
"fieldId": null,
"redirect": null,
"response": {
"topics": [
{
"name": "Branding",
"id": "ea94e7c8-c2ee-4150-88f0-e63af2bfab1d"
United States dollar
Canadian dollar
Euro
British pound
Afghan afghani
Albanian lek
Algerian dinar
Angolan kwanza
Argentine peso
Armenian dram
English
Spanish
German
French
Italian
Acehnese
Afrikaans
Akan
Albanian
Amharic