Skip to content

Instantly share code, notes, and snippets.

View sanity's full-sized avatar

Ian Clarke sanity

View GitHub Profile
View kweb-demo-ssr.html
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="kweb_native_assets/jquery/jquery-3.1.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.2/dist/semantic.min.css">
<script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.2/dist/semantic.min.js"></script>
<script language="JavaScript">
View cnntk1.c
/*
The C Neural Network Toolkit - Include File
(c) 1993,1994 Ian Clarke
*/
#define train teach
struct node
{
float error,input,output,correct_output,threshold,change_in_threshold;
short type;
@sanity
sanity / todo.kt
Last active August 6, 2017 15:48
View todo.kt
fun main(args: Array<String>) {
val random = Random()
Kweb(port = 1544, refreshPageOnHotswap = true, plugins = listOf(semanticUIPlugin)) {
data class TodoItem(
val id: String,
val description: String,
val done: Boolean,
val deleted: Boolean
)
View demo.kt
package com.github.sanity.kweb.demos.todo
import com.github.sanity.kweb.KWeb
import com.github.sanity.kweb.dom.element.creation.*
import com.github.sanity.kweb.dom.element.events.on
import com.github.sanity.kweb.dom.element.modification.addText
import com.github.sanity.kweb.dom.element.modification.delete
import kotlinx.coroutines.experimental.future.await
import kotlinx.coroutines.experimental.future.future
View keybase.md

Keybase proof

I hereby claim:

  • I am sanity on github.
  • I am sanity (https://keybase.io/sanity) on keybase.
  • I have a public key whose fingerprint is 34F2 C999 0D28 269E 97BF 6429 110F 8172 0708 E0C2

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am sanity on github.
  • I am sanity (https://keybase.io/sanity) on keybase.
  • I have a public key whose fingerprint is C736 0C04 6AEB 5EAD C4DD B251 9C7F 9291 1C8B A445

To claim this, I am signing this object:

View gist:5183271
java.lang.NullPointerException
at com.google.apphosting.utils.config.BackendsYamlReader$BackendsYaml.toXml(BackendsYamlReader.java:44)
at com.google.apphosting.utils.config.BackendsYamlReader.parse(BackendsYamlReader.java:185)
at com.google.apphosting.utils.config.BackendsYamlReader.parse(BackendsYamlReader.java:166)
at com.google.appengine.tools.admin.Application.<init>(Application.java:221)
at com.google.appengine.tools.admin.Application.readApplication(Application.java:290)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:186)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:102)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:98)
at com.google.appengine.AbstractAppCfgMojo.executeAppCfgCommand(AbstractAppCfgMojo.java:242)
View gist:5182601
Unable to configure backend:
java.lang.NullPointerException
at com.google.appengine.tools.admin.AppAdminImpl.configureBackend(AppAdminImpl.java:177)
at com.google.appengine.tools.admin.AppCfg$BackendsConfigureAction.execute(AppCfg.java:1693)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:219)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:102)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:98)
at com.google.appengine.AbstractAppCfgMojo.executeAppCfgBackendsCommand(AbstractAppCfgMojo.java:253)
at com.google.appengine.appcfg.BackendsConfigure.execute(BackendsConfigure.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
View gist:5181682
$ mvn appengine:devserver
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building lastcalc 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...snip unit test output...
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) @ lastcalc ---
[INFO] Packaging webapp
View gist:4658619
{"notify_request": {"timestamp":"2013-01-28 20:06:06","user_id_64":6327291030808759029,"response_time_ms":27,"fail":true,"error":"Invalid HTTP response code 1425806080","error_id":13,"tags":[{"id":1128022,"auction_id_64":6650444562080857093,"payment_rule_id":196067,"notify_type": "lost"}],"responses": []}}