Skip to content

Instantly share code, notes, and snippets.

View jchv's full-sized avatar

jchv

  • ::1
View GitHub Profile
// Page represents a cursor for a page of calendar entries.
type Page struct {
Calendar string `json:"calendar"`
EarliestDate time.Time `json:"earliestDate"`
LatestDate time.Time `json:"latestDate"`
Sort string `json:"sort"`
Skip int `json:"skip"`
Limit int `json:"limit"`
}
@jchv
jchv / hello.go
Created June 3, 2015 19:45
Playing with goroutines
package main
import "fmt"
import "time"
func main() {
c := make(chan string, 3)
go func() {
c <- "Testing, "
}()
# UUIDField - a strictly binary, filterable, efficient UUID field that works with MySQL, PostgreSQL, SQLite3
# Needs a lot more testing. Current version not tested on PostgreSQL. Partially based on David Cramer's
# UUIDField, with ideas taken from django-extensions, django's BinaryField and some other places.
import uuid
from django import forms
from django.db.models import Field, SubfieldBase
# Enable native UUIDs in PostgreSQL (from dcramer/django-uuidfield)
try: