Skip to content

Instantly share code, notes, and snippets.

View hajimehoshi's full-sized avatar
:octocat:
ギットハブ

Hajime Hoshi hajimehoshi

:octocat:
ギットハブ
View GitHub Profile
@hajimehoshi
hajimehoshi / test.go
Created June 1, 2020 01:11
Ebiten loop in tests
var regularTermination = errors.New("regular termination")
type game struct {
m *testing.M
code int
}
func (g *game) Update(*ebiten.Image) error {
g.code = g.m.Run()
return regularTermination
@hajimehoshi
hajimehoshi / shader.go
Last active April 25, 2020 13:59
A Go-like language for shaders
package main
type VertexIn struct {
Vertex vec2
Tex vec2
TexRegion vec4
ColorScale vec4
}
type VertexOut struct {
// SPDX-License-Identifier: Apache-2.0
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.IO;
using Go2DotNet.Example.Ebiten.AutoGen;
package main
import (
"image"
"image/color"
"image/draw"
"image/png"
"os"
"strings"
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
var x = 0;
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
x++;
<!DOCTYPE html>
<canvas id="canvas" width="512" height="512"></canvas>
<script>
window.addEventListener('load', () => {
const canvas = document.getElementById('canvas');
const gl = canvas.getContext('webgl');
gl.viewport(0, 0, 512, 512);
var i = 0;
let f = () => {
setTimeout(() => {
diff --git a/include/v8.h b/include/v8.h
index 3275d97c43..5d44b30a89 100644
--- a/include/v8.h
#!/bin/sh
# Copyright 2012 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.
# git gofmt pre-commit hook
#
# To use, store as .git/hooks/pre-commit inside your repository and make sure
# it has execute permissions.
#
export PS1='\[\033[40;1;32m\]\u\[\033[2;32m\]@\[\033[0m\]\[\033[40;32m\]\h \[\033[1;36m\]\w\[\033[0m\] \n\\$ '
export PATH=/usr/local/go/bin:/usr/local/bin:$PATH
export PATH=~/bin:$PATH
export GOPATH=~/go
export PATH=~/go/bin:$PATH
# export PATH=/usr/local/texlive/2014basic/bin/universal-darwin:$PATH
# export PATH=~/TypeScript/bin:$PATH # installed by `jake LKG`
                  +----+
      +----++----+| R  |
+----+| R  || R  |+----+
| R  |+----++----+==+----+
+----+==+----++----+| R  |
  +----+| R  || R  |+----+
  | R  |+----++----++----+
  +----++----++----+| R  |
 +----+| R || R |+----+