Skip to content

Instantly share code, notes, and snippets.

@sc0ttj
sc0ttj / country-bounding-boxes.py
Created May 20, 2024 16:23 — forked from graydon/country-bounding-boxes.py
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@sc0ttj
sc0ttj / README.md
Created December 13, 2023 12:29 — forked from armollica/README.md
Convert SVG to Canvas

Convert SVG to canvas on-the-fly.

This article from MDN explains the process: Drawing DOM object into a canvas. This works for any DOM object, not just SVG. Not sure if this is well supported by older browsers. Works on Chrome, Firefox and IE 10 for me. The bar chart is a fork of this block by Mike Bostock: Canvas Bar Chart.

@sc0ttj
sc0ttj / SCSS.md
Created October 31, 2023 18:29 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@sc0ttj
sc0ttj / modifiers.scss
Created October 31, 2023 18:28 — forked from sarahdayan/modifiers.scss
Sass Modifiers Mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
@sc0ttj
sc0ttj / watchfiles.md
Created June 8, 2023 15:56 — forked from thiagoh/ watchfiles.md
watchfiles: Watch multiple files and execute bash commands as file changes occur

watchfiles

  • author: Thiago Andrade thiagoh@gmail.com
  • license: GPLv3
  • description:
  • watches the given paths for changes
  • and executes a given command when changes occur
  • usage:
  • watchfiles <paths...>
@sc0ttj
sc0ttj / watchdir.sh
Created June 8, 2023 15:55 — forked from fabswt/watchdir.sh
Watch a directory using bash and inotifywait
#!/bin/sh
# Usage
#
# Call the script with the directory you want to watch as an argument. e.g.:
# watchdir.sh /app/foo/
#
#
# Description:
# Uses inotifywait to look for new files in a directory and process them:
@sc0ttj
sc0ttj / watchdo.sh
Created June 8, 2023 15:55 — forked from molotovbliss/watchdo.sh
watchdo: Linux bash script to monitor file modifications recursively & execute bash commands as changes occur
#!/usr/bin/env bash
# script: watchdo
# author: Mike Smullin <mike@smullindesign.com>
# modified: Jared Blalock <mb@molotovbliss.com>
# possible use for monitoring .less changes to compile to .css
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
@sc0ttj
sc0ttj / watch.sh
Created June 8, 2023 15:53 — forked from JarredMack/watch.sh
Bash file watcher
#!/bin/sh
############
# Usage
# Pass a path to watch, a file filter, and a command to run when those files are updated
#
# Example:
# watch.sh "node_modules/everest-*/src/templates" "*.handlebars" "ynpm compile-templates"
############
@sc0ttj
sc0ttj / watch.sh
Created June 8, 2023 15:53 — forked from matthewjosephtaylor/watch.sh
Bash shell script that watches a file and executes a command if the file changes.
#!/bin/sh
# Shell script that watches a file and executes a command if the file changes.
# Matt Taylor
# http://blog.matthewjosephtaylor.com
# License: This is free and unencumbered software released into the public domain.
# Thanks to code/tips from some helpful souls on irc.freenode.net ##unix
# All errors are of course my own. :)