Skip to content

Instantly share code, notes, and snippets.

@BlaiseRideout
BlaiseRideout / setup.yaml
Last active January 25, 2023 04:07
Ansible script to setup my personal Linux environment
---
- hosts: localhost
connection: local
become: yes
become_user: root
become_method: sudo
tasks:
- name: Google Chrome PGP Key
apt_key: url=https://dl.google.com/linux/linux_signing_key.pub state=present
@BlaiseRideout
BlaiseRideout / MahjongMatchmaker.py
Last active August 29, 2015 14:27
A genetically optimized mahjong table seating randomizer
#!/usr/bin/env python
import sqlite3 as sql
import random
POPULATION = 256
def main():
todays_players = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98] # 98
random.shuffle(todays_players)
@BlaiseRideout
BlaiseRideout / twomatrix.py
Last active August 29, 2015 14:26
Two-Boolean matrix zeroer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
def zeroify(matrix):
height = len(matrix)
width = len(matrix[0])
toZero = False
@BlaiseRideout
BlaiseRideout / matrix.py
Last active August 29, 2015 14:26
One-Boolean matrix zeroer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
def zeroify(matrix):
height = len(matrix)
width = len(matrix[0])
toZero = False
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import math
def zeroify(matrix):
height = len(matrix)
width = len(matrix[0])
p = primes(width + height)
@BlaiseRideout
BlaiseRideout / Install Debian on an Asus C300 Chromebook.md
Last active May 27, 2023 23:09
Install Debian on an Asus C300 Chromebook

Install Debian on an Asus C300 Chromebook

TODO: Make this back into a bash script instead of a human one

Enable developer mode if you haven't already

  1. Hold down Esc + Refresh and press the Power button.
  2. Once you see the Recovery Mode screen, press Ctrl-D, then press Enter.

Configuring your partitions

@BlaiseRideout
BlaiseRideout / ChrDebian.sh
Last active May 17, 2016 18:14
An untested Debian version of ChrUbuntu
# fw_type will always be developer for Mario.
# Alex and ZGB need the developer BIOS installed though.
fw_type="`crossystem mainfw_type`"
if [ ! "$fw_type" = "developer" ]
then
echo -e "\nYou're Chromebook is not running a developer BIOS!"
echo -e "You need to run:"
echo -e ""
echo -e "sudo chromeos-firmwareupdate --mode=todev"
echo -e ""
CodeBot = {
start: function() {
var self = this;
self.spendAll = function() {
var score = this.toFixed(Number(Meteor.users.findOne({_id:Meteor.userId()}).profile.score));
$(".details").append('<input type="button" id="' + score + '" value="LOL" class="buy btn span4">');
$("#" + score).click();
}
self.toFixed = function(x) {
if (Math.abs(x) < 1.0) {
#include "Process.hpp"
Process::Process() {
}
Process::~Process() {
}