Skip to content

Instantly share code, notes, and snippets.

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

Joe Fletcher heyfletch

🏠
Working from home
View GitHub Profile
@markthethomas
markthethomas / gist:6b114f5fd7d55d29eca3
Created May 31, 2014 19:28
Roots gruntfile with imagemin and autoprefixer
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
@heyfletch
heyfletch / findit.sh
Created October 13, 2012 21:10
Bash Command / Bashrc Function to find any occurrence of a key phrase in files or filepaths
function findit() {
{ mlfind . -iname "*$1*";
grep -irl "$1" .
} | sort -u
}
export -f findit
# Returns a list of filepaths where the key phrase occurs.
# Case insensitive
# Usage:
@zeljkoprsa
zeljkoprsa / wanelo-button
Last active December 22, 2015 21:59
Wanelo button for Magento product page.
<div id="wanelo-button">
<a class="wanelo-save-button"
href="<?php echo $home_url; ?>"
data-url="<?php echo $this->helper('core/url')->getCurrentUrl();?>"
data-title="<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>"
data-image="<?php echo $_product->getImageUrl(); ?>"
data-price="<?php echo number_format($_product->getFinalPrice(),2);?>"></a>
<script async="true" type="text/javascript" src="//cdn-saveit.wanelo.com/bookmarklet/3/save.js></script>
</div>
@builtbylane
builtbylane / google_conversion_iframe_hider.scss
Created February 15, 2016 01:53
Hide google_conversion_frame iframe
iframe[name='google_conversion_frame'] {
height: 0 !important;
width: 0 !important;
line-height: 0 !important;
font-size: 0 !important;
margin-top: -13px;
float: left;
}
@codesprint
codesprint / 1.js
Last active February 28, 2017 16:07
Magento: countryRegions not defined
countryRegions is not defined
@digitaljhelms
digitaljhelms / gist:3014302
Created June 28, 2012 22:08
Sublime Text 2 bash alias & CLI function to open projects without using the `.sublime-project` file extension
# bash alias
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
# bash function, usage: $ st -p [projectname] -opt2 -opt3
function st() {
if [ -n "$1" -a -n "$2" ]; then # if more than one argument
if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project
local projectfile="$2"
[[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext
if [ -e $projectfile ]; then # does project file exist?
@drewgillson
drewgillson / CustomerWishlist.sql
Created June 2, 2012 13:52
Magento customer wishlist report
SELECT b.email, c.value AS name, a.updated_at, d.added_at, d.product_id, e.name, SUM(g.qty_ordered) AS purchased
FROM `wishlist` AS a
INNER JOIN customer_entity AS b ON a.customer_id = b.entity_id
INNER JOIN customer_entity_varchar AS c ON a.customer_id = c.entity_id AND c.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'firstname' AND entity_type_id = b.entity_type_id)
INNER JOIN wishlist_item AS d ON a.wishlist_id = d.wishlist_id
INNER JOIN catalog_product_flat_1 AS e ON d.product_id = e.entity_id
LEFT JOIN sales_flat_order AS f ON f.customer_email = b.email
LEFT JOIN sales_flat_order_item AS g ON (f.entity_id = g.order_id AND g.sku LIKE CONCAT(e.sku,'%') AND g.product_type = 'simple')
GROUP BY b.email, c.value, a.updated_at, d.added_at, d.product_id, e.name
<?php
/*
Plugin Name: WPMDB Pro Migration Complete Notifications
Plugin URI: http://deliciousbrains.com
Description: Get notified when a migration completes
Author: Delicious Brains
Version: 0.0
Author URI: http://deliciousbrains.com
*/
@chrisblackwell
chrisblackwell / wordpress-nginx.conf
Created April 22, 2015 12:02
WordPress nginx confuration
server {
listen 80 default_server;
server_name domain.tld;
access_log /srv/www/domain.tld/logs/access.log;
error_log /srv/www/domain.tld/logs/error.log;
root /srv/www/domain.tld/public;
index index.php index.html index.htm;
client_max_body_size 20M;
@freshlogic
freshlogic / app.js
Last active July 8, 2019 18:53
Check an area code for available Google Voice numbers and post the results to Campfire
var Campfire = require('campfire').Campfire;
var request = require('request');
var areaCode = 972;
var campfire = new Campfire({ ssl: true, token: 'YOUR CAMPFIRE API TOKEN HERE', account: 'YOUR CAMPFIRE SUBDOMAIN NAME HERE' });
var headers = { Cookie: 'YOUR www.google.com COOKIE HERE' };
var url = 'https://www.google.com/voice/setup/searchnew/?ac=' + areaCode + '&start=0&country=US';
request.get({ url: url, headers: headers }, function(error, response, body) {
var json = JSON.parse(body);