Skip to content

Instantly share code, notes, and snippets.

@cessor
cessor / animation.py
Last active January 13, 2020 14:30
poker_dice.py
import time
import itertools
class DieRollAnimation:
_CYCLE = itertools.cycle(range(1, 7))
def __init__(self, roll_duration_s):
self._roll_duration_s = roll_duration_s
@cessor
cessor / okra.py
Last active December 22, 2019 17:54
okra.py
"""
Python version of
https://github.com/cessor/okra
"""
import os
import sys
import time
from xml.dom import minidom
from pathlib import Path
@cessor
cessor / libraryroot.css
Created November 30, 2019 21:36
Remove Steam Librabry Clutter
/*
Add the following code to the end of Steam/steamui/css/libraryroot.css
Source https://steamcommunity.com/sharedfiles/filedetails/?id=1906786841
For this to work, the shortcut needs Target flags -noverifyfiles and -norepairfiles, or the file must be set to read-only.
*/
/*.sharedappdetailsheader_TopCapsule_NZMJ6 {
display:none!important;
@cessor
cessor / libraryroot.css
Created November 30, 2019 21:36
Remove Steam Librabry Clutter
/*
Add the following code to the end of Steam/steamui/css/libraryroot.css
Source https://steamcommunity.com/sharedfiles/filedetails/?id=1906786841
For this to work, the shortcut needs Target flags -noverifyfiles and -norepairfiles, or the file must be set to read-only.
*/
/*.sharedappdetailsheader_TopCapsule_NZMJ6 {
display:none!important;
class Method {
constructor(methodName, parent) {
return new Proxy(function () {}, {
get (self, name) {
if(name == 'returns') {
return (value) => parent._calls[methodName] = value
}
if(name == 'throws') {
@cessor
cessor / stub.js
Last active November 27, 2018 21:08
JS Proxy Stub
class Pseudo {
constructor(value) {
return new Proxy({}, {
get: () => value
})
}
}
const callable = new Pseudo(10)
@cessor
cessor / README.md
Last active October 15, 2018 09:10

HROOT Admin Setup

Hroot's default admin account poses a security threat. This code provides a rake task to

  • Create Admin Accounts within HROOT
  • Delete Admin Accounts within HROOT
  • Delete the Default Admin Account within HROOT
@cessor
cessor / hasp_ip.py
Created June 5, 2018 08:45
Hash an Ip Address
import hashlib
def hash_ip(self, ip_address):
return hashlib.sha224(ip_address.encode('utf-8')).hexdigest()
@cessor
cessor / flatten_list_string.py
Created June 5, 2018 08:41
Flatten nested list of comma separated strings
# Simple Flatten Array
functools.reduce(lambda a,b: a + b.split(','), list_, [])
@cessor
cessor / secret_no.py
Created June 5, 2018 08:40
Secret Number Game in 10 Minutes
from random import random
def secretNumber():
return int(random() * 1000)
def guess():
print '> ',
return input()
def evaluate(number, secret):