Skip to content

Instantly share code, notes, and snippets.

View davidverweij's full-sized avatar
🧤

David davidverweij

🧤
View GitHub Profile
@toddbirchard
toddbirchard / pandas_dataframe_difference.py
Last active August 26, 2023 00:48
Helper function to compare two DataFrames and find rows which are unique or shared.
"""Find Symmetric Differences between two Pandas DataFrames."""
def dataframe_difference(df1, df2, which=None):
"""Find rows which are different."""
comparison_df = df1.merge(
df2,
indicator=True,
how='outer'
)
@tcrammond
tcrammond / nvm-auto-run.md
Created October 23, 2017 08:01
Automatically nvm use when entering directory

Calling nvm use automatically in a directory with a .nvmrc file

Put this into your $HOME/.zshrc to call nvm use automatically whenever you enter a directory that contains an .nvmrc file with a string telling nvm which node to use:

place this after nvm initialization!

@rverton
rverton / chrome_headless_screenshot.py
Created July 10, 2017 08:53
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@brentsimmons
brentsimmons / JavaScript Indent.js
Last active May 28, 2024 17:42
This is a BBEdit text filter for indenting (and beautifying) JavaScript.
#!/usr/local/bin/node
// PBS 12/5/13
// This is a BBEdit text filter for indenting (and beautifying) JavaScript.
// It goes in ~/Library/Application Support/BBEdit/Text Filters/
//
// On my machine I assigned it a keyboard shortcut: cmd-'
//
// It requires the js-beautify Node module: https://github.com/einars/js-beautify
//
@marufbd
marufbd / d3.chart.analog.js
Last active March 8, 2024 19:41
Time series chart(irregular interval) with shared x-axis and zoom
(function () {
d3.analog= function() {
var height = 100, gap=10,
xValue = function(d) { return d[0]; },
xScale = null,
color = d3.scale.category10();
function chart(selection) {
selection.each(function(d) {
var g = d3.select(this);
@jednano
jednano / gitcom.md
Last active May 31, 2023 08:23
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init