Skip to content

Instantly share code, notes, and snippets.

/**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2010 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
@tannerhodges
tannerhodges / index.html
Last active August 29, 2015 14:26 — forked from anonymous/index.html
CSS Diagonal Strikethrough // source http://jsbin.com/oqibus/1
<!-- Found at http://stackoverflow.com/a/14593540/1786459 -->
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
.strikethrough {
position: relative;
}
@tannerhodges
tannerhodges / responsive-font-size.css
Created October 6, 2015 19:38 — forked from AllThingsSmitty/responsive-font-size.css
Font size based on viewport size
/* base font size + viewport height + viewport width */
h1 {
font-size: calc(2rem + 4vh + 4vw);
}
/* responsive font-size responsive */
html {
font-size: calc(100% + .2vh + .2vw);
}
@tannerhodges
tannerhodges / filter_foreignobject.js
Created November 24, 2015 15:47 — forked from basecode/filter_foreignobject.js
SVGFilter + SVGForeignObjectElement
<svg width="500" height="500" style="background-color:orange;" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="dropShadowStack">
<feGaussianBlur stdDeviation="3"/>
<feOffset dx="3" dy="3" result="offsetblur"/>
<feFlood flood-color="#720"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
@tannerhodges
tannerhodges / usage.js
Created February 22, 2016 17:49 — forked from jasonfarrell/usage.js
Checks if a DOM element is visible. Takes into consideration its parents and overflow.
var my_element = document.getElementById('my-element');
//-- Returns true/false
my_element.isVisible(my_element);
@tannerhodges
tannerhodges / README.md
Created February 25, 2016 15:39 — forked from eweitnauer/README.md
Dominant Baseline Style

Demonstrates the effect of dominant baseline for each of its possible values on text positioning in an SVG.

Each browser/ mobile browser seems to handle these a bit differently. Here are some issues:

  • Retrieving bounding boxes only works correctly after the font is loaded (and there is no easy way to find out when this happens)
  • The bounding box width does not reflect the actual extent of a text, but how far it advances the cursor. That means that in an italic letter 'f' in many fonts, part of the f will actually lie outside of the bounding box
  • The baseline-shift style does not work in FF
  • dominant-baseline values are interpreted different among browsers

All in all its best just use 'alphabetical' (which is consistent across browsers) and do any further vertical positioning by manually by using the x,y or dx,dy or the transform attributes. Also, if one needs to find out about the actual bounds of a text, one cannot rely on the getBBox() or the getBoundingClientRect() DOM methods, but has to use

@tannerhodges
tannerhodges / git-yesterday.sh
Created August 26, 2016 13:14 — forked from cgutierrez/git-yesterday.sh
Create a commit log of all the repositories in a directory
#!/usr/bin/env sh
PROJECTS_DIR=$HOME/Desktop/Werk/mode
LOG_FILE=$PROJECTS_DIR/commits.txt
AUTHOR='Chris Gutierrez'
# store the current dir
CUR_DIR=$(pwd)
#hey user
@tannerhodges
tannerhodges / ConvertFourSpacesToTwo.sublime-macro
Created September 14, 2016 19:27 — forked from daftspunk/ConvertTwoSpacesToFour.sublime-macro
Convert 4 spaces to 2 spaces, Sublime Text macro
//
// Converts code indentation from 4 spaces to 2 spaces
//
// For a hotkey, add to Preferences > Key Bindings - User:
//
// { "keys": ["ctrl+alt+i"], "command": "run_macro_file", "args": {"file": "res://Packages/User/ConvertTwoSpacesToFour.sublime-macro"} }
//
[
{
"args": { "setting": "tab_size", "value": 4 },
@tannerhodges
tannerhodges / Default (OSX).sublime-keymap
Created September 14, 2016 19:28 — forked from beaugunderson/Default (OSX).sublime-keymap
Sublime Text macros for converting to and from 2 and 4 space indentation
[
{
"keys": ["ctrl+2"],
"command": "run_macro_file",
"args": {
"file": "Packages/User/to-2.sublime-macro"
}
},
{
"keys": ["ctrl+4"],
@tannerhodges
tannerhodges / GIF-Screencast-OSX.md
Created October 20, 2016 18:00 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: