Skip to content

Instantly share code, notes, and snippets.

View philMarius's full-sized avatar

Phil philMarius

View GitHub Profile
@philMarius
philMarius / funky_bass.rb
Last active June 19, 2017 18:23
[SONIC PI] Funky trance-like bass
use_bpm 138
live_loop :kick do
with_fx :compressor, relax_time: 0.5, clamp_time: 0.01, threshold: 1, mix: 1, slope_above: 0.2 do
with_fx :band_eq, freq: 80, mix: 1 do
sample :bd_haus, beat_stretch: 1
sleep 1
end
end
end
@philMarius
philMarius / pg-install-ubuntu
Last active June 23, 2017 10:05 — forked from shanna/pg-install
Postgres install from source on Ubuntu when the distribution installation won't give you a specific version.
#!/usr/bin/env bash
set -e
# Homebrew homebrew/versions was broken when I went to install postgres.
# This shell script just documents my install from source.
release=9.4.6
prefix=/usr/local/opt
mkdir -p $prefix
@philMarius
philMarius / run-stanfordcorenlp.sh
Created November 6, 2018 14:46
Run Stanford CoreNLP Server
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000
@philMarius
philMarius / compare_dataframes.py
Created October 30, 2019 12:11
Comparing values between two different dataframe
def equal_dataframes(self, a_df, b_df, columns):
"""Equality check between dataframe values, first selects relevant columns, then sorts, then compares values."""
# NOTE fillna is used to eliminate NaNs as NaN != NaN
# https://stackoverflow.com/a/23666623/2126910
return (a_df[columns].sort_values(list(columns)).fillna(0).values ==
b_df[columns].sort_values(list(columns)).fillna(0).values).all()
@philMarius
philMarius / install-gnome-themes-error
Created April 12, 2020 20:07
intall-gnome-themes error when installing on Ubuntu 19.10
$ LOG=/dev/stdout ./install-gnome-themes
Detected GNOME 3.34, GTK 3.24.
Detected Ubuntu operating system.
Adapta, Adapta-Eta, Adapta-Nokto, Adapta-Nokto-Eta:
Fetching repository: https://github.com/tista500/Adapta ...
Cloning into 'Adapta'...
remote: Enumerating objects: 427, done.
remote: Counting objects: 100% (427/427), done.
remote: Compressing objects: 100% (314/314), done.
remote: Total 427 (delta 241), reused 172 (delta 101), pack-reused 0
@philMarius
philMarius / snowplow-enriched-cols.txt
Created April 15, 2020 11:17
Snowplow stream enrich output column list
app_id: String
platform: String
etl_tstamp: String
collector_tstamp: String
dvce_created_tstamp: String
event: String
event_id: String
txn_id: String
name_tracker: String
v_tracker: String
@philMarius
philMarius / pandas.py
Last active July 31, 2020 10:17
Pandas et al. helper functions
# Put x axis on top of graph
# https://stackoverflow.com/questions/14406214/moving-x-axis-to-the-top-of-a-plot-in-matplotlib
_ = ax.xaxis.tick_top()
# Splitting a seaborn barplot by some categorical aspect of data
sns.barplot(data=dataframe, x="x_var", y="y_var", hue="categorical_aspect")
@philMarius
philMarius / ci-cd.yml
Created March 3, 2021 11:00
CI/CD workflow for blog: Azure Functions Environment Separation with Linux Apps
name: Run CI and CD
on:
push:
branches:
- develop
- master
- release/**
env:
@philMarius
philMarius / create-release-branch.yml
Created March 3, 2021 11:16
Create release branch workflow for blog: Azure Functions Environment Separation with Linux Apps
# Release branch process
# Creates new release branch with version name
# Saves version name to artifact for release process
# Inspired by: https://riggaroo.dev/using-github-actions-to-automate-our-release-process/
name: Create Release Branch
on:
workflow_dispatch:
inputs:
@philMarius
philMarius / tag-release.yml
Created March 3, 2021 11:17
Tag release workflow for blog: Azure Functions Environment Separation with Linux Apps
name: Tag Release
on:
push:
branches: [master]
jobs:
tag_release:
runs-on: ubuntu-latest
steps: