Skip to content

Instantly share code, notes, and snippets.

Avatar
🌻
Tending to my plants

Bee bee-san

🌻
Tending to my plants
View GitHub Profile
View gist:69ad132e1d2e6989a332aafcc1763c4a
C='TTL'
B='Uses'
import boto3
G=boto3.resource('dynamodb')
def A(event,context):
L='Hash';K=event[L];C=G.Table('hash_lookup');D={}
for E in K:
A=C.get_item(Key={L:E})['Item']
if not A['Verified']:F=H(A);C.put_item(Item=F)
if B in A:A[B]=A[B]+1
@bee-san
bee-san / tournament.py
Last active Dec 27, 2020
3 * n/2 - 2 comparisons, tournament method
View tournament.py
x = [1, 5, 3, 9, 10, 6, 0, 11, 21, -10, 5]
small, large = x[0], x[0]
for i in range(1, len(x) - 1):
if x[i] < x[i + 1]:
small = min(x[i], small)
large = max(x[i + 1], large)
print(small, large)
View gist:66a88325e88330baddcc1bad0c32a6e8
➜ ciphey -t "e098b86310f3eeffff5c04869e145fe72d6434333af997ebefd909024fb29114" -vvv
2020-09-09 13:06:58.355 | DEBUG | ciphey.iface._config:update_log_level:181 - Verbosity set to level 3 (TRACE)
2020-09-09 13:06:58.355 | DEBUG | ciphey.ciphey:main:198 - Opened config file at /home/bee/.config/ciphey/config.yml
2020-09-09 13:06:58.356 | TRACE | ciphey.ciphey:main:199 - Got cmdline args {'text': 'e098b86310f3eeffff5c04869e145fe72d6434333af997ebefd909024fb29114', 'verbose': 3, 'text_stdin': None, 'quiet': None, 'greppable': None, 'checker': None, 'config': None, 'wordlist': None, 'param': (), 'list_params': None, 'searcher': None, 'bytes': None, 'default_dist': None, 'module': (), 'appdirs': False, 'file': None}
2020-09-09 13:06:58.356 | DEBUG | ciphey.iface._config:load_modules:191 - Loaded modules ['regex', 'regexlist', 'brandon', 'jsonchecker', 'humanchecker', 'any', 'ezcheck', 'caesar', 'vigenere', 'xorsingle', 'xorcrypt', 'xandy', 'morsecode', 'base16', 'base32', 'base64', 'base85', 'ascii85',
View vig fail
xwg', 'wfwzmdd', 'syir', 'ngwsloerbpm', 'wlv', 'lwf', 'fepaxl', 'ijikggkbz', 'hrloqsglm', 'ahlnsmt', 'lgcv', 'zhxci', 'foowghvfr'}"
2020-09-09 01:19:28.832 | TRACE | ciphey.basemods.Checkers.brandon:check:226 - {'0': {'dict': 0.5}, '110': {'stop': 0.15}, '150': {'stop': 0.28}}
2020-09-09 01:19:28.832 | TRACE | ciphey.basemods.Checkers.brandon:checker:145 - Checker's chunks are size 18
2020-09-09 01:19:28.832 | TRACE | ciphey.basemods.Checkers.brandon:checker:154 - To analyse is ['qedfvg', 'scyz', 'tlddyrs', 'fewmzraz', 'fzrs', 'zie', 'vttmxwostvc', 'nlsdrvgvtp', 'yluhwfjrkdr', 'hgh', 'sugwhxerd', 'ebx', 'jqlvllsk', 'ertb', 'ncpc', 'phgrqo', 'rzlot', 'gpidksyob']
2020-09-09 01:19:28.911 | TRACE | ciphey.basemods.Checkers.brandon:checker:154 - To analyse is ['ugg', 'umo', 'hzrbtaeq', 'fhmilkff', 'xwg', 'wfwzmdd', 'syir', 'ngwsloerbpm', 'wlv', 'lwf', 'fepaxl', 'ijikggkbz', 'hrloqsglm', 'ahlnsmt', 'lgcv', 'zhxci', 'foowghvfr']
2020-09-09 01:19:28.984 | TRACE | ciphey.basemods.Checkers.brandon:check
View Ciphey
➜ ciphey -t "941241298794216421426424464515" -vvv
2020-09-09 00:01:45.130 | DEBUG | ciphey.iface._config:update_log_level:183 - Verbosity set to level 3 (TRACE)
2020-09-09 00:01:45.130 | DEBUG | ciphey.ciphey:main:208 - Opened config file at /home/bee/.config/ciphey/config.yml
2020-09-09 00:01:45.130 | TRACE | ciphey.ciphey:main:209 - Got cmdline args {'text': '941241298794216421426424464515', 'verbose': 3, 'text_stdin': None, 'quiet': None, 'greppable': None, 'checker': None, 'config': None, 'wordlist': None, 'param': (), 'list_params': None, 'searcher': None, 'bytes_input': None, 'bytes_output': None, 'default_dist': None, 'module': (), 'appdirs': False, 'file': None}
2020-09-09 00:01:45.131 | DEBUG | ciphey.iface._config:load_modules:193 - Loaded modules ['regex', 'regexlist', 'brandon', 'jsonchecker', 'humanchecker', 'ezcheck', 'caesar', 'vigenere', 'xorsingle', 'xorcrypt', 'xandy', 'morsecode', 'base16', 'base32', 'base64', 'base85', 'ascii85', 'utf8', 'reverse', 'octal', 'bina
View Readme.md

Made for Skerritt.blog Every new plot starts with the x axis as:

[2, 4, 6, 8, 10, 12, 14]

Then the y axis is that function applied to the x. So log is:

x = [2, 4, 6, 8, 10, 12, 14]
y = [(z * math.log2(z)) for z in x]
View weighted_interval_scheduling_python.py
# Python program for weighted job scheduling using Dynamic
# Programming and Binary Search
# Class to represent a job
class Job:
def __init__(self, start, finish, profit):
self.start = start
self.finish = finish
self.profit = profit
View app.js
render() {
return (
<div className="container mt-5">
<div className="row">
<div className="col-md-4">
<div className="card-deck">
{this.state.books.map(movie => <MovieCard {...movie.fields} /> )}
</div>
</div>
</div>
View recur_factorial.py
n = 6
def recur_factorial(n):
if n == 1:
return n
else:
return n * recur_factorial(n-1)
print(recur_factorial(n))
View fib.py
def F(n):
if n == 0 or n == 1:
return n
else:
return F(n-1)+F(n-2)