Skip to content

Instantly share code, notes, and snippets.

@tannerhodges
tannerhodges / SassMeister-input.scss
Created September 25, 2018 15:36 — forked from athaeryn/SassMeister-input.scss
Sass mixin for z-index
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
/*
* inspired by:
* http://www.smashingmagazine.com/2014/06/12/sassy-z-index-management-for-complex-layouts/
*/
$z: (
@tannerhodges
tannerhodges / class-naming-convention.md
Created September 11, 2018 20:46 — forked from whizark/class-naming-convention.md
HTML/CSS Class Naming Convention #html #css #sass
@tannerhodges
tannerhodges / CustomWordPressValetDriver.php
Last active August 21, 2018 02:20 — forked from stidges/CacheBustingLaravelValetDriver.php
Rewrite filename-based cache busting URIs (e.g. jquery.1476809927.js) to the correct filename in Laravel Valet
<?php
class CustomWordPressValetDriver extends WordPressValetDriver
{
/**
* Allow filename-based cache busting.
* @see https://gist.github.com/stidges/3d0c0317bf0d36073dd045bbcc742852
* @param string $sitePath
* @param string $siteName
* @param string $uri
@tannerhodges
tannerhodges / angle-between-points.js
Created August 9, 2018 01:11 — forked from conorbuck/angle-between-points.js
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@tannerhodges
tannerhodges / .zshrc
Last active December 12, 2023 03:21
# ------------------------------
# Appearance
# ------------------------------
# Enable colors
CLICOLOR=1
# Custom prompt
# - Git branch: https://www.mfitzp.com/article/add-git-branch-name-to-terminal-prompt-mac/
# - Current folder: https://superuser.com/a/142129, http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html
@tannerhodges
tannerhodges / cubicBezierExporter.jsx
Created June 20, 2017 19:32 — forked from turbodrive/cubicBezierExporter.jsx
Cubic bezier ease exporter from After Effects
var comp = app.project.activeItem;
var layer = comp.selectedLayers[0];
var numEffects = layer.Effects.numProperties;
var slider;
for(var i = 1; i<=numEffects; i++){
var effectLayer = layer.Effects.property(i);
var matchName = effectLayer.matchName;
if(matchName == "ADBE Slider Control"){
@tannerhodges
tannerhodges / disable-xdebug.sh
Created June 13, 2017 13:24 — forked from hacfi/disable-xdebug.sh
OS X homebrew php 7.0 enable/disable xdebug extension script
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
echo "xdebug disabled"
@tannerhodges
tannerhodges / PhotoshopResizeAndSaveToDesktop.jsx
Created May 24, 2017 01:13
Photoshop script to save multiple sizes of an image to the desktop
/* Resize and Save to Desktop */
/* @@@BUILDINFO@@@ Resize and Save to Desktop.jsx 0.1.0 */
/* jshint ignore:start */
// Enable double clicking from Macintosh Finder or Windows Explorer
#target photoshop
/* jshint ignore:end */
@tannerhodges
tannerhodges / gh-pages-deploy.md
Created May 23, 2017 21:19 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@tannerhodges
tannerhodges / PhotoshopCreateLuminanceMask.jsx
Last active May 24, 2017 01:12
Photoshop script to create luminance masks from transparent PNGs
// ------------------------------
// Vars
// ------------------------------
// Save the current preferences
var startRulerUnits = app.preferences.rulerUnits;
var startTypeUnits = app.preferences.typeUnits;
var startDisplayDialogs = app.displayDialogs;