Skip to content

Instantly share code, notes, and snippets.

View saltyfireball's full-sized avatar
🏠
Working from home

saltyfireball

🏠
Working from home
View GitHub Profile
@saltyfireball
saltyfireball / pgAdmin4_v3.6 _Ubuntu_18.04_python_3.6_DESKTOP.md
Last active March 6, 2019 06:19 — forked from Prototype-X/Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Install pgAdmin4 v3.6 on Ubuntu 18.04 w/python 3.6 using DESKTOP mode

Install pgAdmin4 v3.6 on Ubuntu 18.04 w/python 3.6 using DESKTOP mode

This will also work with pyenv, but if its confusing I can make different notes.

Important!

Following these exact steps will not require a username and password to access pgadmin4, since its running in "desktop" mode.

1. Create virtualenv in dir ~/py3-venv-pgadmin (different if using pyenv)

virtualenv --system-site-packages --no-setuptools --python=python3.6 ~/py3-venv-pgadmin
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py
@saltyfireball
saltyfireball / make_nb.py
Created August 7, 2018 21:29 — forked from takluyver/make_nb.py
Make a notebook from a script
"""Create a notebook containing code from a script.
Run as: python make_nb.py my_script.py
"""
import sys
import nbformat
from nbformat.v4 import new_notebook, new_code_cell
nb = new_notebook()
@saltyfireball
saltyfireball / django-runserver-ssl.md
Last active April 21, 2018 18:29 — forked from claudiosanches/django-runserver-ssl.md
Django - SSL with runserver

Instalation

brew install stunnel

Configuration

cd path/to/django/project
<?php
function get_tls_version($sslversion = null)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "https://www.howsmyssl.com/a/check");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
if ($sslversion !== null) {
curl_setopt($c, CURLOPT_SSLVERSION, $sslversion);
}
@saltyfireball
saltyfireball / README.md
Created January 18, 2018 04:14 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@saltyfireball
saltyfireball / functions.php
Created November 5, 2017 23:30 — forked from thecodepoetry/functions.php
Change sidebar position for woocommerce products for The7 -Mulltipurpose wordpress them
function change_sidebar_pos() {
$args = array (
'post_type' => 'product',
'post_per_page' => -1
);
query_posts( $args );
while ( have_posts() ) : the_post();
import turtle
import random
random.seed(42)
i=0
#file = open("emil.txt", "r")
#file = open("pi1000000.txt", "r")
file = open("sqrt2.txt", "r")
text=file.read()
pi = list(text)
pi = list(map(int, pi))
@saltyfireball
saltyfireball / delete-git-recursively.sh
Created July 14, 2017 12:57 — forked from facelordgists/delete-git-recursively.sh
Recursively remove .git folders
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf