This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 5 | |
def my_function(): | |
print(x) | |
x = 6 | |
print(x) | |
my_function() | |
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# access_crypt.py | |
# Makes using encrypted storage easier. | |
# Mounts the storage, opens a shell, and unmounts when the shells closes (however ungracefully) | |
# Works under Ubuntu 14.04, following these instructions to set up your encrypted storage file: | |
# https://www.digitalocean.com/community/tutorials/how-to-use-dm-crypt-to-create-an-encrypted-volume-on-an-ubuntu-vps | |
from contextlib import contextmanager | |
from pysh import sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Quick 'n dirty hack for a typecheck decorator. | |
Only tested on functions without kwargs. Use at own peril, etc. | |
Usage: | |
@typecheck | |
def some_function(x: str, y: int) -> str: | |
... | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Quick unit-test for typecheck.py. | |
Wonder if there's any way to unittest an exception's text? | |
""" | |
import unittest | |
from typecheck import typecheck | |
@typecheck | |
def add(x: int, y: int) -> int: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from pprint import pprint | |
def main(): | |
text = input() | |
forest = [] | |
for letter in text: | |
for tree in forest: | |
if tree["letter"] == letter: | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update && apt-get upgrade -y | |
apt-get install libboost1.54-dev-all | |
apt-get install -y qt5-default qt5-qmake qtbase5-dev-tools qttools5-dev-tools \ | |
build-essential libboost-dev libboost-system-dev \ | |
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \ | |
libssl-dev libdb++-dev libminiupnpc-dev libdb++-dev; | |
git clone https://github.com/DarkCrave/DarkCrave | |
git clone https://github.com/bitcoin/secp256k1 | |
cd secp256k1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change TTY colors to the Railscast theme. | |
if [ "$TERM" = "linux" ]; then | |
echo -en "\e]P0232323" #black | |
echo -en "\e]P82B2B2B" #darkgrey | |
echo -en "\e]P1D75F5F" #darkred | |
echo -en "\e]P9E33636" #red | |
echo -en "\e]P287AF5F" #darkgreen | |
echo -en "\e]PA98E34D" #green | |
echo -en "\e]P3D7AF87" #brown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Usage: rcs-core [options] | |
Core listing: | |
-l, --list get the list of cores | |
Core selection: | |
-n, --name NAME identify the core by it's name | |
Core operations: | |
-g, --get FILE get the core from the db and store it in FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import warnings | |
import zlib | |
sys.path.append(os.getcwd() + '/' + "pylzma.egg") | |
import pylzma | |
import struct | |
import random | |
import shutil | |
from zipfile import ZipFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import warnings | |
import zlib | |
import struct | |
import random | |
import shutil | |
import zipfile | |
from zipfile import ZipFile | |
import time |
OlderNewer