Skip to content

Instantly share code, notes, and snippets.

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@12finger
12finger / README.md
Created February 21, 2024 00:02 — forked from pdanford/README.md
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


@12finger
12finger / use-svg-as-icon-image-mapboxgl.js
Created January 16, 2024 13:23 — forked from ryanhamley/use-svg-as-icon-image-mapboxgl.js
This gist shows how to use an <svg> element as an icon-image for a Mapbox GL symbol layer
// How to add an SVG as a symbol layer's icon image: https://github.com/mapbox/mapbox-gl-js/issues/5529#issuecomment-340011876
// Also see here: https://stackoverflow.com/a/11765731/2748013 (we need the data url stuff for the image src)
// NOTE: Importing SVGs requires an inline module loader such as https://github.com/webpack-contrib/svg-inline-loader
import template from './templates/marker.svg';
const width = 20;
const height = 40;
const img = new Image(width, height);
// map is your Mapbox GL map object
@12finger
12finger / update_mac.sh
Created October 26, 2023 15:45 — forked from flaxel/update_mac.sh
Update all homebrew formulae
#!/bin/sh
# fetch new versions of Homebrew + all formulae
brew update
# upgrade outdated formulae + casks
brew upgrade
# remove outdated downloads for all formulae + casks
brew cleanup
@12finger
12finger / netlify.toml
Created November 28, 2020 13:34 — forked from DavidWells/netlify.toml
All Netlify.toml & yml values
[Settings]
ID = "Your_Site_ID"
# Settings in the [build] context are global and are applied to all contexts unless otherwise overridden by more specific contexts.
[build]
# This is the directory to change to before starting a build.
base = "project/"
# NOTE: This is where we will look for package.json/.nvmrc/etc, not root.
# This is the directory that you are publishing from (relative to root of your repo)
const functions = require('firebase-functions')
const fs = require('fs')
let config = functions.config().env
if (process.env.NODE_ENV !== 'production') {
if (fs.existsSync('./env.json')) {
const env = require('./env.json')
config = env
#!/usr/bin/env ruby -wKU
require "rubygems"
require "appscript"
include Appscript
chrome = app("Google Chrome")
safari = app("Safari")
chrome_tab = chrome.windows[1].active_tab
# lib/custom_logger.rb
class CustomLogger < Logger
def format_message(severity, timestamp, progname, msg)
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
end
end
logfile = File.open("#{Rails.root}/log/custom.log", 'a') # create log file
logfile.sync = true # automatically flushes data to file
CUSTOM_LOGGER = CustomLogger.new(logfile) # constant accessible anywhere
@12finger
12finger / .powenv
Last active August 29, 2015 14:07 — forked from beneggett/.powenv
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if
{
"folders":
[
{
"path": "/Path/To/application/dir",
"folder_exclude_patterns": ["cache", "logs"],
"file_exclude_patterns": ["*_example.*", "backup_*"],
"name": "Application Name"
},
{