Skip to content

Instantly share code, notes, and snippets.

@pudgereyem
pudgereyem / font-feature-settings
Created January 31, 2014 21:28
SCSS: font-feature-settings mixin
// Font feature settings mixin and property default.
// Examples: @include font-feature-settings("liga");
// @include font-feature-settings("lnum" false);
// @include font-feature-settings("pnum" 1, "kern" 0);
// @include font-feature-settings("ss01", "ss02");
@mixin font-feature-settings($settings...) {
@if length($settings) == 0 { $settings: none; }
@include experimental(font-feature-settings, $settings);
}
@pudgereyem
pudgereyem / package.json
Created February 6, 2014 20:59
GRUNT: Packages
{
"name": "example-project",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.7.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-imagemin": "~0.4.0",
"grunt-contrib-watch": "~0.5.3",
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
## Discussion regarding Newsletter design and development
Questions to be answered (somewhat):
- Q: Should I use a framework?
- Q: What about SASS, GRUNT and other tools we like so much?
### Should I use a framework?
Yes. Since Email Clients handle HTML very different from web browsers (read: very bad), we can't use the markup we are used to. Good news is there are some framworks that are tested out and can help us developers out:
- http://zurb.com/ink/
@pudgereyem
pudgereyem / filediff.sh
Created March 31, 2014 08:52
SHELL: Explore the difference between files and folder structures with diff
# From http://hints.macworld.com/article.php?story=20070408062023352
`diff` helps you explore the difference between files and folder structures in Unix. Really good.
`diff -qr dirA dirB | grep -v -e 'DS_Store' -e 'Thumbs' | sort > diffs.txt`
---
> As mentioned in other hints, diff can not only compare two files, it can, by using the -r option, walk entire directory trees, recursively checking differences between subdirectories and files that occur at comparable points in each tree. The trick is to use the -q option to suppress line-by-line comparisons in files that differ:
@pudgereyem
pudgereyem / gist:7da56c2f70fd57f89689
Created May 28, 2014 06:12
CSS: "text-rendering" problem on Android 4.2 and 4.3
# Solving "text-rendering" problem on Android 4.2 and 4.3
- Source: <https://gist.github.com/pudgereyem/7da56c2f70fd57f89689>
- Comments: <https://twitter.com/pudgereyem>
`text-rendering` enables OT features such as kerning that would normally be set by the browser while also enabling ligatures.
More: <https://developer.mozilla.org/en-US/docs/Web/CSS/text-rendering>
Surprisingly, the default browsers in Android 4.2 and 4.3 do not support kerning, while the default browsers in Android 4.1 and 4.4 do. This is caused by a bug in the support for the text-rendering property in Android 4.2 and 4.3. Android 4.4 uses Chrome as its default browser, which does not exhibit the bug.
@pudgereyem
pudgereyem / supportkit-email-capture.coffee
Created September 8, 2015 20:21
SupportKit Email Capture Addon
# SupportKit Email Capture Adddon
# Written by @pudgereyem, 2015-09-08
#
# What it does:
# 1. Check if there is a SupportKit.user registered and if it has an email
# 2. Adds email form if it doesn't have an email attached
# 3. When user submits the form check if his/her email validates
# and start chat it does.
class SupportKitEmailCapture
@pudgereyem
pudgereyem / gist:962161
Last active September 25, 2015 18:07
CSS: Reset
/* ==== Scroll down to find where to put your styles :) ==== */
/* HTML5 ✰ Boilerplate */
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
@pudgereyem
pudgereyem / gist:c5757e11000cd462b07a
Created February 5, 2015 16:10
Serve Missing Media from a Production Server via Apache/Nginx
# Serve Missing Media from a Production Server via Apache/Nginx
# When working on the website locally, and you don't want to download (or even have) the images that are used on the live site, a simple redirect solves the problem. You can read a good blog post on this here; <http://rzen.net/serve-missing-media-production-apache-nginx/> by Brian Richards.
###
### For Apache
###
# Attempt to load files from production if they're not in our local version
# If you have development/production setup, it's neat to use .htaccess to redirect all failed requests to the production server (since we wont want to sync all the uploaded media between the two)
<IfModule mod_rewrite.c>
@pudgereyem
pudgereyem / .htaccess
Last active December 16, 2015 04:39
Apache: .htaccess assets redirect development -> production
# Attempt to load files from production if they're not in our local version
# If you have development/production setup, it's neat to use .htaccess to redirect all failed requests to the production server (since we wont want to sync all the uploaded media between the two)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://yourlivesite.com/wp-content/uploads/$1
</IfModule>