Skip to content

Instantly share code, notes, and snippets.

@Matthias247
Matthias247 / async_await_cancellation.md
Created May 28, 2019 06:09
Async/Await - The challenges besides syntax - Cancellation

Async/Await - The challenges besides syntax - Cancellation

This is the second article in a series of articles around Rusts new async/await feature. The first article about interfaces can be found here.

In this part of the series we want to a look at a mechanism which behaves very different in Rust than in all other languages which feature async/await support. This mechanism is Cancellation.

@pinge
pinge / ubuntu_14.04_macbook_pro_retina_15_inch_mid_2014.md
Last active March 10, 2021 03:05
How to install Ubuntu 14.04.1 LTS on a MacBook Pro Retina 15" Mid 2014 (11,3)
@d2fn
d2fn / man-eating-cats_haruki-murakumi_en.md
Last active November 2, 2023 23:47 — forked from thoward/man-eating-cats_haruki-murakumi_en.md
Man Eating Cats, Haruki Murakami

Man-Eating-Cats

by Haruki Murakami
Translated by Philip Gabriel

Source

I bought a newspaper at the harbor and came across an article about an old woman who had been eaten by cats. She was seventy years old and lived alone in a small suburb of Athens -- a quiet sort of life, just her and her three cats in a small one-room apartment. One day, she suddenly keeled over face down on the sofa -- a heart attack, most likely. Nobody knew how long it had taken for her to die after she collapsed. The old woman didn't have any relatives or friends who visited her regularly, and it was a week before her body was discovered. The windows and door were closed, and the cats were trapped. There wasn't any food in the apartment. Granted, there was probably something in the fridge, but cats haven't evolved to the point where they can open refrigerators. On the verge of starvation, they were forced to devour their owner's flesh.

I read this articl

@pstjuste
pstjuste / l2capsender.c
Last active May 15, 2017 06:05
WebRTC session creation over command line
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/un.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@ssylvan
ssylvan / rh_hash_table.hpp
Last active January 12, 2023 04:52
Quick'n'dirty Robin Hood hash table implementation. Note, I have implemented this algorithm before, with tons of tests etc. But *this* code was written specifically for the blog post at http://sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/, it has not been extensively tested so there may be bugs (an…
#define USE_ROBIN_HOOD_HASH 1
#define USE_SEPARATE_HASH_ARRAY 1
template<class Key, class Value>
class hash_table
{
static const int INITIAL_SIZE = 256;
static const int LOAD_FACTOR_PERCENT = 90;
struct elem
@rvagg
rvagg / README.md
Last active May 4, 2024 12:17
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@clarle
clarle / app.js
Created July 26, 2012 07:35
Short tutorial on how to use Express and node-mysql
// Module dependencies
var express = require('express'),
mysql = require('mysql');
// Application initialization
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
@bellbind
bellbind / Info.plist.json
Created July 25, 2012 08:22
[macosx][ios][objective-c]Building iOS 5.1 app with command line (completely Xcode-less programming)
{"UIDeviceFamily":[1,2]}
@vsergeev
vsergeev / beagle_elfs.md
Created April 15, 2012 09:45
Minimalist "Embedded Linux from Scratch" Beaglebone Distribution Build

Busybox "Embedded Linux from Scratch" Distribution for the Beaglebone

Prepare your Build Sandbox

$ mkdir -p beaglelfs/{sources,rootfs_install,boot_mnt,rootfs_mnt}

Acquire an ARM Toolchain

Download the latest i686 Binary TAR of the ARM GNU/Linux (glibc-based) Lite Toolchain:

@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)