Skip to content

Instantly share code, notes, and snippets.

View okaq's full-sized avatar

AQ okaq

  • okaq.com
  • USA
  • 07:27 (UTC -04:00)
View GitHub Profile
@okaq
okaq / favi.go
Last active January 3, 2016 15:49
Favicon Encoder
// favicon encoder: 32x32 png and json base64 data uri formats
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"image"
"image/color"
"image/png"
<!DOCTYPE html>
<html lang="en">
<head id="zeta">
<title>okaq.com/speed</title>
<script type="text/javascript">
// ok
console.log("speed ok");
// perf
window.bigtime = window.performance.timing.responseEnd - window.performance.timing.navigationStart;
<!DOCTYPE html>
<html lang="en">
<head id="zeta">
<title>okaq.com</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="author" content="[email protected]" />
<link rel="shortcut icon" href="" />
<style type="text/css">
html,body{width:100%;height:100%;background-color:rgba(255,255,255,1.0);}
@okaq
okaq / fugi.go
Last active December 29, 2015 05:29
// okaq.com
// fugi web server
// by [email protected]
// on 2013-11-25
package main
import (
"fmt"
"io/ioutil"
@okaq
okaq / godart.txt
Created May 17, 2013 00:05
Minimum Golang/Dartlang HTTP
// webserver.go
package main
import (
"fmt"
"net/http"
// "net/url"
)
func AbHandler(w http.ResponseWriter, r *http.Request) {
/*
* Google Code Jam 2013 Round 1A
* Problem B. Manage Your Energy
*/
package main
import (
"bufio"
"container/list"
"flag"
/*
* Google Code Jam 2013 Round 1A
* Problem A. Bullseye
*/
package main
import (
"bufio"
"flag"
"fmt"
@okaq
okaq / chusho.cpp
Created April 30, 2013 13:02
OpenCL / OpenGL Bridge
/*
* =====================================================================================
*
* File: chusho.cpp
* Description: OpenGL / OpenCL Bridge
* Created: 04/24/2013 07:54:13 AM
* Compile: g++ chusho.cpp -o chusho -lglut -lOpenCL -lGLEW -std=c++0x
*
* Author: AQ <[email protected]>
* Notes: Seg Fault when run. Invalid GL buffer (catalyst, amd app sdk, unity?)
/*
* Google Code Jam 2013 Qualification Round
* Problem D. Treasure
*/
package main
import (
"bufio"
"flag"
"fmt"
/*
* palindromic squares generator
*
*/
package main
import (
"bufio"
"fmt"
"os"