Skip to content

Instantly share code, notes, and snippets.

@Taiiwo
Taiiwo / tz.py
Last active August 29, 2015 14:25
def compress(data):
# format data
data = data.replace(" ", "")
data = data.replace("\n", "")
# find an unused pattern
i = 0;
while i < len(data):
pattern = bin(i)[2:]
if pattern not in data and pattern[0] != '0':
break

Keybase proof

I hereby claim:

  • I am Taiiwo on github.
  • I am taiiwo (https://keybase.io/taiiwo) on keybase.
  • I have a public key whose fingerprint is 829A FAFF 61F4 0039 61E9 8C22 3D96 3D35 C4DB DF56

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am taiiwo on github.
  • I am taiiwo (https://keybase.io/taiiwo) on keybase.
  • I have a public key whose fingerprint is F262 4E11 C62A 9E1B B315 7888 4BC6 0BA2 A36B 6172

To claim this, I am signing this object:

@Taiiwo
Taiiwo / ircd.py
Created December 1, 2015 02:20
A library for creating IRC interfaces to messaging services, allowing them to be used via IRC clients.
import socket
import thread
import re
class IRCd:
debug = True
servername = socket.getfqdn("")[:140]
events = []
handlers = {}
def __init__(self, host="127.0.0.1", port=6667):
@Taiiwo
Taiiwo / GPOL_table.md
Created January 22, 2016 13:16
A table of possible uses for the proposed method of abstracting GPOL.
Goal Proposals Collaboration Quest example
Music Song ideas Musicians Write a drum track
Being a better person Methods People Do something kind
Free wireless energy Solutions Engineers Estimate the cost of X
@Taiiwo
Taiiwo / BullShit.js
Last active May 17, 2016 12:46
A JS library that creates paragraphs of bullshit.
'use strict';
/*
* main.js
*
* New Age Bullshit Generator
* © 2014-15 Seb Pearce (sebpearce.com)
* Licensed under the MIT License.
*
*/
@Taiiwo
Taiiwo / README.md
Last active September 27, 2016 21:10
Sorts a list of sizes into min number of groups, where each group has a maximum size

I wrote this to help me to estimate the number of planks of wood I would need to build some furniture (The measurements of that furniture can still be found in the code). It has many uses. Obviously it can be used for splitting any material of a given length into an array of sizes in an efficient way, but it can also be used for other group sorting problems like fitting groups of people into, busses, or hotel rooms etc.

It's not the fastest solution, it just calculates all possible combinations, nor is it perfectly accurate as it just creates a list of the most efficient groups that can be made in order, but it's a pretty good solution for its application, which only needs to answer the question: How many planks of wood do I need?

@Taiiwo
Taiiwo / README.md
Last active September 7, 2017 07:13

Weechat Catchup Script

A weechat script that catches you up to the chat using RSVP(Rapid serial visual presentation); a statistically proven way of scanning text with higher speeds and retention rate than regular reading.

There are many apps and services out there that let you read articles, text files, and other media using a method of RSVP, but none of them are really convenient for reading IRC messages. I found that if it takes me too long to

@Taiiwo
Taiiwo / python_decorators.py
Last active November 30, 2019 16:21
A simple file giving examples for creating decorator functions
# decorators are just shorthand for passing functions as arguments to other functions
# They are called decorators as code can be run before and after the supplied
# function is run (if at all). A good use for decorator functions is adding
# callback hooks for your applications. The decorator functions take the
# supplied function and store it to be run at the right time
# There are two types of decorators: regular decorator and callable decorators
# regular decorators take the function it's decorating as an argument