This file contains hidden or 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
# found this from Armin R. on Twitter, what a beautiful gem ;) | |
import ctypes | |
from types import MappingProxyType, MethodType | |
# figure out side of _Py_ssize_t | |
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): | |
_Py_ssize_t = ctypes.c_int64 | |
else: | |
_Py_ssize_t = ctypes.c_int |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
import random | |
import sys | |
from Crypto.Cipher import AES | |
BLOCK_SIZE = 16 # bytes | |
INIT_VEC = 'This is an IV456' # hardcoding this is a terrible idea |
This file contains hidden or 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
/** | |
* From http://lockmedown.com/hash-right-implementing-pbkdf2-net/ | |
*/ | |
public class Hash | |
{ | |
private const int SaltByteLength = 32; | |
private const int DerivedKeyLength = 32; | |
private const int IterationCount = 48000; | |
private const char separator = '|'; |
This file contains hidden or 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
<html> | |
<body>bucket served file ok</body> | |
</html> |
This file contains hidden or 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
//➤ neato party.dot -Gsep="+200" -Goverlap=scalexy -Tpng -o party.png && open party.png | |
digraph party { | |
Ad [label="Adric"]; | |
Az [label="Azrael"]; | |
P [label="Peridot"]; | |
Li [label="Liberace"]; | |
Pe [label="Pete"]; | |
K [label="Koros"]; | |
Lu [label="Luth"]; | |
F [label="Fletcher"]; |
This file contains hidden or 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
➤ docker-compose -f services/dev.yml up --build | |
Starting services_api_1 ... done | |
Starting services_web_1 ... done | |
Attaching to services_api_1, services_web_1 | |
api_1 | | |
api_1 | > json-server@ prestart /home | |
api_1 | > npm install | |
api_1 | | |
web_1 | | |
web_1 | > [email protected] prestart /home |
This file contains hidden or 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
1 - ??? | |
2 - The Matrix | |
3 - Speed | |
4 - Leaving Las Vegas | |
5 - Lalaland | |
6 - 12 monkeys | |
7 - π | |
8 - Dr No | |
9 - Seven | |
10 - Home Alone |
This file contains hidden or 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
B_BLACK="\[\e[40m\]" | |
B_RED="\[\e[41m\]" | |
B_GREEN="\[\e[42m\]" | |
B_YELLOW="\[\e[43m\]" | |
B_BLUE="\[\e[44m\]" | |
B_MAGENTA="\[\e[45m\]" | |
B_CYAN="\[\e[46m\]" | |
B_WHITE="\[\e[47m\]" | |
F_BLACK="\[\e[30m\]" |
This file contains hidden or 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
# Recursive dictionary merge | |
# Copyright (C) 2019 Brice Fernandes <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains hidden or 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
class ValueContext(object): | |
""" | |
A ValueContext is constructed from a value that can be writtent to a file | |
and then exposes the value as a temporary file in its context. | |
The temporary file path can be accessed using its `name` attribute. | |
For example: |