Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
View history.txt
I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
import sys
import tokenize
class DoubleQuotesChecker:
msg = "single quotes detected, use double quotes instead"
def __init__(self):
self.violations = []
def find_violations(self, filename, tokens):
shakna-israel /
Last active Sep 22, 2020
Obfuscating Python

Obfuscating Python

Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.

Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.

Today, for fun, I'm going to obfuscate this code:

def _(n):
    if n <= 0:
shaunlebron /
Last active Sep 2, 2020
why Dynamicland Realtalk isn't open source

Transcribed from an interview with Toby Schachman and Paula Te on The Afrofuturist Podcast:

There's this notion of the open-source movement. There are a lot of things
that we totally resonate with that because it's about understanding how your
technology works. We're totally 100% on board with that.

But then there are other issues with the open-source community, where it's
very internet-based and so open-source ends up benefitting this group of
people who have really strong access to internet and understand how to use
matthewearl /
Last active Aug 24, 2020
Super Mario Bros Level Extractor
#!/usr/bin/env python3
# Copyright (c) 2018 Matthew Earl
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
bee-san /
Last active Mar 20, 2020
An Python implementation of Timsort
# based off of this code
# Brandon Skerritt
def binary_search(the_array, item, start, end):
if start == end:
if the_array[start] > item:
return start
return start + 1
View gist:26a5c058a2b943588e9fcafbff423542
df -h
sudo dd if=/dev/树莓派设备地址 | gzip>/home/你的用户名/文件名.gz
sudo dd if=/dev/disk2 | gzip > /Users/hidaris/rpi_opencv3_41_hass.gz
nileshtrivedi /
Last active Dec 8, 2020
Programming: Mostly A Hate Story

Programming: Mostly A Hate Story

I wanted to do digital signatures validation, preferably ed25519, inside PostgreSQL triggers. Here is how it went:

Surely pgcrypto must be supporting it, right? Most Postgres cloud hosting providers already support pgcrypto so this would be perfect. Right?

Well, pgcrypto only supports PGP and that too excludes digital signatures. Let's give PGP a try anyway and see how far can we go.

Installed gpg to generate the keys and the experience is less than pleasant. Sometimes it gets stuck at the passphrase prompt. The keys are too big, but still I can make pgcrypto's pgp_pub_encrypt and pgp_pub_decrypt methods work. Just remeber to convert keys in ASCII to binary and vice-versa using armor()/dearmor(). I hate the big key size in RSA, even though GPG defaults to 2048-bit keys and not the more secure 4096-bit ones. Let's look into ed25519 now.

me00016 / COZMO conversing using ChatterBot 0.7.6
Last active Aug 14, 2020
COZMO conversing using ChatterBot 0.7.6
View COZMO conversing using ChatterBot 0.7.6
#!/usr/bin/env python3
# Copyright (c) 2016 Anki, Inc. (except Chatterbot part and a couple of my
# own lines of code)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
View docker-compose.yml
version: '3'
image: postgres:9.4-alpine
- ./pgdata_new:/var/lib/postgresql/data
- ''
#image: wwj2
You can’t perform that action at this time.