Skip to content

Instantly share code, notes, and snippets.

wolfiestyle darkstalker

  • Chile
Block or report user

Report or block darkstalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@darkstalker
darkstalker / gtk_frp.rs
Created Jan 17, 2019
FRP in Gtk proof of concept
View gtk_frp.rs
use fragile::Fragile;
use frappe::{Signal, Sink, Stream};
use glib;
use gtk;
use gtk::prelude::*;
use std::thread;
use std::time::Duration;
fn main() {
gtk::init().unwrap();
View gist:84760485577d3f761caf4ee3949fc3f6
dOKVqcGiLsuCjLsQpPucgLqQsNsivXRukrPMLsjk5wkb7sivmmrXXi0YKKNjLAAcX1uI2MqY3eLmoujNtPuZtPev6EcPO9jKkDquPAHKupevkturYfvk2OKYhvkjJuiLoPsYkvkrvVuPeAMeuUjbv7uQ(jbzOksDuHuyPkP8uKPs0vvc9vLsKXQuIkMRIO2l8xsYGveoSilMapgvnzsCzQ2mQ4Zc1OvuDAuwTqQQxRiYSP42IQDtPFly4sXYL45KA6QUUcBxr57sjJxP68sQwVsQ2VOudribLGehKguv0js0rmcOCqkGuGeuXJzbRSEJdkUegnGs8NnZLfwCSxeEqXrFbXmG89MKvXvGAqkmD0Fy5pBMdkzmGykGQ5LKj7jeup7j2sEXBL4WbuDH4Wr7h9feZKbKDKllS4yVOrxeK2nCMoWShKAHKsHeUW2utcYeskqc6jJBFfKGYhMZGehh0tg3EibLpmNbjooifghom(H51Heu(WCgK44GkjEhsq5dZzqIJdItI)SGfsq5dZzqIJdQzwZtg3EibLpmNbjooOsW4qckFyodsCCq8MKwdjinZgBCqtT2IRMch0q7Q4njTg0ldhhhepKOlcjOe)zZCzHfh7fHhuC0Za6((f3ytcmUcea6fwCSxGee)q)qUQ5mfh0z5UcOxVXbPF6dnOH1N52dknEa0q7Q0ZdTeYc1G8zU9G4wiyucTSzpX0LqCX16SNi6LACJj6buXtgQXnMEk3bXD98uEY6BbD2tuR421RdAODv6g3y6PChQbPN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stalker
darkstalker / frp.rs
Created Mar 3, 2017
FRP in Rust without reckless cloning
View frp.rs
#![allow(dead_code)]
use std::rc::Rc;
use std::cell::RefCell;
use std::borrow::Cow;
use std::ptr;
// callbacks use a Cow<T> argument so we can choose at runtime if
// we will send a ref or an owned value
struct Callbacks<T: Clone>
{
View gist:af608b06e7a0aa2964b4c2c83da3e6ba
daJIcaGAQQQDHi2grmBc3Kk1TLQDsv2lSBvA)QOFIinmr53I0GvudxuDmeoNI0cPswQK0ILeTCfEkQLrkphPjkjmvsMSQA6uUkvv5zsPRRkBKQYMjvBxr8zrCzHPrK(ovv6Xe1HL40knEQQ4Ksk3Ik6AsX5vH)sf(MKQXHOgeqbEHhrRgrRuWuWAK0ssgjzG7G)G)qbUiB7Kqn2KKy4o9hWZjrgyBSjjXakW08qiQ9bR1kPEtDWP(9s6vCaxGF0WbnpeIAF4c8T0dW(2yCCoxn(NZUlBpguW08qiQ9Pqbpc4P1kPEtDyGVLEqHcEeG9TX44CUA8pNDx2EmOWGbwKw(qb2kI4AqbU)e2cfmyGLffkfkW09MicWvu1F1QagyAEidfy6Eteb80GbwViBB6fkW9NWwOGbd8JgoKffkfUapkYbuG7pHTqbdg4)QRVYpHDaf4(tyluWGb(rdh08qgUapsfbuG7pHTqbdg4hnCiN2RSyWf48j5wrexdkW9NWwOGbdg4rKSPx1rEaELtVG37AoKt75IWIp8iaVFWUlBpg0Z5kF66G)l1)VRSTtcWfHaSFivxNgg85u6uTgYzTnzAnzeKjtg6oL2a((6QXMKedk8iaFqQUonm4ZjznjKB1KQrmvstwMecO7uAdmWfOa7BJXX5C14Fo7US9yqHhrRw2ujWapbEes1iGba
View awoo_tool.lua
#!/usr/bin/env lua
-- Awoo Tool by @wolfiestyle
-- license: MIT/X11
-- demo: https://twitter.com/wolfiestyle/status/767124329461084161
local lgi = require "lgi"
local Gtk = lgi.Gtk
local GLib = lgi.GLib
local window = Gtk.Window{
title = "awoo tool v0.1-alpha",
@darkstalker
darkstalker / 01_animals.cpp
Created Aug 10, 2016
the classic Animal class example in C++ and Rust
View 01_animals.cpp
// the OOP version in C++
#include <iostream>
// base abstract class. that is what we use as the interface
class Animal
{
public:
Animal(char const* name): m_name(name) {}
// this is required to properly delete virtual classes
@darkstalker
darkstalker / deepdream.py
Created Aug 5, 2016
deep dream command line utility
View deepdream.py
#!/usr/bin/env python2
# based on the code from: https://github.com/google/deepdream
import argparse
parser = argparse.ArgumentParser(description='Deep dreams an image.')
parser.add_argument('image', type=open, help='image file to process')
parser.add_argument('-g', '--gpu', action='store_true', help='enable GPU acceleration')
parser.add_argument('-o', '--out', type=argparse.FileType('w'), default='out.png', help='output image file')
args = parser.parse_args()
from cStringIO import StringIO
@darkstalker
darkstalker / gdb_lua
Created Nov 13, 2015
gdb script to get bracktraces from Lua core dumps
View gdb_lua
set $p = L->ci
while ($p > L->base_ci )
if ( $p->func->value.gc->cl.c.isC == 1 )
printf "0x%x C FUNCTION ", $p
output $p->func->value.gc->cl.c.f
printf "\n"
else
if ($p->func.tt==6)
set $proto = $p->func->value.gc->cl.l.p
set $filename = (char*)(&($proto->source->tsv) + 1)
@darkstalker
darkstalker / sphtrace.rs
Last active Oct 9, 2015
raytracer in Rust
View sphtrace.rs
extern crate num;
extern crate nalgebra as na;
use std::io::{self, Write};
use std::fs::File;
use std::f64::consts;
use num::complex::Complex64;
use num::{Zero, One};
use na::{Vec2, Vec3, Mat3, Dot, Cross, Norm};
You can’t perform that action at this time.