Instantly share code, notes, and snippets.

View tcpclose.crs
#!/usr/bin/env run-cargo-script
//! ```cargo
//! [dependencies]
//! tokio = "=0.1.7"
//! tokio-codec = "*"
//! tokio-io = "=0.1.7"
//! futures-cpupool = "*"
//! mio = "*"
//!
//! [replace]
View playground.rs
#!/usr/bin/env run-cargo-script
// cargo-deps: tokio, tokio-codec, tokio-io, futures-cpupool
extern crate tokio;
extern crate tokio_codec;
extern crate tokio_io;
extern crate futures_cpupool;
use tokio_codec::{Decoder, LinesCodec};
View log
* Options given/available:
-platform 0 [=default]
-device 0 [=default]
--- OpenCL device naming:
* Device type GPU
* Device name Intel(R) HD Graphics IvyBridge M GT2
* Platform vendor Intel
View CLBlast_M_GT2.txt
clblast_test_diagnostics
* Options given/available:
-platform 0 [=default]
-device 0 [=default]
--- OpenCL device naming:
* Device type GPU
* Device name Intel(R) HD Graphics IvyBridge M GT2
View tokiostdin.rs
extern crate futures;
extern crate tokio_core;
extern crate tokio_io;
extern crate tokio_file_unix;
use futures::{Future};
use tokio_io::io::copy;
use tokio_core::reactor::Core;
use std::io::{Result};
View miostdin.rs
extern crate mio;
use mio::unix::EventedFd;
use std::fs::File;
use mio::{Token, PollOpt, Ready, Poll, Events};
//use mio_uds::UnixStream;
use std::os::unix::io::{FromRawFd};
use std::io::{Read, Write};
View hextobin.c
// Based on https://stackoverflow.com/a/23898449/266720
void tallymarker_hextobin(const char * str, uint8_t * bytes, size_t blen)
{
uint8_t pos;
uint8_t idx0;
uint8_t idx1;
// mapping of ASCII characters to hex values
const uint8_t hashmap[] =
{
View _example.c
#include <stdio.h>
#include <stddef.h>
#include <assert.h>
#include "robinhoodhash.h"
struct entry {
int key;
char value;
};
View zlibdict.c
#include <stdio.h>
#include <string.h>
#include <zlib.h>
#include <inttypes.h>
#include <assert.h>
uint8_t dict[4096];
size_t dict_size;
View mkv.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 14 columns, instead of 11.
AlphaMode,4,[53][C0],-,-,-,0,u,,,*,*,*,Alpha Video Mode. Presence of this Element indicates that the BlockAdditional Element could contain Alpha data.
AspectRatioType,4,[54][B3],-,-,-,0,u,*,*,*,*,*,"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."
AttachedFile,2,[61][A7],mand.,mult.,-,-,m,*,*,*,*,,An attached file.
AttachmentLink,3,[74][46],-,-,not 0,-,u,*,*,*,*,,The UID of an attachment that is used by this codec.
Attachments,1,[19][41][A4][69],-,-,-,-,m,*,*,*,*,,Contain attached files.
Audio,3,[E1],-,-,-,-,m,*,*,*,*,*,Audio settings.
BitDepth,4,[62][64],-,-,not 0,-,u,*,*,*,*,*,"Bits per sample, mostly used for PCM."
BitsPerChannel,5,[55][B2],-,-,-,0,u,,,,*,,Number of decoded bits per channel. A value of 0 indicates that the BitsPerChannel is unspecified.
Block,3,[A1],mand.,-,-,-,b,*,*,*,*,*,Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)
BlockAddID,5,[EE],mand.,-,not 0,1,u,*,*,*