Skip to content

Instantly share code, notes, and snippets.

@hagino3000
hagino3000 / client.js
Created December 8, 2011 18:42
WebSocket with binary data
var socket = null;
function bootstrap() {
// 適当な図形を描画
var c = document.getElementById('mycanvas');
var ctx = c.getContext('2d');
ctx.globalalpha = 0.3;
for(var i=0; i<1000; i++) {
ctx.beginPath();
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@klange
klange / _.md
Last active December 23, 2024 14:40
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@mbostock
mbostock / .block
Last active July 20, 2017 07:30
Circle-Polygon Intersection
license: gpl-3.0
@mganss
mganss / Pool.cs
Created January 2, 2013 12:55
A buffer pool and an in-memory stream that uses it.
using System;
using System.Collections.Concurrent;
namespace XY
{
public interface IPool<T>
{
T Take();
void Return(T t);
}
@thefiddler
thefiddler / gui.cs
Last active January 30, 2024 23:33
GUI example using OpenTK and OpenGL 1.1.
// This code was written for the OpenTK library and has been released
// to the Public Domain.
// It is provided "as is" without express or implied warranty of any kind.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using OpenTK;
using OpenTK.Graphics;
@swkwon
swkwon / protobuftest3.cs
Created January 14, 2014 02:48
protobuf
using System;
using System.Collections.Generic;
using System.IO;
using ProtoBuf;
namespace ConsoleApplication43
{
[ProtoContract]
class Packet
{
@benblo
benblo / EditorCoroutine.cs
Created April 15, 2014 13:26
EditorCoroutine: coroutines for Unity editor operations. Usage: EditorCoroutine.start(myIEnumerator)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Swing.Editor
{
public class EditorCoroutine
@mindryu
mindryu / MultiScaleCamera.cs
Last active May 21, 2020 03:29
[Unity3D] Multi Resolution Scale Policy Camera.
using System;
using UnityEngine;
/**
* Multi Resolution Scale Policy Camera.
*
* @author Robert Ryu
* @date 10/13/2014
*/
@tylerneylon
tylerneylon / json.lua
Last active December 10, 2025 17:50
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.