Skip to content

Instantly share code, notes, and snippets.

View symisc's full-sized avatar

PixLab | Symisc Systems symisc

View GitHub Profile
@symisc
symisc / client.js
Created December 9, 2018 03:43 — forked from hagino3000/client.js
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();
@symisc
symisc / bin2c.c
Created August 26, 2017 13:43 — forked from albertz/bin2c.c
bin2c
#include <stdio.h>
#include <assert.h>
int main(int argc, char** argv) {
assert(argc == 2);
char* fn = argv[1];
FILE* f = fopen(fn, "r");
printf("char a[] = {\n");
unsigned long n = 0;
while(!feof(f)) {
<?php
//////////////////////////////////
// Reddit "hot" story algorithm //
//////////////////////////////////
function hot($ups, $downs, $date)
{
if (is_string($date)) $date = strtotime($date);
$s = $ups - $downs;