Skip to content

Instantly share code, notes, and snippets.

View scitesy's full-sized avatar

Scott Scites scitesy

View GitHub Profile
@anttisalonen
anttisalonen / main.rs
Created October 7, 2018 20:52
yew + websocket echo client
#[macro_use]
extern crate yew;
extern crate failure;
use failure::Error;
use yew::prelude::*;
use yew::format::Json;
use yew::services::ConsoleService;
use yew::services::websocket::{WebSocketService, WebSocketStatus, WebSocketTask};
@mavnn
mavnn / supervisor.fsx
Last active September 1, 2016 13:13
Hopac supervisor using proc
#!/usr/bin/env fsharpi --exec
#I "packages/Hopac/lib/net45"
#r "Hopac.Core.dll"
#r "Hopac.dll"
#r "Hopac.Platform.dll"
open System
open Hopac
open Hopac.Infixes
type Policy =
@seanjensengrey
seanjensengrey / rust-python-cffi.md
Last active April 3, 2024 11:55
Calling Rust from Python/PyPy using CFFI (C Foreign Function Interface)

This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes.

Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes

CFFI is nice because:

  • Reads C declarations (parses headers)
  • Works in both CPython and PyPy (included with PyPy)
  • Lower call overhead than ctypes
@hussam
hussam / EasyLayout.fs
Last active October 25, 2017 17:50 — forked from praeclarum/EasyLayout.fs
EasyLayout makes writing auto layout code in Xamarin.iOS F# easier. (Unified API)
module EasyLayout
open System
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Quotations.Patterns
open Microsoft.FSharp.Quotations.DerivedPatterns
open Foundation
open UIKit
open CoreGraphics
@panesofglass
panesofglass / reload.fs
Created June 11, 2012 02:57
Better than a REPL - Reload!
// 1. Watch source files for changes.
// 2. When a change is detected, recompile.
// 3. When assembly changes are detected, reload. (katana?)
// 4. Allow editing of files in a gui (dropbox integration?)
#if INTERACTIVE
#r @"..\packages\FAKE.1.64.6\tools\FakeLib.dll"
#endif
open System