Skip to content

Instantly share code, notes, and snippets.

@tannerhodges
tannerhodges / Search my gists.md
Created May 21, 2019 15:13 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files. language:html

Declarative Component Mapping Syntax Options

Language / Prior Art ‘Valid’ HTML HTML Mapping Example Example with Args
‘Valid’ CSS Selectable CSS Mapping CSS Select CSS Selector w Args
JavaScript MooTools Multiple instance Separate Args new Foo(element); new Bar(element) new Foo(element, {a:"a", bB:"b B", c:{c:1}}); new Bar(element, {d:"d"})
HTML attr Dojo <1.6 NO
1 Element per instance
@tannerhodges
tannerhodges / encoding-video.md
Created September 26, 2018 03:12 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@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 / 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 / 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).