Skip to content

Instantly share code, notes, and snippets.

View webgurus's full-sized avatar
🏠
Working from home

Gergely Márton webgurus

🏠
Working from home
View GitHub Profile
@jeduan
jeduan / reveal_ajax.js
Created February 9, 2012 00:15
Use Zurb reveal with ajax
$('a.reveal').click(function(event) {
event.preventDefault();
var $div = $('<div>').addClass('reveal-modal').appendTo('body'),
$this = $(this);
$.get($this.attr('href'), function(data) {
return $div.empty().html(data).append('<a class="close-reveal-modal">&#215;</a>').reveal();
});
});
@retlehs
retlehs / gist:2785401
Created May 25, 2012 02:17
Display YouTube thumbnail from embed URL
<?php
/**
* Display a thumbnail from YouTube based off the embed code saved in the
* video post format metabox used by the CF Post Formats plugin
*
* @link https://github.com/crowdfavorite/wp-post-formats
* @link http://stackoverflow.com/a/6382259
*/
global $post;
@retlehs
retlehs / gist:4120053
Created November 20, 2012 18:45
Remove unnecessary markup from WooCommerce
<?php
/**
* Remove unnecessary markup from WooCommerce:
*
* 1. Remove <meta name="generator" content="WooCommerce (version)" />
* 2. Remove the addition of <body class="theme-themename">
*/
function woocommerce_head_cleanup() {
global $woocommerce;
<?php
// output our custom field HTML
function pippin_edd_custom_checkout_fields() {
?>
<p id="edd-phone-wrap">
<label class="edd-label" for="edd-phone"><?php _e('Contact Number', 'pippin_edd'); ?></label>
<span class="edd-description"><?php _e( 'Enter your phone number so we can get in touch with you.', 'pippin_edd' ); ?></span>
<input class="edd-input" type="text" name="edd_phone" id="edd-phone" placeholder="<?php _e('Contact Number', 'pippin_edd'); ?>" value=""/>
</p>
<p id="edd-phone-wrap">
@jawinn
jawinn / boostrap-youtube-modal.js
Last active July 20, 2017 03:40
BOOTSTRAP 3.0 - Open YouTube Video Dynamicaly in Modal Window. Allow setting width and height.
// REQUIRED: Include "jQuery Query Parser" plugin here or before this point:
// https://github.com/mattsnider/jquery-plugin-query-parser
$(document).ready(function(){
// BOOTSTRAP 3.0 - Open YouTube Video Dynamicaly in Modal Window
// Modal Window for dynamically opening videos
$('a[href^="http://www.youtube.com"]').on('click', function(e){
// Store the query string variables and values
// Uses "jQuery Query Parser" plugin, to allow for various URL formats (could have extra parameters)
@derekconjar
derekconjar / wordpress-firebase.php
Last active April 25, 2024 15:21
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@hdragomir
hdragomir / sm-annotated.html
Last active June 13, 2024 03:01
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@crot4lus
crot4lus / facebook-to-disqus.php
Created September 11, 2014 09:21
Import Facebook comments to Disqus
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
<?php
error_reporting(0);
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@bigdawggi
bigdawggi / gist:a4eb094faa213c3a1297
Created March 25, 2015 23:52
Codeship Custom Deploy Script for WPEngine
# You must set up two environment variables:
# repoSlug = slug for WP Engine repository
# themeDir = path from the top of the repository, to the theme directory
git remote add production git@git.wpengine.com:production/${repoSlug}.git
git remote add staging git@git.wpengine.com:staging/${repoSlug}.git
cd ${themeDir}
npm install
npm install -g bower
bower install