Skip to content

Instantly share code, notes, and snippets.

View infinityb's full-sized avatar

Stacey Ell infinityb

  • Calgary, Alberta
View GitHub Profile
@infinityb
infinityb / fizzbuzz.rs
Last active September 26, 2020 18:33 — forked from gyng/fizzbuzz.rs
my first fizzbuzz
use std::io::Write;
use std::thread::{self, sleep, JoinHandle};
use std::time::Duration;
fn flush() {
std::io::stdout().flush().unwrap();
}
fn main() {
let mut threads: Vec<JoinHandle<()>> = Vec::new();
@infinityb
infinityb / main.rs
Last active September 17, 2015 22:44 — forked from ehermes/main.rs
struct Atom {
position: [f32; 3],
epsilon: f32,
sigma: f32,
}
impl Atom {
fn new(x: f32, y: f32, z: f32, epsilon: f32, sigma: f32) -> Atom {
Atom {
position: [x, y, z],
#!/usr/bin/env bash
set -e
NIMAGES=8
WD=`pwd`
while [ $# -gt 0 ]
do
@infinityb
infinityb / gist:600c22ae549cecf43244
Last active January 23, 2022 16:44 — forked from webstrand/gist:46fb441e52a8663bced0
Simple Rust Reverse Proxy
extern crate hyper;
extern crate url;
static HOST: &'static str = "www.google.com";
macro_rules! ret_err(
($e:expr) => {{
match $e {
Ok(v) => v,
Err(e) => { println!("Line {}: {}", line!(), e); return; }
from ctypes import c_int, POINTER, cdll, Structure
import time
import socket
try:
import gevent
except ImportError:
gevent = False
dht_so = cdll.LoadLibrary("./libdht.so.1.0.1")