This file contains 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 ( | |
"image/color" | |
"log" | |
"fmt" | |
"github.com/mmcloughlin/globe" | |
) |
This file contains 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 ( | |
"context" | |
"html" | |
"log" | |
"net/http" | |
"golang.org/x/text/language" | |
"golang.org/x/text/message" |
This file contains 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
<html> | |
<head> | |
<title>Hello, from Go</title> | |
</head> | |
<body> | |
<h1>Hello</h1> | |
<p> | |
This is Go code running, {{.}} | |
</p> | |
</body> |
This file contains 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
// Copyright 2011 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// HTTP reverse proxy handler | |
package goengine | |
import ( | |
"io" |
This file contains 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 com.blazingmammothgames.util; | |
#if neko | |
import neko.vm.Thread; | |
import neko.vm.Mutex; | |
#elseif cpp | |
import cpp.vm.Thread; | |
import cpp.vm.Mutex; | |
#end |
This file contains 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
class Metric { | |
static function main() { | |
var coinRadius:Millimeters = 12; | |
var myHeight:Centimeters = 180; | |
var raceLength:Meters = 200; | |
var commuteDistance:Kilometers = 23; | |
diff( coinRadius, myHeight ); // 1.788 meters | |
diff( raceLength, commuteDistance ); // 22800 meters | |
sum( commuteDistance, coinRadius ); // 23000.012 meters |
This file contains 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 "github.com/gopherjs/gopherjs/js" | |
import "honnef.co/go/js/dom" | |
var imagePath = "resources/image.png" | |
func main() { | |
//draw_withGopherJS() | |
//draw_withDOM() |
This file contains 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
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then | |
// use window.btoa' step. According to my tests, this appears to be a faster approach: | |
// http://jsperf.com/encoding-xhr-image-data/5 | |
/* | |
MIT LICENSE | |
Copyright 2011 Jon Leighton | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |