Skip to content

Instantly share code, notes, and snippets.

View Pushplaybang's full-sized avatar
:octocat:
0_0

Paul Pushplaybang

:octocat:
0_0
View GitHub Profile
@Pushplaybang
Pushplaybang / woo-remove-pretty-photo.php
Created January 29, 2014 14:23
#WordPress #WooCommerce - remove shitty pretty photo lightbox
//Remove prettyPhoto lightbox
add_action( 'wp_enqueue_scripts', 'fc_remove_woo_lightbox', 99 );
function fc_remove_woo_lightbox() {
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
wp_dequeue_script( 'prettyPhoto' );
wp_dequeue_script( 'prettyPhoto-init' );
}
//Add fancyBox lightbox - if thats what you want.
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
// Go to menue:
// find->find in files
// Switch on reg_ex button
// Find:
^(.*)$
// alt
^.*\S+.*$
// Where:
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/*
@Pushplaybang
Pushplaybang / wp-admin-bar-tweaks.php
Created August 9, 2013 23:34
wp-admin-bar-tweaks
Disable the WordPress Admin Bar for all Users and Visitors
Turn off the toolbar with one simple line.
view plain
/*
* Disable the WordPress Admin Bar for all Users and Visitors
*/
remove_action( 'init', '_wp_admin_bar_init' );
^ top
Enable the WordPress Admin Bar for admins only
@Pushplaybang
Pushplaybang / wp-logout-redirect.php
Created July 1, 2013 11:34
WordPress Redirect to homepage after logout
<?php
/**
* @package Redirect to homepage after logout
* @version 0.1
*/
/*
Plugin Name: Redirect to homepage after logout
Plugin URI: http://daankortenbach.nl/wordpress/redirect-to-homepage-after-logout/
Description: Redirects the user to the homepage after logout
Author: Daan Kortenbach
@Pushplaybang
Pushplaybang / revealing-module-pattern-template.js
Last active September 8, 2019 21:52
Pattern Template : Revealing Module
var Module = (function(w, $) {
var State = {
initialized : false,
listening : false,
};
var Events = $({});
var Internal = {
/* Throttle Events */
throttle : function(fn, threshhold, scope) {
@Pushplaybang
Pushplaybang / free-meteor-deployment-heroku.md
Last active July 29, 2019 13:38
no frills instructions for getting meteor up on a free heroku and mongolab instance, no credit card required.

Prerequisites

You're going to need to create accounts at both Heroku and mlab, get the heroku toolbelt, create a database and get the full db url with the credentials.

  1. Have a meteor project you want to deploy setup on GIT
    • if your not yet on git, you'll need to get up to speed before proceeding with this, of course you should be on git, versioning all your work, and luckily getting started is pretty easy. You'll also need a github account to follow this tutorial.
  2. Setup a Heroku Account here
  3. Setup a mongo lab account
  4. Install the Heroku tool belt
  5. create a new db on mlab
  6. create a new user for that db
@Pushplaybang
Pushplaybang / rgb_to_hex_to_rgb.php
Created April 22, 2013 06:35
php functions convert hex to rgb and rgb to hex
function hex2rgb($hex) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));
@Pushplaybang
Pushplaybang / circle.yml
Last active February 2, 2019 20:10
Circle CI configuration for building, linting, testing and deploying a meteor application to galaxy.
# use the default node box and isntall meteor
machine:
node:
version: 4.2.6
pre:
# download if meteor isn't already installed in the cache
- meteor || curl https://install.meteor.com | /bin/sh
post:
- meteor --version

BEM Cheatsheet

BLOCK

Block encapsulates a standalone entity that is meaningful on its own.

While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy.

Holistic entities without DOM representation (such as controllers or models) can be blocks as well.