Skip to content

Instantly share code, notes, and snippets.

View frederikchristensen's full-sized avatar

Frederik Christensen frederikchristensen

  • Frederik Christensen
  • Copenhagen, Denmark
View GitHub Profile

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@tjhole
tjhole / WORDPRESS: Base64 Image to Wordpress Uploads directory
Created May 9, 2014 12:35
WORDPRESS: Base64 Image to Wordpress Uploads directory
function tattoo_submit() {
if (isset($_POST["addtattoo"])) {
$title = "Tattoo : ". $_POST["tatooInput"];
$my_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_author' => 1,
@AndrewJHart
AndrewJHart / Page-Transitions-in-Backbone.markdown
Last active March 9, 2023 20:40
Simple and elegant Backbone.js View Animations and Transitions for web and hybrid mobile apps. A Pen by Andrew J Hart.

Backbone.View Page Transitions in Backbone

An easy and effective way to implement page transitions into any Backbone.js application. Its been tested with Thorax by extending Thorax.View and tested with Marionette with various ways to implement it. There are also many other various attempts at animations/transitions with marionette that can be found on its issues page.

This originated from an idea and quest for a clean way to create a simple yet reusable animated backbone view. I found an excellent post by Mike Fowler titled Page Transitions in Backbone that provided a large part of the core and concept.

@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@adamjspooner
adamjspooner / _config.yml
Created May 24, 2011 06:08
A Jekyll plugin to convert .styl to .css.
stylus:
compress: true
path: ./path/to/styl
@balupton
balupton / README.md
Last active July 13, 2024 17:32
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo