Skip to content

Instantly share code, notes, and snippets.

View dannycroft's full-sized avatar

Danny Croft dannycroft

View GitHub Profile
@dannycroft
dannycroft / Default.php
Created April 12, 2011 13:25
FIX - Magento Enterprise 1.9.0.0 redirects to home page instead of the 404 page
<?php
/**
* Magento Enterprise Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition License
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magentocommerce.com/license/enterprise-edition
@dannycroft
dannycroft / Order Reset - Magento v1.9.0.0
Created April 13, 2011 08:13
Magento Enterprise 1.9.0.0 - Cleans out all the orders that may have accumulated during the development process
TRUNCATE TABLE sales_flat_order;
TRUNCATE TABLE sales_order_tax;
TRUNCATE TABLE downloadable_link_purchased;
DELETE FROM eav_entity_store WHERE entity_type_id IN (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code IN ('order', 'invoice', 'creditmemo', 'shipment'));
@dannycroft
dannycroft / sample.toggle.test.js
Created April 13, 2011 20:46
Was asked to toggle some stuff without a framework
var init = {
accordion: function(){
// Grab next (not null) element
function next(elem) {
do {
elem = elem.nextSibling;
} while (elem && elem.nodeType != 1);
return elem;
@dannycroft
dannycroft / README
Created July 25, 2011 10:39 — forked from vangberg/README
Deploying a Sinatra app to Heroku
# Deploying a Sinatra app to Heroku
## Database
The location of the database Heroku provides can be found in the environment
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example
on how to use this.
## Server
Heroku is serving your apps with thin, with means you have all your thin goodness available,
such as EventMachine.
@dannycroft
dannycroft / gist:1319420
Created October 27, 2011 12:26
Asynchronous Twitter Tweet Button
<script type="text/javascript">
(function() {
var t = document.createElement("script");
t.type = "text/javascript";
t.src = "//platform.twitter.com/widgets.js";
t.async = true;
document.getElementsByTagName('head')[0].appendChild(t);
})();
</script>
<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a>
@dannycroft
dannycroft / gist:1431146
Created December 4, 2011 20:11
Basic Console Log
<script type="text/javascript">
console.log("Now this is debugging in style!");
</script>
<script type="text/javascript">
var foo = 10;
var bar = 16;
var total = foo + bar;
console.log(total);
</script>
<script type="text/javascript">
var foo = 10;
var bar = 16;
var total = foo + bar;
console.log(total);
console.debug(total);
console.info(total);
console.warn(total);
console.error(total);
</script>
<script type="text/javascript">
var foo = 10;
var bar = 16;
var total = foo + bar;
console.log("If I add %d to %d I get %d", foo, bar, total);
console.debug("If I add %d to %d I get %d", foo, bar, total);
console.info("If I add %d to %d I get %d", foo, bar, total);
console.warn("If I add %d to %d I get %d", foo, bar, total);
console.error("If I add %d to %d I get %d", foo, bar, total);
</script>
window.loadFirebugConsole();