Skip to content

Instantly share code, notes, and snippets.

View ErikFontanel's full-sized avatar

Erik Gelderblom ErikFontanel

View GitHub Profile
@patrickpietens
patrickpietens / gist:36a068100e1c3d5d6b9d
Created March 30, 2015 10:31
Mediaquery mixin to rule them all
$breaks: (
"small": (min: 0em, max: 34.99em),
"normal": (min: 35em, max: 47.99em),
"wide": (min: 48em, max: 64.99em),
"widest": (min: 65em, max: null)
);
@mixin only-responds-to($breakpoint, $portrait: false) {
$myBreakpoint: map-get($breaks, $breakpoint);
$myMin: map-get($myBreakpoint, min);
@roelven
roelven / gist:2987639
Created June 25, 2012 09:35 — forked from matthewhudson/gist:1603502
Integrate Open Graph with Tumblr
<meta property="og:site_name" content="{Title}" />
<meta property="fb:app_id" content="FB_APP_ID" />
<meta property="fb:admins" content="FB_ADMIN_ID" />
<meta property="og:description" content="{MetaDescription}" />
<meta property="og:locale" content="en_US" />
{block:IndexPage}
<meta property="og:image" content="{PortraitURL-128}" />
<meta property="og:title" content="SITE_NAME" />
<meta property="og:type" content="blog" />
@alettieri
alettieri / wp_capistrano.rb
Created August 30, 2012 17:26
WordPress Capistrano deployment file (On Webfaction)
default_run_options[:pty] = true # Must be set for the password prompt from git to work
# WebFaction user account
# This is the server user account
set :server_user, "<server_username>"
# Server Domain
set :domain, "<domain_name>"
set :user, server_user
# Repository User
@kuzin
kuzin / mq.css
Created October 3, 2012 19:01 — forked from chriscoyier/mq.css
SCSS Media Queries with Retina Support
@mixin respond-to($media, $retina: true) {
// Settings
$small : 320px;
$medium : 700px;
$large : 1300px;
@if $media == 'small' {
@if $retina == true {
@media
@yuchant
yuchant / viewport.coffee
Created January 25, 2014 02:33
Viewport Units with Coffee
class root.utils.ViewportHeight
'The VH unit is not well supported. Use data-tags instead.
data-viewport-unit="line-height: 100vh; height: 100vh;'
constructor: ({@element, @styles}={}) ->
@$element = $ @element
@$window = $ window
@_bindHandlers()
_getStyles: ->
@bomberstudios
bomberstudios / Add @3x.sketchplugin
Last active July 8, 2016 12:27
Add @3x resolution to existing Sketch documents
// This plugin will add a @3x size to all existing slices and exportable layers,
// that already have a @1x and @2x size
var p = [doc pages]
for (var i = 0; i < [p count]; i++) {
var current_page = [p objectAtIndex:i]
var exportable_layers = [current_page exportableLayers]
for (var l = 0; l < [exportable_layers count]; l++) {
var slice_or_layer = [exportable_layers objectAtIndex:l]
if ([slice_or_layer exportOptions]) {
<!--
* Liquid Snippet for generating responsive image srcsets based on Shopify's native image transforms.
* Published June 17, 2016 by Joseph Bergdoll
* www.extendedplay.nyc
*
* Full list of Shopify's generated image transforms:
* https://ecommerce.shopify.com/c/ecommerce-design/t/very-important-please-read-new-image-sizes-supported-up-to-2048x2048-for-retina-support-110766
*
* Simply include it within your image element, define the `image`, and the maximum size.
* Product Images and Theme Asset Images should have either `product: 'true'` or `asset: 'true'` declared, respectively.
@jacobwise
jacobwise / Advanced Custom Fields and JSON API
Last active November 1, 2017 13:11
How to add Advance Custom Fields to the JSON API in WordPress.
<?php
add_filter('json_api_encode', 'json_api_encode_acf');
function json_api_encode_acf($response)
{
if (isset($response['posts'])) {
foreach ($response['posts'] as $post) {
json_api_add_acf($post); // Add specs to each post
}
@koenbok
koenbok / framer-canvas.js
Created October 16, 2013 18:25
Framer Canvas Example
var myCanvasView = new View({
x:100, y:100,
width:200, height:200
})
// Add a nice background color so we see it
myCanvasView.style.backgroundColor = "rgba(255,0,0,.5)"
// This is the tricky bit, we create a canvas element (so we have a reference to it) and insert it into the view
@ttscoff
ttscoff / karabiner.json
Created July 25, 2017 17:09
Example Karabiner Elements setup for Vim navigation keys using Hyper+h/j/k/l
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {