Skip to content

Instantly share code, notes, and snippets.

@SpaceManiac
SpaceManiac / shortcircuit.rs
Created September 17, 2016 23:59
Initial sketch of user-defined short-circuiting && and || operators in Rust.
trait And<Rhs=Self> {
type Output;
fn short(&self) -> Option<Self::Output>;
fn and(self, rhs: Rhs) -> Self::Output;
}
trait Or<Rhs=Self> {
type Output;
fn short(&self) -> Option<Self::Output>;
fn or(self, rhs: Rhs) -> Self::Output;
@SpaceManiac
SpaceManiac / kwargs.rs
Created April 29, 2017 04:16
rough kwargs macro sketch
use std::borrow::Cow;
#[macro_export]
macro_rules! kwargs {
// pass no arguments
() => { |_| {} };
// in-progress variants
(@struct [$($attr:meta)*] $name:ident [$($decls:tt)*] $field:ident: $typ:ty, $($rest:tt)*) => {
kwargs!(@struct [$($attr)*] $name [$($decls)* $field: ::std::option::Option<$typ>,] $($rest)*);
};
@SpaceManiac
SpaceManiac / hello.html
Created May 19, 2017 17:28
Hello World in raw WebAssembly
<meta charset="utf-8">
<script type="text/javascript" src="hello.js"></script>
@SpaceManiac
SpaceManiac / what.cpp
Created September 17, 2017 07:57
CommandLineToArgvW differs from argc/argv
D:\projects\Sandbox>"cpp/"a.exe "cpp/"a.exe
---- argc and argv think:
0: cpp/a.exe
1: cpp/a.exe
---- GetCommandLineW is:
"cpp/"a.exe "cpp/"a.exe
---- CommandLineToArgvW thinks:
0: cpp/
1: a.exe
2: cpp/a.exe
#!/usr/bin/env python3
import sys, shutil
from PIL import Image
from PIL.PngImagePlugin import PngInfo
def split(fname):
image = Image.open(f"{fname}.dmi")
if 'Description' not in image.info:
return
  1. cd to your tgstation directory
  2. mkdir data/planetstation
  3. Place planetstation.py in tools/mapmerge2/
  4. set PYTHONPATH=tools/mapmerge2
  5. python3 -m planetstation _maps/map_files/*/*Station.dmm
  6. Observe output in data/planetstation

If that doesn't work ping me on IRC or figure it out.

@SpaceManiac
SpaceManiac / gist:a8c05ca4b54d44004e9c2b5248701e73
Created June 29, 2018 01:27
Comcast "alert" injected into tail of HTTP request in order to deliver supposedly-"critical and time sensitive", non-disableable 100% data cap notif
<script language="JavaScript" type="text/javascript">
// Copyright (C) 2017 Comcast Cable Communications, LLC
// Contact Us: http://customer.xfinity.com/contact-us/
// Intended use of this message is to display critical and time sensitive notifications to customers.
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
@SpaceManiac
SpaceManiac / test.cpp
Last active August 18, 2018 06:20
Demo of thread reclamation crashes w/o hooking world/Del
#include <thread>
#include <memory>
#include <atomic>
using namespace std;
using namespace std::chrono_literals;
atomic<bool> should_quit;
struct wrapper {

Mirror Dimension Infiltration

Abstract

  • Conversion mode
  • Minimal additional mechanics
  • Non-lethal focus
  • Paranoia rather than team deathmatch

Mirror People

#define JOB_MODIFICATION_MAP_NAME "NSS Frenzy"
// Command
/datum/job/New()
..()
MAP_JOB_CHECK
supervisors = "the captain and the head of personnel"
/datum/job/captain/New()
..()