Skip to content

Instantly share code, notes, and snippets.

Avatar

Wraithan wraithan

View GitHub Profile
@wraithan
wraithan / interesting-mandelbrot-points.json
Created Apr 27, 2019
These points were discovered by random search, with a limit of 10,000,000 iterations. It was done using 64-bit floats in Rust on windows. I'm pretty sure this data is accurate but floating point differences on platforms could result in different numbers of iterations.
View interesting-mandelbrot-points.json
{"coordinates":[-1.2615655186094723,0.03507546497357694],"iterations":940801}
{"coordinates":[-1.209121972449824,-0.13699805102265517],"iterations":914670}
{"coordinates":[-0.674235927040522,0.3083167132310569],"iterations":881522}
{"coordinates":[-0.9344163365985594,0.24132338352821892],"iterations":872222}
{"coordinates":[-0.00048721343088731217,0.6357262066895499],"iterations":764465}
{"coordinates":[-0.7114898050414675,-0.28292832952861735],"iterations":756351}
{"coordinates":[-0.19571795008880288,0.64520604564051],"iterations":753373}
{"coordinates":[0.014393972324413973,0.6321431765766841],"iterations":732306}
{"coordinates":[-0.6904030514286048,0.3466033304784526],"iterations":720501}
{"coordinates":[0.27643386677645854,0.47126076358172186],"iterations":705920}
@wraithan
wraithan / logo.md
Last active Apr 29, 2018
Wraith Aerospace Logo Parameters
View logo.md

Summary

Flag/logo for a fictional rocket and space plane design and launch company (like SpaceX or Blue Origin) named Wraith Aerospace. Logo should be a vector image and contain a scythe with a skeletal hand holding it and the words "Wraith Aerospace" on it in a clean sans-serif font. Ideally done in a very low number of colors (1-2 not counting transparent background).

Use case

A fanfiction mission log of a Kerbal Space Program playthrough. The logo will be used in game on for the mission's playthrough and will be on ships in screenshots, for that form I'll export a 256x160 PNG of the vector image. The logo will also be used on a website I'm putting together to organize the mission.

It would be cool to have 2 variants, one that is just the flag/logo, maybe with a couple stars in the background. Another with a circular area that takes up a quarter to third of the space for inserting mission/ship/etc images I make.

View stats.rs
use std::io::Write;
use std::net::TcpListener;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::thread;
pub fn run_stats_server () -> Sender<Stats> {
let (stats_tx, stats_rx) = channel();
thread::Builder::new()
.name("Stats:Collector".into())
.spawn(move || {
@wraithan
wraithan / streaming-parser.md
Last active Jan 11, 2016
Thoughts on streaming (protocol) parsers in strongly typed languages
View streaming-parser.md

Streaming Parsers in Strongly Typed Languages

I've been building a number of parsers in Rust lately while studying or doing code challenges. One of my side projects that involved parsing is weechat-notifier. I set about building the parser in the most intuitive way to me as a primarily JavaScript developer these days.

Before we get into the mistakes I made, lets talk about the protocol I'm parsing. The

View basic-cb.cc
#include <nan.h>
namespace memcheck {
using v8::Function;
using v8::FunctionTemplate;
using v8::Local;
using v8::String;
using v8::Value;
using Nan::Callback;
View arith-const.rs
#[derive(Debug,PartialEq,Eq)]
enum Constant {
True,
False,
Zero
}
named!(constants<Constant>, alt!(
tag!("0") => { |_| Constant::Zero}
| tag!("true") => { |_| Constant::True}
View tmux.conf
set-option -g default-terminal "screen-256color"
set-option -g prefix C-z
unbind-key C-b
bind-key z send-prefix
bind-key C-z last-window
bind r source-file ~/.tmux.conf
bind c new-window -c "#{pane_current_path}"
set -g base-index 1
View gist:4170b4069a5a1ccd02b9
0 info it worked if it ends with ok
1 verbose cli [ '/Users/wraithan/.nvm/versions/io.js/v2.0.0/bin/iojs',
1 verbose cli '/Users/wraithan/.nvm/versions/io.js/v2.0.0/bin/npm',
1 verbose cli 'install',
1 verbose cli 'hashring' ]
2 info using npm@2.9.0
3 info using node@v2.0.0
4 verbose install initial load of /Users/wraithan/devel/newrelic/nodejs_agent/package.json
5 verbose installManyTop reading scoped package data from /Users/wraithan/devel/newrelic/nodejs_agent/node_modules/JSV/package.json
6 verbose installManyTop reading scoped package data from /Users/wraithan/devel/newrelic/nodejs_agent/node_modules/architect/package.json
@wraithan
wraithan / server.rs
Last active Aug 29, 2015
Read data in per line, then print it
View server.rs
use std::io::{TcpListener, TcpStream};
use std::io::{Acceptor, Listener};
use std::io::BufferedReader;
fn main() {
let listener = TcpListener::bind("127.0.0.1", 8080);
// bind the listener to the specified address
let mut acceptor = listener.listen();
View index.js
var dialog = require('osx-dialog')
dialog({
title: 'something',
msg: 'message',
checkboxes: [
'first',
'second',
'third'
],
You can’t perform that action at this time.