Skip to content

Instantly share code, notes, and snippets.

@pax
pax / style.css
Created February 28, 2024 13:00
Creates a Table of Contents with relative links to H* elements found inside target element or the whole document
.hx-0{margin-top:1.25ex;border-bottom:1pxdotted#999;font-size:1.2em;}
.hx-1{padding-left:.25ex;margin-left:.25ex;margin-top:1ex;font-size:1.1em;border-bottom:1pxdotted#DDD;}
.hx-2{padding-left:.75ex;margin-left:.5ex;margin-top:.5ex;border-left:1pxsolid#EEE;}
.hx-3{padding-left:1ex;margin-left:1ex;margin-top:.25ex;border-left:1pxsolid#EEE;}
.hx-0+.hx-0{margin-top:.25ex;}
.hx-2+.hx-2{margin-top:.5ex;}
.hx-1+.hx-1{margin-top:1ex;}
.hx-1:before {content: '\2022\00A0 '; color: #DCC;}
.hx-2:before {content: '\00A0\203A\00A0\00A0 '; color: #DCC;}
@pax
pax / resize_images.sh
Created January 27, 2024 21:23
batch resize and optimize images
#!/bin/bash
# Check if an argument is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 /path/to/image/directory"
exit 1
fi
# Define the maximum width, height, and quality
MAX_WIDTH=1920
@pax
pax / vidcompress.sh
Created January 27, 2024 18:14
Batch compress and resize videos (mov, mp3, mp4)
#!/bin/bash
# Parameters
CRF_VALUE=28 # Quality level for video compression (lower is higher quality)
FRAME_RATE=24 # Frame rate for video files
AUDIO_BITRATE=96k # Audio bitrate for MP3 files
RESIZE_PERCENT=75 # Resize percent (e.g., 75 for 75% of original size)
MIN_WIDTH=2800 # Minimum width in pixels to apply resizing
# Target directory (use current directory if not specified)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pax
pax / CSV wrangling.md
Last active September 20, 2024 11:18
Tools & cli snippets for handling large csv files

tags: cheatsheet, csv, json, dev

Largeish data wrangling (csv, json)

  • Desktop apps
  • Web Apps
  • CLI Tools
  • CLI Snippets
@pax
pax / html-colors-cheatsheet.html
Created February 6, 2016 21:33
HTML colos cheatsheet
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png">
<title>&#9673; HTML color names</title>
<style>
body {font: 12px Arial, Helvetica, sans-serif; }
.js-color {width: 2.5em; height: 2.5em; border-radius: 50%}
h4 {font-weight: normal; margin: 0} li {vertical-align: middle;}
@pax
pax / emoji.html
Created February 6, 2016 21:31
emoji cheatsheet
<html>
<head>
<meta charset="UTF-8">
<title>&#9733; Emoji cheat-sheet</title>
<style>
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
@pax
pax / Webdev tools.md
Last active April 8, 2018 09:14
Collection of tools for webdevelopment

In response to Ask DN: cheatsheets What are your shortcuts, your hotkeys, your design/dev best practices, the things that make your life easier?


Apps

  • Sublime Text - with a lot of addons (detailed below)
  • aText text expander (OSX only). Considerably cheaper ($5) than the original TextExpander (~$30). For instance, each time I need to input a Markdown link I type .mkl and I get []() (otherwise I always forget which bracket is first). Also works great for code snippets.
  • SCSS
  • ReCSS bookmarklet - refresh only the css in a webpage, speeds up minor CSS changes
  • nvALT for quick notes and code snippets