Skip to content

Instantly share code, notes, and snippets.

View therustmonk's full-sized avatar
🦀
thread 'main' panicked at 'not yet implemented', src/main.rs:2:5

Denis Kolodin therustmonk

🦀
thread 'main' panicked at 'not yet implemented', src/main.rs:2:5
View GitHub Profile
@therustmonk
therustmonk / cargo_out.txt
Created September 23, 2015 20:51
rust-encoding failed to compile with rust-msvc_x64 log
Fresh encoding-types v0.2.0 (file:///C:/DEVELOPMENT/rustio/rust-encoding)
Fresh getopts v0.2.14
Fresh encoding_index_tests v0.1.4 (file:///C:/DEVELOPMENT/rustio/rust-encoding)
Compiling encoding v0.2.32 (file:///C:/DEVELOPMENT/rustio/rust-encoding)
Running `rustc src\lib.rs --crate-name encoding --crate-type lib -g --test -C metadata=2646d88d1f6b7cd5 -C extra-filename=-2646d88d1f6b7cd5 --out-dir C:\DEVELOPMENT\rustio\rust-encoding\target\debug --emit=dep-info,link -L dependency=C:\DEVELOPMENT\rustio\rust-encoding\target\debug -L dependency=C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps --extern encoding_types=C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_types-fe8521ccc808562d.rlib --extern getopts=C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libgetopts-bd82d57ca5684ae5.rlib --extern encoding_index_tradchinese=C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_index_tradchinese-50f5d4943fa2e14a.rlib --extern encoding_index_japanes
@therustmonk
therustmonk / hkt.rs
Created October 31, 2015 15:05 — forked from 14427/hkt.rs
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;
use std::net;
use std::io::Read;
fn main() {
let listener = Arc::new(Mutex::new(0));
let counter = Arc::new(AtomicUsize::new(0));
let mut threads: Vec<_> = Vec::with_capacity(10000);
@therustmonk
therustmonk / Main.elm
Created August 17, 2016 19:11 — forked from pdamoc/Main.elm
Req msg with cache
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Events exposing (onClick)
import Req exposing (..)
import Dict exposing (Dict)
main : Program Never
@therustmonk
therustmonk / control.rs
Created September 21, 2016 11:20
Rust thread control
use std::time::Duration;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::thread;
fn main() {
// Play with this flag
let fatal_flag = true;
let do_stop = true;
@therustmonk
therustmonk / .gitconfig
Created November 30, 2016 06:01 — forked from jhradilek/.gitconfig
A Git alias to display the total number of insertions and deletions.
# Usage: git total [OPTION...]
#
# Options:
#
# In theory, the command accepts all command line options supported by
# the "git log" command. In reality, however, only few commit-limiting
# options are useful. This includes:
#
# --author=PATTERN, --committer=PATTERN
# Displays the number of lines changed by a certain author.
@therustmonk
therustmonk / ffi.h
Created December 22, 2016 20:00 — forked from dylanede/ffi.h
CEF C API combined header
#include "cef_app_capi.h"
#include "cef_auth_callback_capi.h"
#include "cef_base_capi.h"
#include "cef_browser_capi.h"
#include "cef_browser_process_handler_capi.h"
#include "cef_callback_capi.h"
#include "cef_client_capi.h"
#include "cef_command_line_capi.h"
#include "cef_context_menu_handler_capi.h"
#include "cef_cookie_capi.h"
@therustmonk
therustmonk / gist:0d09fe1bc77ac211456c4da9a48526a3
Created February 3, 2017 12:51 — forked from mausch/gist:3188428
Async exception handling in F#
open System
open System.Net
// exception handling in async using Async.Catch
let fetchAsync (name, url:string) =
async {
let uri = new System.Uri(url)
let webClient = new WebClient()
let! html = Async.Catch (webClient.AsyncDownloadString(uri))
match html with
port module Spelling exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import String
main =
@therustmonk
therustmonk / create-efi-keys.sh
Last active June 1, 2018 11:44 — forked from Era-Dorta/create-efi-keys.sh
Sign Intel SGX kernel modules on Fedora (UEFI Secure Boot)
# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script
# ~/.ssl/sign-all-modules.sh
# Place all files in ~/.ssl folder
mkdir ~/.ssl
cd ~/.ssl
# Generate custom keys with openssl
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/"