Skip to content

Instantly share code, notes, and snippets.

View Laharah's full-sized avatar

Jared Anderson Laharah

View GitHub Profile
@Laharah
Laharah / test.py
Created August 5, 2023 06:07
for geist
class SuperA:
def a_method(self):
print("I'm from a")
class SuperB:
def __init__(self):
self.statment = "crap"
def b_method(self):
print("I'm from b")

Keybase proof

I hereby claim:

  • I am Laharah on github.
  • I am laharah (https://keybase.io/laharah) on keybase.
  • I have a public key whose fingerprint is DE1C 523E 8F21 2763 42E5 0DE6 5280 7109 0597 0029

To claim this, I am signing this object:

@Laharah
Laharah / frogs.py
Last active June 18, 2018 21:58
simulate the frogs riddle
import random
M = False # male frog you don't survive
F = True # female frog you do survive
def make_frogs():
'make the scenario, single frog is first, 2 frogs at s[1] and s[2]'
choices = [M, F] # male or female frog
s = []
@Laharah
Laharah / active_seperation.py
Last active March 13, 2018 07:48
Seperate active and non-active files from a directory according to uTorrent paths
#!/usr/bin/env python3
# The contents of this file are subject to the Python Software Foundation
# License Version 2.3 (the License). You may not copy or use this file, in
# either source code or executable form, except in compliance with the License.
# You may obtain a copy of the License at http://www.python.org/license.
#
# Software distributed under the License is distributed on an AS IS basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#!/bin/bash
#Captures deluge debug output to delugedebug.log
CWD=$(pwd)
cd / && /Applications/Deluge.app/Contents/MacOS/Deluge -L debug -l $CWD/delugedebug.log
@Laharah
Laharah / coro_from_gen.py
Last active February 13, 2016 08:34
convert a conventional generator into a coroutine
def coro_from_gen(generator):
"""turn a normal generator into a coroutine that can recieve and return computed data"""
def input_pipe():
"""small internal coroutine that recieves data"""
x = ''
while True:
x = yield x
yield # to keep the generator in lock step with input
pipe = input_pipe()
next(pipe) # prime the input coroutune