Skip to content

Instantly share code, notes, and snippets.

@vincentorback
vincentorback / object-fit-cover-polyfill.js
Last active February 21, 2017 14:17
Replace object-fit elements with a div using background-size: cover
/*
Demo:
http://codepen.io/vincentorback/pen/ZLLJbB
*/
export function objectFit (el) {
let objectElReplacement = `<div
class="${el.classList}"
style="
background-image:url(${el.getAttribute('src')});
@vincentorback
vincentorback / breakpoints.js
Last active February 21, 2017 14:18
Sync resizing event and breakpoints
/**
* Dependencies
*/
const breakpoints = {
xs: 300,
sm: 600,
md: 800,
lg: 1200,
xl: 1600
};
@meodai
meodai / inspiration
Last active March 21, 2023 13:52
Sexy Frontend
One-pager / Scroll:
- http://www.north2.net/
- http://10x16.com/
- http://www.hm.com/us/kenzo#inspiration
- http://www.stinkdigital.com/
- https://nameoflove.com/
- https://www.thened.com/
- https://thecreativeindependent.com/
- http://www.melville-design.com/
- http://designgest.com/
@dfwood
dfwood / wp-iso8601-datetime.php
Last active March 6, 2017 20:24
Datetime conversion functions for WordPress using the ISO8601 standard.
<?php
/**
* Why does this exist? http://xkcd.com/1179/ also because it makes sense to have a standard way in WordPress to work with
* dates and times so that plugin developers can create plugins that will work in any timezone worldwide.
*
* WordPress sets the default timezone during execution to UTC, reguardless of what the server is set to.
* This means that date( 'FORMAT' ) will always give you the current time in UTC, not the timezone you have set
* in the WP admin settings. Use date( 'FORMAT', current_time( 'timestamp' ) ) instead to get WP local time. Likewise,
* use current_time( 'timestamp' ) instead of time() for the local time.
*/
<img class="img" src="http://placekitten.com/320/480" alt="" data-big="http://placekitten.com/1024/768" />
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@tdreyno
tdreyno / isoTransform.js
Created May 6, 2011 21:51
Isotope CSS3 jQuery cssHooks
// ========================= getStyleProperty by kangax ===============================
// http://perfectionkills.com/feature-testing-css-properties/
var getStyleProperty = (function(){
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms'];
var _cache = { };
function getStyleProperty(propName, element) {