Skip to content

Instantly share code, notes, and snippets.

View alexphelps's full-sized avatar
🤔

Alex Phelps alexphelps

🤔
View GitHub Profile
@alexphelps
alexphelps / natural_language_time_periods.py
Created January 26, 2020 07:07 — forked from psychemedia/natural_language_time_periods.py
Simple python functions to give dates and date ranges in "natural time"; this week, next month, etc.
import datetime
from dateutil.relativedelta import relativedelta
def today(date=None,iso=False):
if date is None: date=datetime.date.today()
if iso: return date.isoformat()
else: return date
def yesterday(date=None,iso=False):
if date is None: date=today()
@alexphelps
alexphelps / ltc-mining.sh
Created September 12, 2017 21:37 — forked from gfranchini/ltc-mining.sh
Litecoin CPU Mining setup on Ubuntu Server
#!/bin/bash
#
# Litecoin CPU Mining setup on Ubuntu Server
#
sudo apt-get update;
# install prerequisit software/libs
sudo apt-get -y install make automake build-essential libcurl4-openssl-dev htop
@alexphelps
alexphelps / nginx-uwsgi-python3
Created February 14, 2017 23:01 — forked from simoncoulton/nginx-uwsgi-python3
Setting up Nginx, uWSGI & Python3
======================================
Setting up Nginx, uWSGI and Python3
======================================
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were:
1) Only showed you how to run the server for a single web application.
2) Only showed you how to configure the app, not the server it was running on.
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me.