Skip to content

Instantly share code, notes, and snippets.

View aflansburg's full-sized avatar
🔧

Abe Flansburg aflansburg

🔧
View GitHub Profile
@aflansburg
aflansburg / dual_plot.py
Last active July 14, 2021 18:14
Dual histogram + boxplot with KDE for univariate analysis + Mean & Median Lines
# import libs
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# this function will create a boxplot + histogram plot using Seaborn's Jointgrid
# we'll also provide Type annotations to provide hints to future users
def dual_plot(series: pd.Series, figsize: tuple = (16,8),
bins: int = None, return_plot: bool = False,
@max-kov
max-kov / matrix.py
Last active July 2, 2022 02:13
matrix falling code in python using pygame
import pygame, pygame.font
import random
def IsWritten():
defTemp = True
for x in xrange((lettersOnScreen[0] / 2) - (len(str) / 2), (lettersOnScreen[0] / 2) + (len(str) / 2) + 1):
if xHeads[x] == -1:
defTemp = False
return defTemp
@xavierskip
xavierskip / snake.py
Last active February 24, 2023 12:21
snake in terminal
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
import time
import random
class Snake():
def __init__(self,length,screen):
# left top coordinate (y,x)
@cereallarceny
cereallarceny / index.js
Last active May 2, 2023 06:41
Server-side rendering in Create React App
const md5File = require('md5-file');
const path = require('path');
// CSS styles will be imported on load and that complicates matters... ignore those bad boys!
const ignoreStyles = require('ignore-styles');
const register = ignoreStyles.default;
// We also want to ignore all image requests
// When running locally these will load from a standard import
// When running on the server, we want to load via their hashed version in the build folder
@maxan
maxan / web.config
Last active November 14, 2023 11:43
IIS Config to React Router App
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active December 29, 2023 00:40
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 19, 2024 06:11
set -e, -u, -o, -x pipefail explanation