This is a gist used in the following blog posts:
This is a gist used in the following blog posts:
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
version: "3.4" | |
services: | |
pgAdmin: | |
restart: always | |
image: dpage/pgadmin4 | |
ports: | |
- "8000:80" | |
environment: | |
PGADMIN_DEFAULT_EMAIL: 1234@admin.com |
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
<html> | |
<head> | |
<style> | |
.hide { display:none; } | |
/* Optional: The following css just makes sure the twitch video stays responsive */ | |
#twitch { | |
position: relative; | |
padding-bottom: 56.25%; /* 16:9 */ | |
padding-top: 25px; |
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 cv2 | |
image = cv2.imread('test.jpg') | |
overlay = image.copy() | |
x, y, w, h = 10, 10, 10, 10 # Rectangle parameters | |
cv2.rectangle(overlay, (x, y), (x+w, y+h), (0, 200, 0), -1) # A filled rectangle | |
alpha = 0.4 # Transparency factor. |
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 bash | |
# Author: Sasha Nikiforov | |
# source of inspiration | |
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions | |
# Detect platform | |
if [ "$(uname)" == "Darwin" ]; then | |
# MacOS |
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
[core] | |
excludesfile = ~/.gitignore_global | |
pager = diff-so-fancy | less --tabs=4 -RFX | |
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[alias] | |
aa = add --all |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
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
# 1. Install brew --> http://brew.sh/ | |
# 2. run the following commands in your Terminal | |
brew tap homebrew/dupes | |
brew tap homebrew/versions | |
brew tap homebrew/homebrew-php | |
brew install --with-openssl curl | |
brew install --with-homebrew-curl --with-apache php71 | |
brew install php71-mcrypt php71-imagick | |
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot. | |
brew info php71 |
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 os, binascii, hashlib | |
#supply password | |
secret = 'your password here you want to use' # all you need to change! | |
#static 'count' value later referenced as "c" | |
indicator = chr(96) | |
#used to generate salt | |
rng = os.urandom |
NewerOlder