Skip to content

Instantly share code, notes, and snippets.

View dgmike's full-sized avatar

Michael dgmike

View GitHub Profile
@dgmike
dgmike / gist:3748700
Created September 19, 2012 09:32 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@dgmike
dgmike / layout.xml
Created September 19, 2012 10:03 — forked from jubalm/layout.xml
magento - external javascript in cms
<reference name="head">
<block type="core/text" name="google.cdn.jquery">
<action method="setText">
<text>
<![CDATA[
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">jQuery.noConflict()</script>
<script type="text/javascript" src="https://dl.dropbox.com/u/54878478/web/script.js"></script>
]]>
</text>
@dgmike
dgmike / gist:3762365
Created September 21, 2012 16:09 — forked from igorescobar/.bashrc_ps1.sh
My Personal PS1 customization to work with git repositories.
# This bash script will update your PS1 configuration to inform you about:
# - current hour
# - current logged user
# - machine name
# - current path
# - status of current branch:
# - untracked files
# - uncommited changes
# - when nothing is changed on current branch
# - inform you when the current user.name and user.email is different of the global settings
@dgmike
dgmike / .htaccess
Created September 26, 2012 02:22 — forked from basbl/.htaccess
a .htaccess with .htpasswd settings that whitelists facebook linter ip adresses
AuthName "Realm"
AuthUserFile /path/to/.htpasswd
AuthType Basic
Satisfy Any
<Limit GET POST>
Order Deny,Allow
Deny from all
#https://developers.facebook.com/docs/ApplicationSecurity/#facebook_scraper
Allow from 31.13.24.0/21
@dgmike
dgmike / sha512.js
Created October 1, 2012 12:39 — forked from 19h/sha512.js
SHA512 Javascript
var b;
if (!(b = t)) {
var w = Math,
y = {}, B = y.p = {}, aa = function () {}, C = B.A = {
extend: function (a) {
aa.prototype = this;
var c = new aa;
a && c.u(a);
c.z = this;
return c
@dgmike
dgmike / ajax_loading.js
Created October 1, 2012 12:52 — forked from ozgun/ajax_loading.js
ajax_loading.js
$(document).ready(function() {
$(".ajax_request").bind('ajax:before', function(evt, status, data, xhr) {
showAjaxLoading();
});
$(".ajax_request").bind('ajax:complete', function(evt, status, data, xhr) {
hideAjaxLoading();
});
@dgmike
dgmike / run_selection_as_command.py
Created October 1, 2012 12:53 — forked from karmi/run_selection_as_command.py
Run selection as command in Sublime Text
import os, sublime, sublime_plugin
# Select some text and execute it through bash
#
class RunSelectionAsBashCommand(sublime_plugin.TextCommand):
def run(self, edit):
for region in self.view.sel():
if not region.empty():
# Get the selected text
command = self.view.substr(region)
@dgmike
dgmike / _functions.init.php
Created October 1, 2012 12:53
WordPress Functions: Register theme scripts
/*
Add scripts to the WordPress loader cue
*/
function px_theme_scripts() {
if(!is_admin()) :
$js_path = get_template_directory_uri().'/inc/js/';
wp_deregister_script('jquery');
wp_register_script('jquery', $js_path.'scripts/jquery.latest.js');
wp_enqueue_script('jquery');
@dgmike
dgmike / css-stats-ack.sh
Created October 1, 2012 20:48 — forked from kwaledesign/css-stats-ack.sh
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@dgmike
dgmike / gist:3814312
Created October 1, 2012 20:49 — forked from kalebrozo/gist:3814281
Install Magento 1.7.0.2 With Sample Data By SSH
mkdir demo
cd demo
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
tar -zxvf magento-1.7.0.2.tar.gz
tar -zxvf magento-sample-data-1.6.1.0.tar.gz
mv magento-sample-data-1.6.1.0/media/* magento/media/
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
mv magento/* magento/.htaccess .
chmod o+w var var/.htaccess app/etc