Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Chronial
Chronial / coins.py
Created May 18, 2015 12:08
coins.py
from itertools import product
alice = lambda x: x
bob = lambda x: not x
print(all(alice(a) == b or bob(b) == a
for a, b in product([True, False], repeat=2)))
@Chronial
Chronial / vimrc.local
Created June 26, 2015 15:35
Vimrc for servers
" Based on sensible.vim 1.1
if exists('g:loaded_sensible') || &compatible
finish
else
let g:loaded_sensible = 1
endif
if has('autocmd')
filetype plugin indent on
@Chronial
Chronial / .tmux.conf
Created June 26, 2015 15:38
.tmux.conf for servers
# use UTF8
set -g utf8
set-window-option -g utf8 on
# Set the default terminal mode to 256color mode.
set -g default-terminal "screen-256color"
# use fish shell
set-option -g default-shell "/usr/bin/fish"
@Chronial
Chronial / unitdata.txt
Created May 1, 2012 13:43
Unit Data from Epic War saga
DATA
fire_kiddragon
pk_id 1
name_id kiddragon
name_str Puppy Dragon
desc Magic Unit
level_req 0
price_gold 500
price_crystal 0
pop 6
#!/usr/bin/python -O
"""
Finds the branch all the commits have most likely been mode on
"""
import os
import sys
import re
from pprint import pprint
@Chronial
Chronial / is_online.php
Created April 26, 2016 13:56
Steam API Wrapper for DSCM
<?php
$ids = explode(',', $_GET['ids']);
$ids = array_filter($ids, 'is_numeric');
$data = ask_api($ids);
foreach ($data as $k => $v){
echo $k . ',' . ($v ? "True" : "False") . "\n";
}
@Chronial
Chronial / whitenoise_compressor.py
Last active June 5, 2016 10:41
Whitenoise support for django compressor
from django.conf import settings
from whitenoise.django import DjangoWhiteNoise
class DjangoCompressWhiteNoise(DjangoWhiteNoise):
def __call__(self, environ, start_response):
# Handle files generated on the fly by django-compressor
url = environ['PATH_INFO']
if url.startswith(self.static_prefix) and url not in self.files:
if self.is_compressed_file(url):
@Chronial
Chronial / reactor_idle_fix.user.js
Last active April 4, 2017 23:08
Rector Idle HeatExchange fixer UserScript
// ==UserScript==
// @name Reactor Idle HeatExchange fixer
// @namespace https://gist.github.com/Chronial/5981aff4706e6d59f1f5ff743cfe4350
// @version 0.1
// @description Fix heat exchanger in reactor idle
// @author Chronial
// @match http://reactoridle.com/
// @grant none
// ==/UserScript==
@Chronial
Chronial / letter-table.ipynb
Created January 11, 2018 13:09
Letter Table Code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.