Skip to content

Instantly share code, notes, and snippets.

@jayelkaake
jayelkaake / locks.sql
Last active October 23, 2018 22:32 — forked from zm69/locks_and_blocking.sql
PSQL Useful Queries
-- See summary of table sizes (index and storage sizes) sorted by largest size to smallest size
SELECT
table_name,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size,
ROUND(indexes_size/1024/1024) as indexes_size_mb,
ROUND(table_size/1024/1024) as table_size_mb,
ROUND(total_size/1024/1024) as total_size_mb
FROM (
(function() {
/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */
!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t)}(this,function(t){var e=function(){function $(t){return null==t?String(t):S[C.call(t)]||"object"}function F(t){return"function"==$(t)}function k(t){return null!=t&&t==t.window}function M(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function R(t){return"object"==$(t)}function Z(t){return R(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function z(t){var e=!!t&&"length"in t&&t.length,n=r.type(t);return"function"!=n&&!k(t)&&("array"==n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function q(t){return a.call(t,function(t){return null!=t})}function H(t){return t.length>0?r.fn.concat.apply([],t):t}function I(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function V(t){return t in l?l[t]:l[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function _(t,e){return
@jayelkaake
jayelkaake / Bookmarklet to check for approved PRs
Last active September 28, 2016 20:35
Bookmarklet to check for approved PRs. If a PR is approved it will add a little tag like this for you. Demo: http://g.recordit.co/PYfjLKxNJ2.gif
javascript:!function(){function t(t,e){var n=t.find(".labels");Zepto.get(e,function(t){var e=t.toString();n.find(".spin").remove(),-1===e.indexOf("Review required")&&-1===e.indexOf("requested changes")&&-1!==e.indexOf("approved")&&n.prepend('<a href="#" aria-label="" class="label v-align-text-top labelstyle-006b75 linked-labelstyle-006b75 tooltipped tooltipped-n" style="background-color: #84d767;color: #fff;">✓ approved</a>')})}!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t)}(this,function(t){var e=function(){function e(t){return null==t?String(t):W[Y.call(t)]||"object"}function n(t){return"function"==e(t)}function r(t){return null!=t&&t==t.window}function i(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function o(t){return"object"==e(t)}function a(t){return o(t)&&!r(t)&&Object.getPrototypeOf(t)==Object.prototype}function s(t){var e=!!t&&"length"in t&&t.length,n=S.type(t);return"function"!=n&&!r(t)&&("array"==n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function u(t)
@jayelkaake
jayelkaake / index.php
Created March 12, 2016 20:51
Magento index.php file for developers
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@jayelkaake
jayelkaake / header.phtml
Last active February 4, 2016 23:43
Display customer's store credit balance in header - sample header.phtml file for Magento 1.9.2.2 base/default theme.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@jayelkaake
jayelkaake / header.phtml
Last active February 4, 2016 23:44
Magento store credit balance show in the header with Magecredit - sample header.phtml for RWD theme.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@jayelkaake
jayelkaake / iconv.internal_encoding.php_5.6.9_fix.sh
Created September 9, 2015 19:27
Command to update Magento to not show "Deprecated functionality: iconv_set_encoding()" message on non-OSX systems.
sed -i "s/'internal_encoding'/'default_charset'/g" lib/Zend/XmlRpc/Client.php lib/Zend/Service/Audioscrobbler.php lib/Zend/Service/Technorati.php lib/Zend/Locale/Format.php lib/Zend/Validate/Hostname.php lib/Zend/Validate/StringLength.php
@jayelkaake
jayelkaake / gist:34109641e5489e3e7e30
Created August 31, 2015 01:16
Command to update Magento to not show "Deprecated functionality: iconv_set_encoding()" message on OSX.
sed -i '' -e "s/'internal_encoding'/'default_charset'/g" lib/Zend/XmlRpc/Client.php lib/Zend/Service/Audioscrobbler.php lib/Zend/Service/Technorati.php lib/Zend/Locale/Format.php lib/Zend/Validate/Hostname.php lib/Zend/Validate/StringLength.php
@jayelkaake
jayelkaake / Block.php
Last active April 19, 2018 22:27
Temporary 'fix' for static block caching issue in Magento 1.9.2 (app/code/local/Mage/Cms/Block/Block.php)
<?php
/**
* ************************************************************************************
* ***************ATTENTION*************************************************
* This is the temporary fix for the Magento 1.9.2 bug
* See http://magento.stackexchange.com/q/73685/3112?stw=2
* The only change from app/code/core/Mage/Cms/Block/Block.php
* is that the getCacheKeyInfo() function below is added.
* Thanks to andrewkett for the solution!
* ****************************************************************

Keybase proof

I hereby claim:

  • I am jayelkaake on github.
  • I am jayelkaake (https://keybase.io/jayelkaake) on keybase.
  • I have a public key whose fingerprint is 721B 259D 7DC4 12C7 C70F 89DB C5C9 0946 87BB 6FAA

To claim this, I am signing this object: