Skip to content

Instantly share code, notes, and snippets.

View Froussios's full-sized avatar

Christos Froussios Froussios

  • Google
  • Australia
  • 04:06 (UTC +10:00)
View GitHub Profile
@Froussios
Froussios / 4 Reactors.md
Last active August 4, 2020 19:10
Factorio - Quad Nuclear Reactors

This setup fully uses the output of 4 adjacent nuclear reactors.

  • The reactors are supplied via the logistics network.
  • Steam tanks and a few extra reactors allow nuclear power to temporarily go over max capacity (e.g. during night, when combined with solar panels).
  • Water supply is a single pipe, so you must build pressure with pumps.
@Froussios
Froussios / Modular fluid balancing.md
Last active August 4, 2020 18:56
Factorio - Modular fluid balancing

This module converts heavier oils into lighter oils.

  • Oils are converted only if there is more of the heavy oil than the light oil.
  • An alert fires if any of the tanks if close to empty (suggesting overall production is insufficient).
  • More chemical plants can be added with a simple copy-paste.

This blueprint is on github

@Froussios
Froussios / description.md
Last active July 26, 2020 22:10
Factorio - Compact Kovarex Enrichment

A simple implementation of Kovarex enrichment. The centrifuge sits between a belt of uranium-235 and a belt of uranium-238. It balances the belts by converting uranium-238 to uranium-235.

The blueprint includes two centrifuges, but using only one also works.

Advantages of this implementation:

  • Compact and space efficient.
  • Minimal management of the different uranium versions: just split into different belts.
document.querySelectorAll("div[role='row']").forEach((row,index) => {
if (row.innerHTML.includes('rsolomakhin') && index < 1000) {
let button = row.querySelectorAll("div[role='button']")
console.log('deleting');
button[1].click();
}
})
@Froussios
Froussios / TetrisSearch.cpp
Created September 21, 2016 21:21
A solver for the Talos Principle's tetris puzzles
// TetrisSearch.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <list>
@Froussios
Froussios / dirt.java
Created November 16, 2015 18:27
Reflection save and restore RxJava operator state
package drx.mocks;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Froussios
Froussios / ProcessMonitor.cs
Created October 23, 2015 23:35
A program that monitors when applications start and stop
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reactive;
using System.Reactive.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Threading;
using System.Diagnostics;
@Froussios
Froussios / iterative.cpp
Last active November 6, 2020 08:12
C++ Solution for n-queens
#include <iostream>
#include <cassert>
#include <stdlib.h> /* atoi */
using namespace std;
void iter(int size, int &count) {
int positions[size];
bool lines[size];
@Froussios
Froussios / gist:6f7e838d252b7e8a667a
Created May 22, 2015 14:28
Java type inference (not)
public class SwitchMapTest {
public void example() {
Observable.interval(100, TimeUnit.MILLISECONDS)
.switchMap(i ->
Observable.interval(30, TimeUnit.MILLISECONDS)
.map(l -> i))
.take(9)
.subscribe(System.out::println);
package itrx;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import rx.Observable;
import rx.observers.TestSubscriber;