Skip to content

Instantly share code, notes, and snippets.

@Taiiwo
Taiiwo / pybar.py
Last active October 13, 2018 14:11
An iteration progress tracker with some neat features
import sys
import time
# Keeps track of an iteration
class Tracker:
def __init__(self, max=False, index=0):
self.max = max
self.index = index
self.times = []
self.time = time.time()
@Taiiwo
Taiiwo / designer.html
Last active March 22, 2019 21:18
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;

Keybase proof

I hereby claim:

  • I am Taiiwo on github.
  • I am 0x41 (https://keybase.io/0x41) on keybase.
  • I have a public key whose fingerprint is EF36 EB55 4CD8 760D 063A 3715 F6E4 96CC 72CA 322F

To claim this, I am signing this object:

import random
# returns the number of jumps taken in a simulation of `pads` pads
def frog_game(pads):
# init the counter at 1
jumps = 1
# take a random jump between 1 and `pads`
jump = random.randint(1, pads)
# now calculate the remaining jumps:
# while the current number of pads we've jumped in total is not enough
@Taiiwo
Taiiwo / servicize.py
Created September 17, 2019 18:12
Python script for automatically creating systemd services
#!/usr/bin/env python3.6
import sys
import os
import pwd
import pipes
import subprocess
# Usage: servicize.py python3 main.py
# OR: servicize.py ./somefile.sh
# It will attempt to complete abs paths and automatically name the service.
@Taiiwo
Taiiwo / halt.py
Created October 8, 2019 16:02
Solving the halting problem in python
import asyncio
loop = asyncio.get_event_loop()
# returns true if coroutine function blocks or errors, else false
async def holds(function, arg):
# try block for catching errors
try:
# create a promise for the function to run in another thread
p = loop.run_in_executor(None, await function, (arg,))

Preview

How to Install

So this isn't really a proper Atom theme, it's just some modifications I made to the "Dark One" theme in an attempt to replicate this Reddit post

Step 1