Skip to content

Instantly share code, notes, and snippets.

View anyssa's full-sized avatar

Anyssa Ferreira anyssa

View GitHub Profile
@anyssa
anyssa / functions.php
Created September 17, 2018 22:03 — forked from Clorith/functions.php
WordPress filter for adding responsive wrapper to embedded content
<?php
/**
* Filter for adding wrappers around embedded objects
*/
function responsive_embeds( $content ) {
$content = preg_replace( "/<object/Si", '<div class="embed-container"><object', $content );
$content = preg_replace( "/<\/object>/Si", '</object></div>', $content );
/**
* Added iframe filtering, iframes are bad.
@anyssa
anyssa / fonts.scss
Last active March 4, 2018 16:54
Easy @font-face SASS mixin
@mixin fontface($family, $path, $filename, $style: normal, $weight: normal) {
@font-face {
$src: $path + $filename;
font-family: '#{$family}';
src: url('#{$src}.woff2') format('woff2'),
url('#{$src}.woff') format('woff'); // standart formats
font-style: $style;
font-weight: $weight;
}
}
@anyssa
anyssa / font-face.scss
Last active October 9, 2017 12:40
Sass mixins for WordPress development
//
// Font-face mixin for .wof and .wof2
//
@mixin font-face( $family, $path: "../fonts/", $filename: $family, $style: normal, $weight: normal) {
@font-face {
font-family: "#{$family}";
font-style: $style;
font-weight: $weight;
src: url("#{$path}#{$filename}.woff2") format("woff2"),
@anyssa
anyssa / README.md
Created April 6, 2017 22:13 — forked from jonathantneal/README.md
SASS @font-face mixin

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);
@anyssa
anyssa / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@anyssa
anyssa / Reverse order of all posts
Created July 30, 2014 18:19
Bulk edit post dates (control posts order by date)
-- Bulk edit post dates (reverse order of posts)
UPDATE wp_posts SET post_date = DATE_ADD( FROM_UNIXTIME(UNIX_TIMESTAMP('2014-01-01 12:00:00')),INTERVAL -id HOUR);