Skip to content

Instantly share code, notes, and snippets.

@wutangpaul
wutangpaul / split_csv.sh
Created April 13, 2021 14:18
Split a large CSV file into smaller files
#!/bin/bash
FILENAME=orders.csv
HDR=$(head -1 $FILENAME)
split -l 5000 $FILENAME xyz
n=1
for f in xyz*
do
if [ $n -gt 1 ]; then
echo $HDR > Part${n}-$FILENAME
fi
@wutangpaul
wutangpaul / getCrossDomainCookieUrl.js
Last active October 6, 2023 22:12
Get cross domain hostname for cookies
getCrossDomainCookieUrl = (url) => {
// parse a URL using the WHATWG URL API
const myURL = new URL("https://new.petsafe.com:81/foo");
// Remove all subdomains
myURL.hostname = myURL.hostname.replace(/^([^\.]+)\./, "");
console.log(myURL.hostname);
};
@wutangpaul
wutangpaul / kitty.conf
Last active November 22, 2023 10:20
My current kitty.conf, using Fira Code and Dracula theme via https://github.com/dexpota/kitty-themes
# vim:fileencoding=utf-8:ft=conf
# Font family. You can also specify different fonts for the
# bold/italic/bold-italic variants. By default they are derived automatically,
# by the OSes font system. Setting them manually is useful for font families
# that have many weight variants like Book, Medium, Thick, etc. For example:
# font_family Operator Mono Book
# bold_font Operator Mono Thick
# bold_italic_font Operator Mono Medium
# font_family Input Mono