Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
🎴

Jordan Orelli jordanorelli

🎴
View GitHub Profile
from time import sleep, time
from threading import Thread
class Worker(Thread):
def run(self):
count = 0
while True:
print "worker says hi. %r" % time()
sleep(0.1)
<?php
$item = json_decode('{"key": "value"}');
print_r($item);
$other_item = json_decode('{"key": "value"');
print_r($other_item);
echo is_null($other_item);
$things = ["one": 1, "two": 2];
<?php
$item = json_decode('{"key": "value"}');
print_r($item);
$other_item = json_decode('{"key": "value"');
print_r($other_item);
echo is_null($other_item);
{
"playerstats": {
"steamID": "76561198040832845",
"gameName": "ValveTestApp260",
"stats": [
{
"name": "total_kills",
"value": 1895
},
{
{
"playerstats": {
"steamID": "76561197972495328",
"gameName": "Team Fortress 2",
"stats": [
{
"name": "Scout.accum.iBuildingsDestroyed",
"value": 112
},
{
{
"game": {
"gameName": "ValveTestApp260",
"gameVersion": "237",
"availableGameStats": {
"stats": [
{
"name": "total_kills",
"defaultvalue": 0,
"displayName": "Enemy players killed"
package main
import (
"flag"
"fmt"
)
var options struct {
s string
i int
9100 => int clockPort;
"localhost" => string clockHost;
OscSend send;
send.setHost(clockHost, clockPort);
send.startMsg("/subscribe", "si");
send.addString("localhost");
send.addInt(9000);
OscRecv recv;
size(300, 300); // size of the drawing
background(255); // the background should be white
strokeWeight(4); // make the lines we draw 4 pixels wide
stroke(0); // things we draw will be black
line(0, 0, 20, 20); // draw a black line from the corner of the screen to 10, 10
translate(150, 150); // we're going to move to the middle of the screen.
stroke(255, 0, 0); // things we draw will be red.
line(0, 0, 20, 20); // draw a red line from the middle of the screen, to middle.x + 10, middle.y + 10
package main
import (
"fmt"
)
func main() {
err := fmt.Errorf("this is an error.")
// these two lines print the same thing when err is non-nil