Skip to content

Instantly share code, notes, and snippets.

View gavinwhyte's full-sized avatar

Gavin Whyte gavinwhyte

View GitHub Profile
#include <stdio.h>
void function(int param) {
printf("I've received value %d\n", param);
param++;
}
int main(void) {
int variable = 111;
@gavinwhyte
gavinwhyte / airflow.md
Last active October 17, 2021 09:07
Airflow

Celery documentation of airflow

How to scale airflow

Install Airflow

pip install 'apache-airflow[celery]'

sudo apt update

@gavinwhyte
gavinwhyte / brewbuild.bash
Last active October 17, 2021 05:45
brewbuild
### Create User
Create user brewai
```bash
adduser brewai
```
Password:
Grant root access
```bash
usermod -aG sudo brewai
@gavinwhyte
gavinwhyte / fabfile.py
Last active August 29, 2021 11:09
fabfile.py
"""
Fabric configuration for a Python 3.3 environment using Anaconda.
"""
from fabric.api import run, cd
from fabric.context_managers import prefix
CONDA_REPO = 'http://repo.continuum.io/miniconda/'
CONDA_VERS = 'Miniconda3-3.0.0-Linux-x86_64.sh'
@gavinwhyte
gavinwhyte / template.md
Last active July 30, 2021 02:59
template

file:///Users/gwhytempro/Library/Mobile%20Documents/comappleCloudDocs/templates/sandbox-html/sandbox/assets/dev/animations.html

@gavinwhyte
gavinwhyte / polling.md
Last active July 29, 2021 23:22
vuejs polling

data() {

return { status: null, pollInterval: null }

},

...

methods() { fetchData() {

SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'postgres://username:password@localhost:5432/databasename'
SQLALCHEMY_TRACK_MODIFICATIONS = False
@gavinwhyte
gavinwhyte / g.txt
Last active December 29, 2017 07:53
CondaArrow
// Create an apache arrow environment in conda
// Note files will be stores in parquet format and read into a Pandas data frame, for manipulation.
conda create --name arrow pandas
conda install --name arrow pyarrow=0.8.* -c conda-forge
@gavinwhyte
gavinwhyte / tax.py
Created December 7, 2017 06:05
Tax Machine Learning
import csv
import numpy as np
import nltk
from nltk.stem.porter import *
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.feature_extraction import DictVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, confusion_matrix
from sklearn import cross_validation
from SMOTE import *
@gavinwhyte
gavinwhyte / gist:af02e9ac0cdf5bf897d80bce2f6f5330
Created October 25, 2017 10:20 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql