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
use { | |
hyper::{ | |
service::{make_service_fn, service_fn}, | |
Body, | |
Request, | |
Response, | |
Server, | |
}, | |
std::net::SocketAddr, | |
tokio::io::{BufReader, AsyncBufReadExt}, |
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
/* | |
WorkCrew - a WebWorker work queue library | |
Usage: | |
// Create an 8 worker pool using worker.js. | |
var crew = new WorkCrew('worker.js', 8); | |
// Do something whenever a job is completed. | |
// The result object structure is |
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
struct float4 | |
{ | |
float x; | |
float y; | |
float z; | |
float w; | |
}; | |
export void runner_main(uniform int work_groups[3], uniform struct inputs& input, uniform struct outputs& output) | |
{ |
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
#define SPIRV_INLINE inline | |
struct int3 | |
{ | |
int x; | |
int y; | |
int z; | |
}; | |
struct float4 |
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
#version 450 | |
#extension GL_ARB_separate_shader_objects : enable | |
#define WORKER_SIZE 16 | |
#define WORKGROUP_SIZE 4 | |
layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1 ) in; | |
struct Pixel{ | |
vec4 value; |
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
#!/usr/bin/ruby | |
# USAGE: my_bucket_put FILE_1 [FILE_N...] | |
# Uploads $local_path_for_bucket/FILE_1 to my_bucket/FILE_1 | |
# This script has very little configuration to keep it simple (and serve my limited needs). | |
# Create a pre-configured copy of this for all your buckets. Or add command line flags. | |
# | |
# Change this to your bucket name | |
bucketname = "my_bucket" |
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
TarGZ = function(){}; | |
// Load and parse archive, calls onload after loading all files. | |
TarGZ.load = function(url, onload, onstream, onerror) { | |
var o = new TarGZ(); | |
o.onload = onload; | |
o.onerror = onerror; | |
o.onstream = onstream; | |
o.load(url); | |
return o; |
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
-- canvas.hs | |
module Canvas where | |
import Graphics.UI.Gtk hiding (fill,drawPolygon,lineWidth) | |
import Graphics.Rendering.Cairo | |
import Data.Time.Clock.POSIX | |
import Time | |
frac = snd . properFraction | |
modf a b = frac (a / b) * b |
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
var ChangeList = {}; | |
if (typeof module !== 'undefined') { | |
module.exports = ChangeList; | |
} | |
// Creates a new change list struct. | |
// | |
ChangeList.create = function(type) { | |
var type = type || ChangeList.Object; |
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
// Uses getUserMedia to record audio from microphone, compresses it to mp3, and throws it away. | |
// You should change the last step to e.g. pushing the audio to a server over a WebSocket. | |
// This script uses lame.js for mp3 encoding | |
// https://github.com/zhuker/lamejs | |
var audioDataCallback = function(encodedData, originalData) { | |
console.log("Encoded " + encodedData.byteLength + " bytes. Original: " + originalData.byteLength); | |
}; |