Skip to content

Instantly share code, notes, and snippets.

@wraithan
wraithan / interesting-mandelbrot-points.json
Created April 27, 2019 17:08
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.
{"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}
------------
|end |home|
------+-----+-----
|back |shift|alt |
|space| |----|
| | |ctrl|
------------------
-------------
|pgup |pgdn |
@wraithan
wraithan / base.html
Created January 23, 2012 00:17
Generic Template with Extra Context
<!doctype html>
<html>
<head>
<title>{{page_name}}</title>
</head>
<body>
<h1>{{page_name}}</h1>
{% block content %}
{% endblock content %}
</body>
@wraithan
wraithan / logo.md
Last active April 29, 2018 19:17
Wraith Aerospace Logo Parameters

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.

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 January 11, 2016 14:49
Thoughts on streaming (protocol) parsers in strongly typed languages

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

@wraithan
wraithan / cbv.py
Created January 8, 2014 22:13
Stab at moving to CSV
import calendar
import json
from collections import defaultdict
from django.http.response import (HttpResponse, HttpResponseBadRequest,
HttpResponseForbidden)
from django.db.models import Avg, Min, Max, Sum
from django.views.generic.base import View
from ordereddict import OrderedDict
ethernet: 10.0.0.1
wifi: 192.168.0.1
localhost: 127.0.0.1
server listening on 192.168.0.1:
ethernet: fail
wifi: success
localhost: fail
server listening on 0.0.0.0:

Dear Rackspace Customer,

Due to our expanding operations and inquiries from local authorities, Rackspace will begin collecting sales tax on taxable sales to our customers located in your state beginning on January 28, 2014.

If you are an exempt organization, possess a direct pay permit or qualify as a reseller of our services, please provide us with the requisite documentation as soon as possible. Note that since we will now be including sales tax on your invoice, you are no longer required to accrue and remit local use tax for our services.

As a valued customer we would like to ensure that you are taxed appropriately, so please review the primary address that is currently on file for your account. If updates are needed, please submit a support ticket to ensure that we have the correct information on file.

Your exemption documentation may be faxed to 1-210-855-8447 (US) or emailed to tax@lists.rackspace.com.

Handling multiple bots in a single redis instance

This is meant to be the basis for a discussion on this topic. It will cover some of the background as well as the ideas I currently have for handling this.

Background

Commonly people as about how to run ZenIRCBot against multiple IRC servers, as well as running multiple bots in the same instance of redis. My original