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
// Custom Sale translation text
add_filter('woocommerce_sale_flash', 'avia_change_sale_content', 10, 3);
function avia_change_sale_content($content, $post, $product){
$content = !$product->is_in_stock() ?
'<span class="sold">
<span>SOLD</span>
</span>' :
'<span class="onsale">
<span>'.__( 'Sale', 'hawea' ).'</span>
@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
# created this file via: `code --list-extensions`
# https://stackoverflow.com/questions/35773299/how-can-you-export-vs-code-extension-list
aaron-bond.better-comments
capaj.vscode-exports-autocomplete
christian-kohler.npm-intellisense
dbaeumer.vscode-eslint
drKnoxy.eslint-disable-snippets
eamodio.gitlens
EditorConfig.EditorConfig
import React from 'react';
import ReactDOM from 'react-dom';
import {findPosRelativeToViewport} from 'dom-find';
import PropTypes from 'prop-types';
class StickyDiv extends React.Component {
displayName: "StickyDiv"
static defaultProps = {
offsetTop: 0,
@12finger
12finger / lesereise.json
Last active June 13, 2017 21:09
töösst
{ "markers": [
{
"lat": "47.3716593",
"lng": "8.533884",
"venue": "Kaufleuten",
"city": "Zürich",
"date": "21.06.17",
"time": null,
"link": null,
"showInfo": false