Skip to content

Instantly share code, notes, and snippets.

@rugor
rugor / gist:faf92d1b53a76607310fe5d3568a1902
Created May 20, 2016 16:26
PHP: WordPress ACF Flickity Fullscreen
<?php
$gallery_images = get_field('gallery');
?>
<div class="gallery js-flickity" data-flickity-options='{ "autoPlay": 6000, "pageDots": false, "imagesLoaded": false, "prevNextButtons": false, "lazyLoad": false, "accessibility": false, "draggable": false, "wrapAround": true }'>
<?php foreach($gallery_images as $image) {
@rugor
rugor / gist:1decc15655891825d15a7024a06d898b
Created May 6, 2016 20:59
PHP: WordPress echo SVG file contents for inline SVG
<?php echo file_get_contents( get_stylesheet_directory_uri() . '/img/awesome.svg' ); ?>
@rugor
rugor / gist:a09ef9ffbfc2eb41262f
Last active March 25, 2016 00:40
JavaScript, CSS: fancyBox quick-ups
<!-- temp lightbox for special event -->
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.pack.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.rawgit.com/rugor/fancy-quick/master/jquery.fancybox.css?v=2.1.5" media="screen" />
<script type="text/javascript">
jQuery(document).ready(function ($) {
var cookie = document.cookie;
if (cookie.indexOf('visited=', 0) == -1) {
@rugor
rugor / .gitignore
Created March 24, 2016 03:44 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@rugor
rugor / gist:c47a58926d0c7fde7cec
Created December 16, 2015 17:15
EC2 Migrate Mongo from localhost
// ssh into ec2 instance, info from 'instances' panel in ec2 dashboard
ssh -i /path/to/key.pem user@public_dns
// run command to show container ids and ports
docker ps
// prints something like the following
961ed99341b meteorhacks/meteord:base "/bin/sh -c 'bash $ME" 18 hours ago Up 18 hours 0.0.0.0:80->80/tcp demo
124a407de468 mongo "/entrypoint.sh mongo" 18 hours ago Up 18 hours 127.0.0.1:27017->27017/tcp mongodb
@rugor
rugor / gist:144627e1a058842bf097
Created October 14, 2015 01:00
HTML: Markup for James
<h3>REPRESENTATION</h3>
<dl>
<dt>Birch Contemporary</dt>
<dd>129 Tecumseth Street</dd>
<dd>Toronto, Canada M6J 2H2</dd>
<dd><a href="#">www.birchcontemporary.com</a></dd>
</dl>
<dl>
<dt>Christophe Guye Galerie</dt>
<dd>129 Tecumseth Street</dd>
@rugor
rugor / wp-gallery-attributes
Last active January 19, 2016 20:50
Add data attributes to wordpress gallery image srcs #rugor #st
@rugor
rugor / gist:2661610011b50cdef678
Last active January 19, 2016 20:51
PHP: WordPress functions.php, fix for Chrome 45 Admin Dashboard bug #rugor #st
add_action('admin_enqueue_scripts', 'chrome_fix');
function chrome_fix() {
if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Chrome' ) !== false )
wp_add_inline_style( 'wp-admin', '#adminmenu { transform: translateZ(0); }' );
}
@rugor
rugor / index.html
Last active January 19, 2016 20:51
HTML: Boilerplate index.html #rugor #st
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.ico">
<title>Foo</title>
@rugor
rugor / gist:614ab0e058ced2a58980
Created August 21, 2015 17:01
Text: BrowserSync Settings for Vagrant Reload issue
// browser-sync options
browsersync: {
files: [build+'/**', '!'+build+'/**.map']
, notify: true
, open: true
//, port: 3000 // Port number for the live version of the site; default: 3000
//, proxy: 'test.dev' // Using a proxy instead of the built-in server as we have server-side rendering to do via WordPress
, watchOptions: {
debounceDelay: 2000 // Delay for events called in succession for the same file/event