Skip to content

Instantly share code, notes, and snippets.

@javajawa
javajawa / frens.md
Last active November 19, 2020 09:00
Desert Bus Frens
@javajawa
javajawa / map.svg
Last active May 4, 2020 22:40 — forked from Dherman3607/map2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@javajawa
javajawa / twitch-filter.js
Created October 13, 2019 08:07
Twitch Chat Filter
// Twitch Chat Filter that hides messags unless they are from mods or in the list of allowed users.
// Originally written, and still configured, for LRR's PPR streams, where I wanted to be able to read the rules text LLRBot put into chat.
(function()
{
const allowed_users = ['LoadingReadyRun', 'LRRbot', 'LRRMTG_Judge'];
const allow_mods = true;
const log = document.querySelector('div[role="log"]');
window.setInterval(() =>
@javajawa
javajawa / README.md
Created August 5, 2019 15:18
Service Magic

Service file: put in /etc/systemd/system/[name].service

[Unit]
Description=Run foo

# You can sepcify dependencies
#After=network.target
@javajawa
javajawa / README.md
Created October 21, 2018 08:45
Shortest Euclid Solver

This piece of code came out of a challenge to write a euclid solving tool in C in as few source code bytes as possible.

It has been tested as compiling on gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516

@javajawa
javajawa / intro.md
Created August 9, 2018 23:50
EU4 Intro

EU4's management all falls into three categories:

  • Administration
  • Diplomacy
  • Miltary

Each of these has it's own stock of mana/monarch points/power points. All of these categories has technologies and options for 'national ideas' (to help sculpt your playthrough).

Provinces

@javajawa
javajawa / noise.c
Last active August 29, 2015 14:08
Whitenoise Refiner
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
int main( void )
{
FILE* ifh = fopen( "/dev/urandom", "rb" );
/* Number of samples to buffer */
const size_t buffer_size = 256;
@javajawa
javajawa / swap.c
Created November 16, 2012 12:18
Swapping without extra variables
// Sample answer for a quiz :)
swap (int &a, int &b)
{
a = a ^ b; // a' = a ^ b
b = a ^ b; // b' = a' ^ b = a ^ b ^ b = a
a = a ^ b; // a'' = a' ^ b' = a ^ b ^ a = b
}
@javajawa
javajawa / report.latex
Created June 18, 2012 00:09
LaTeXness
\documentclass[a4paper,12pt,twoside]{report}
% Input encoding and page size
\usepackage[utf8]{inputenc}
\usepackage[a4paper,twoside,bindingoffset=12mm,top=22mm,left=20mm,right=20mm,bottom=26mm]{geometry}
\usepackage[compact]{titlesec}
\usepackage{ifdraft}
\ifdraft
{
@javajawa
javajawa / kitten.latex
Created December 13, 2011 20:50
KITTEN
\documentclass[a4paper,landscape]{article}
\usepackage[margin=1pt]{geometry}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\begin{document}
Kitty
\vfill