Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>WebSocket demo</title>
</head>
<body>
<div>
<form>
<label for="numberfield">Number</label>
<input type="text" id="numberfield" placeholder="12"/><br />
@geraldstanje
geraldstanje / test.py
Last active August 29, 2015 14:07 — forked from leavittx/test.py
import sys
sys.path.insert(0,"../..")
import readline
import os
import ply.lex as lex
import ply.yacc as yacc
import numpy
// Playbook: http://play.golang.org/p/kp5uL_mMGk
// Note: Type assertion like "someVariable.(string)" is useful when you are dealing with interface{} (empty interface)
package main
import (
"fmt"
"strconv"
)
@geraldstanje
geraldstanje / bf2c.py
Last active August 29, 2015 14:07 — forked from jdp/bf2c.py
#!/usr/bin/env python
import argparse
import sys
def tokenize(source):
return list(source)
def parse(tokens):
import net.liftweb.json.Xml // converts XML to JSON
import com.mongodb.casbah.Imports._ // To put stuff in Mongo
import com.mongodb.casbah.MongoDB // To connect to Mongo
import com.mongodb.util.JSON // To parse JSON into a MongoDBObject
import net.liftweb.json._ // To output Lift JSON as actual JSON
import scala.xml.XML // To load XML
// load the XML
val xml = XML.load("http://www.w3schools.com/xml/note.xml")
// fire up mongo connection
find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done