This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Error handling omitted for brevity | |
var handler = func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "Hello world!") | |
} | |
func TestGet(t *testing.T) { | |
Convey("GIVEN a test server", t, func() { | |
ts := httptest.NewServer(http.HandlerFunc(handler)) | |
Convey("WITH a GET request", func() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Animal struct { | |
Kingdom string | |
Legs uint8 | |
} | |
type Cat struct { | |
Animal | |
Sound string | |
Fav []string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float x; | |
float y; | |
// This is the easing factor, the more the faster the (x, y) reach the target | |
float easing = 0.05; | |
void setup() { | |
size(640, 360); | |
noStroke(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jochasinga": { | |
"email": "[email protected]", | |
"row_data": [ | |
{ | |
"tweet_id": "97719c50-e797-11e3-90ce-5f98e903bf02", | |
"tweet": "I want to go to @banksy ‘s exhibition today so badly." | |
}, | |
{ | |
"tweet_id": "bd48ac00-8310-11e5-985d-dd516b67e698", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"jochasinga": { | |
"email": "[email protected]", | |
"tweet": "I want to go to @banksy ‘s exhibition today so badly." | |
} | |
}, | |
{ | |
"banksy": { | |
"email": "[email protected]", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
) | |
type Hole struct { | |
Alias string `json:"alias"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Original code posted here https://stackoverflow.com/questions/27492888/how-to-map-json-objects-with-dynamic-fields-to-go-structs */ | |
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
"errors" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration | |
grunt.initConfig({ | |
// optionally read package.json | |
pkg: grunt.file.readJSON('package.json'), | |
// Metadata | |
meta: { | |
basePath: '../', // your project path | |
srcPath: '../static/scss/', // where you keep your sass files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern mod sync; | |
// str op trait | |
use std::str::StrSlice; | |
// for tcp listen | |
use std::io::{TcpListener, TcpStream}; | |
use std::io::net::ip::SocketAddr; | |
// for trait | |
use std::io::{Listener, Writer, Acceptor, Buffer}; | |
// for spawn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/env/bin python | |
import time | |
class Animal(object): | |
_tired = False | |
_pace = 1 | |
def __init__(self, legs, kingdom): | |
self.legs = legs |