Skip to content

Instantly share code, notes, and snippets.

View avocadoslab's full-sized avatar
🖥️
In relationship with console.log();

Avocados Lab avocadoslab

🖥️
In relationship with console.log();
View GitHub Profile
<html>
<body>
<a class="twitter-timeline" href="https://twitter.com/MASNYC" data-widget-id="635892957095305216">Tweets by @MASNYC</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</body>
</html>
@avocadoslab
avocadoslab / gist:68d778526214072815d3
Created March 17, 2016 21:21
Regex for detecting variations on PO Box
var pobReg = /\bbox(?:\b$|([\s|\-]+)?[0-9]+)|(p[\-\.\s]?o.?[\-\s]?|post office\s)b(\.|ox)?/igm;
/*
Matches:
po box
p.o.b.
pob
p.o. box
po-box
@avocadoslab
avocadoslab / gist:fa67a007a1b6d7e3bee94c9cc09ae344
Created September 19, 2016 20:01
Change order status to complete in magento
require 'app/Mage.php';
Mage::app();
$order = Mage::getModel('sales/order')->loadByIncrementId('2323233');
$order->setData('state', "complete");
$order->setStatus("complete");
$history = $order->addStatusHistoryComment('Order was set to Complete by SomethingDigital on 9/19.', false);
$history->setIsCustomerNotified(false);
$order->save();
print_r("done processing");
@avocadoslab
avocadoslab / magento.md
Created November 7, 2016 17:12 — forked from manojiksula/magento.md
Magento Code Snippet

Common

Magento : Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url

Get Url in phtml files

  1. Get Base Url :
	Mage::getBaseUrl();
@avocadoslab
avocadoslab / gist:179de8ab5b9c7f75acbbbdbd32f0d3e1
Created November 29, 2016 22:12
copy products from one category to other category.
<?php
require_once('app/Mage.php');
umask(0);
Mage::app('admin');
error_reporting(1);
set_time_limit(0);
ini_set('memory_limit', '2048M');
// COPY Products From => To
@avocadoslab
avocadoslab / releaseNotes.js
Created March 23, 2017 15:19 — forked from nadavspi/releaseNotes.js
toddbc's release notes helpers
// All non-merge commits
reg = /^(.+?)(\n|$)/; ' * ' + Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title && title.indexOf('Merge') !== 0).map(title => { var mm = title.match(reg); return mm && mm[1]; }).join("\n * ");
// Only merge commits
reg = /^[^#]+(#[0-9]+)[^\n]+\n\n((?:.|\n)+)$/; Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title.indexOf('Merge') === 0).map(title => { var mm = title.match(reg); return mm && mm[2] + ' (' + mm[1] + ')'; }).join("\n * ");
@avocadoslab
avocadoslab / dataflow-export-timestamp.php
Created May 16, 2017 22:11 — forked from tegansnyder/dataflow-export-timestamp.php
Programmatically running a Magento Dataflow Profile export and appending timestamp to filename
<?php
require_once('app/Mage.php');
umask(0);
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
ini_set('memory_limit', '2048M');
$profile_id = 44;
$profile = Mage::getModel("dataflow/profile")->load($profile_id);
@avocadoslab
avocadoslab / rebaseHelper.md
Created October 27, 2017 14:57
Rebase Helper

This gives little more info than when you do 'git rebase -i'.

  1. Run following command

git log --oneline origin/master..HEAD --format="%h %s %ae" --reverse

Go through each commit # and remove what you don't need.

  1. Run 'git rebase -i' and match result with results from step 1.