Skip to content

Instantly share code, notes, and snippets.

@Taiiwo
Taiiwo / designer.html
Last active August 29, 2015 14:20
designer
<link href="../core-icon-button/core-icon-button.html" rel="import">
<link href="../core-toolbar/core-toolbar.html" rel="import">
<link href="../core-icons/core-icons.html" rel="import">
<link href="../paper-icon-button/paper-icon-button.html" rel="import">
<link href="../paper-tabs/paper-tabs.html" rel="import">
<link href="../paper-tabs/paper-tab.html" rel="import">
<link href="../core-pages/core-pages.html" rel="import">
<polymer-element name="my-element">
@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 / logprimethread.py
Last active December 24, 2015 20:19
A python script that will find all prime numbers between 2 numbers. Bugs: Won't find primes under 11. Does some extra checking and needs to be sped up.
import sys, thread, time
# define some settings
threads = 4
logname = "log.log"
def getprimes(rangemin, rangemax, log): # This function returns all primes between
# rangemin and rangemax, and puts them into log
if rangemin % 2 == 0: # if number is divisible by 2
rangemin += 1 #make odd
while rangemin < rangemax: #make sure we don't search over the specified number
@Taiiwo
Taiiwo / numberadd.html
Last active December 25, 2015 07:39
Asks for 10 numbers, then adds them together.
<script>
var num = [];
var total = 0;
for (var i = 0; i < 10; i++) {// for i as each number between 0 and 9:
num.push(parseInt(prompt()));// ask for a number
}
for (i=0; i < num.length; i++){// for i as each number in num.length:
total += num[i];// total equals itself plus the current number in num
}
</script>
prime_count = 1
start_number = 2
number_to_check = 2
while prime_count <= 100:
result = number_to_check % start_number
if result > 0:
start_number +=1
elif result == 0:
@Taiiwo
Taiiwo / 4chansearch.py
Last active December 27, 2015 12:09
Search strings in any 4chan post. - Only views 1 thread per second to abide by the 4chan API rules (Plus a second to load the page) - Got rid of this. Bored of waiting... - Will error at the end of a search - Fixed. I forgot that threads 404. - Doesn't search thread titles - Debugging is still in there, so be prepared for a lot of output - It su…
"""Inspired by /g/sicp's bot's threadsearching module
https://github.com/gentoomen/bhottu/blob/master/modules/threadsearch.py
irc.rizon.net #/g/sicp
Search intensity added by Taiiwo - github.com/Taiiwo
Usage: python 4chansearch.py "1" 2 3/4
1: String to search for
2: Board letter
3: all: Search every reply to every thread on the board