Skip to content

Instantly share code, notes, and snippets.

View kitten's full-sized avatar

Phil Pluckthun kitten

View GitHub Profile
@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.

/*
* 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 / 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 {
@kitten
kitten / Store.js
Created June 25, 2015 22:58
A generic Store factory, that utilises Immutable.js and RxJS
import { EventEmitter } from "events";
import { Observable } from "rx";
import { Map, List } from "immutable";
export default {
createStore(extend) {
const CHANGE_EVENT = "change";
const EventListener = Object.assign({}, EventEmitter.prototype, {
changed() {
this.emit(CHANGE_EVENT);
@kitten
kitten / Example.js
Created May 18, 2015 23:06
Transmit + Store Example
import { PropTypes } from "react";
import { CompatComponent } from "react-compat-component";
import Transmit from "./transmit.js";
import ExampleStore from ",/example-store.js";
import { List } from "immutable";
class Example extends CompatComponent {
getPropTypes() {
return {
data: PropTypes.instanceOf(List).isRequired
@kitten
kitten / Transmit.js
Created May 18, 2015 22:59
A Transmit class, that takes a Store and a Component, wraps the component in an anonymous wrapper and injects the store's data
import React from "react";
import Store from "./Store.js";
import assign from "object-assign";
class Transmit {
constructor(Component, Storage) {
const Container = React.createClass({
displayName: Component.displayName + "Container",
getInitialState() {
return {
@kitten
kitten / Store.js
Created May 18, 2015 22:51
A generic Store class, that utilises Immutable.js
import { EventEmitter } from "events";
import { Map } from "immutable";
const CHANGE_EVENT = "change";
class Store extends EventEmitter {
constructor() {
super();
this.data = new Map();
}
@kitten
kitten / Insert Store Pattern.js
Created May 18, 2015 22:36
React ES6 Code Samples for Medium #5
import ExampleStore from "../stores/example-store.js";
import { CompatComponent } from "react-compat-component";
export default class Example extends CompatComponent {
getInitialState() {
data: ExampleStore.getList()
}
componentDidMount() {
ExampleStore.addChangeListener(this._update);
}
@kitten
kitten / Store Pattern.js
Last active August 29, 2015 14:21
React ES6 Code Samples for Medium #4
var AppDispatcher = require('../dispatcher/AppDispatcher');
var EventEmitter = require('events').EventEmitter;
var assign = require('object-assign');
var CHANGE_EVENT = 'change';
var _elements = {};
function create(obj) {
_elements[obj.id] = obj;
@kitten
kitten / CompatComponent Pattern.js
Last active August 29, 2015 14:21
React ES6 Code Samples for Medium #3
import { PropTypes } from "react";
import { CompatComponent } from "react-compat-component";
export default class HelloWorld extends CompatComponent {
getMixins() {
return [
DummyMixin
];
}