Skip to content

Instantly share code, notes, and snippets.

View 0x000def42's full-sized avatar

Dmitriy 0x000def42

  • Malaysia
  • 10:48 (UTC +07:00)
View GitHub Profile
@Morozzzko
Morozzzko / adt.rb
Created October 31, 2021 14:53
Using dry-types & dry-struct ADT to automap data
# frozen_string_literal: true
require 'bundler/inline'
require 'irb'
gemfile do
gem 'dry-types', '~> 1.0'
gem 'dry-struct', '~> 1.0'
end
@keplersj
keplersj / logged.rs
Created July 25, 2015 21:00
Gist demonstrating the ability to run Crystal code from Rust.
#[link(name = "logger")]
extern {
fn CrystalLog(text: *const u8);
}
fn log(text: &'static str) {
unsafe{ CrystalLog(text.as_bytes().as_ptr()) };
}
fn main() {
@bodokaiser
bodokaiser / libuv_tcp_echo_server.c
Last active May 30, 2021 10:10
Simple TCP echo server implemented with libuv.
#include <uv.h>
#include <stdio.h>
#include <stdlib.h>
/**
* Our tcp server object.
*/
uv_tcp_t server;
/**