Skip to content

Instantly share code, notes, and snippets.

View kitten's full-sized avatar

Phil Pluckthun kitten

View GitHub Profile
@kitten
kitten / cantor-search.js
Last active December 21, 2015 09:07
Mapping x-y players to a Cantor paired arrays
import { List, Map } from "immutable";
const players = new Map();
const playerCoors = new Array(2048 * 2048).map(() => new List());
function cantorPairing(x, y) {
return 0.5 * (x + y) * (x + y + 1) + y;
}
class CantorSearch {
/*
* Modern Reset
* https://gist.github.com/philpl/2bff8f6c9af027649dfd
* v1.0 (8th July 2016)
* License: CC0-1.0
*/
html, body {
height: 100%;
width: 100%;
@kitten
kitten / fix.md
Last active February 9, 2024 15:19
Fix "Unknown Chipset" with nouveau

Booting from a Linux installation disk with a newer graphics card might trigger an "Unknown Chipset" error from nouveau.

Add nomodeset nouveau.modeset=0 to the kernel options to fix it.

In UEFI Boot Mode it might also hang at "Triggering uevents", which is the same issue without the error message.

@kitten
kitten / copy.js
Last active March 4, 2016 17:56
Copy text to the user's clipboard
var copy = (function() {
var input = document.createElement('input');
input.style.opacity = '0';
input.style.position = 'fixed';
input.style.top = '-1000%';
document.body.appendChild(input);
return function copy(text) {
input.value = text;
input.select();
@kitten
kitten / ssh_config
Last active March 13, 2016 15:38
ssh/config
Host *
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
Compression yes
CompressionLevel 6
UseRoaming no
# Only allow RSA and ED25519 keys
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
@kitten
kitten / setup.sh
Created March 13, 2016 21:28
PiTV install script recovered from pitv.pw server
#!/bin/sh
# Setup PiTV
#
# Copyright (C) 2014 Phil Plückthun <phil@plckthn.me>
#
# This work is licensed under the MIT License
if [ `id -u` -ne 0 ]
then
echo "Please start this script with root privileges!"
@kitten
kitten / DraculaUnchained.itermcolors
Last active March 30, 2016 10:29
Setting up OS X systems
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@kitten
kitten / tmux.rb
Created March 29, 2016 20:15
Tmux Homebrew Formula with Truecolor
class Tmux < Formula
desc "Terminal multiplexer"
homepage "https://tmux.github.io/"
stable do
url "https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz"
sha256 "31564e7bf4bcef2defb3cb34b9e596bd43a3937cad9e5438701a81a5a9af6176"
patch do
# This fixes the Tmux 2.1 update that broke the ability to use select-pane [-LDUR]
@kitten
kitten / data-orchestration-decisions.md
Last active August 11, 2016 10:34
Data Orchestration Decisions: Entities

Data Orchestration Decisions: Entities

Problems we tried to solve with Entities

We need to migrate fragmented parts of code that handle business logic into a centralised, predictable place

Our reasoning behind that is that, at the time, we are writing logic based on our data structures in UI components. Thus no component can act as a smart or dumb component, since every component when needed interprets the data in its own way.

@kitten
kitten / cla.md
Last active January 1, 2017 22:38
CC0 CLA

Individual Contributor License Agreement (CLA)

Thank you for submitting your contributions to this project.

By signing this CLA, you agree that the following terms apply to all of your past, present and future contributions to the project.

License.

You hereby represent that all present, past and future contributions are governed by the