Skip to content

Instantly share code, notes, and snippets.

@ruzzbot
ruzzbot / index-mobile.html
Created July 31, 2012 03:05
HTML Template for mobile web apps [iOS,HTML5,HTML,Mobile,Template]
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{app_title}}</title>
<!-- Mobile viewport optimization h5bp.com/ad -->
<meta name="HandheldFriendly" content="True">
@GreatPotato
GreatPotato / gist:3225912
Created August 1, 2012 11:18
Set shipping method automatically in LemonStand
<?php
$default_method = Shop_ShippingOption::find_by_api_code('default');
Shop_CheckoutData::set_shipping_method($default_method->id);
?>
@EHLOVader
EHLOVader / page_clearcache.php
Created August 23, 2012 03:15
Lemonstand Clear cache folder
<?php
if(!Phpr::$security->getUser())
{
Phpr::$response->redirect(root_url('/'));
}else
{
$cache = Phpr::$config->get('CACHING',array());
if(isset($cache['PARAMS']) && isset($cache['PARAMS']['CACHE_DIR']))
@GreatPotato
GreatPotato / ls_top_products
Last active July 3, 2017 15:58
Gets the 50 top selling products that cost over 15.00
SELECT t3.name, t3.sku, t3.price, count(t1.shop_product_id) AS "Number of orders"
FROM shop_order_items t1
LEFT JOIN shop_orders t2
ON t1.shop_order_id = t2.id
LEFT JOIN shop_products t3
ON t1.shop_product_id = t3.id
WHERE t2.payment_processed != ''
@EHLOVader
EHLOVader / RFCEmail.md
Last active April 13, 2023 02:31
Like Grammar Nazis I have run into misguided attempts to validate or use emails in applications enough that I put together this standard RFC email speech that i give to websites which fail on gmail plus notation email formats. Normally nothing changes, but maybe one day they will forward it to the right people and they will fix it.

I would like to note that your website restricts and disallows absolutely valid email addresses, in particular mine. I respectfully request that you update your sites email checks to allow valid email addresses which may not be particularly regular, but are absolutely valid.

I have included the requirements for email addresses along with their standards reference in RFC definitions.

  1. An e-mail address consists of local part and domain separated by an at sign (@) character (RFC 2822 3.4.1).

  2. The local part may consist of alphabetic and numeric characters, and the following characters: !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } and ~, possibly with dot separators (.), inside, but not at the start, end or next to another dot separator (RFC2822 3.2.4).

  3. The local part may consist of a quoted string—that is, anything within quotes ("), including spaces (RFC 2822 3.2.5).

@rentzsch
rentzsch / setup github issues labels.sh
Last active June 23, 2025 21:31
Shell script to set up a GitHub Project's Issues' Labels as described in <http://rentzsch.tumblr.com/post/252878320/my-lighthouse-ticket-settings-with-colors>. WARNING: script assumes a newish project that hasn't really used labels yet. It deletes all default labels, which means DATA LOSS if you've used them for anything.
USER=rentzsch
PASS=mypassword
REPO=mogenerator
# Delete default labels
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/bug"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/duplicate"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/enhancement"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/invalid"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/question"
http://www.my-lemonstand-site.com/?show_page_structure
@GreatPotato
GreatPotato / gist:5445303
Last active July 27, 2016 11:00
Gets the security details of a LS installation (including encryption key)
<?php
print_r( Phpr_SecurityFramework::create()->get_config_content() );
?>
@GreatPotato
GreatPotato / gist:5460059
Last active December 16, 2015 15:59
Shows the LS loading indicator
window.Phpr.showLoadingIndicator({
loadIndicator: {
overlayClass: 'ajax_loading_indicator',
zIndex: 9999,
html: '<span>Loading...</span>'
}
});
<?php
public function subscribeEvents() {
Backend::$events->addEvent('shop:onExtendProductModel', $this, 'extend_product_model');
Backend::$events->addEvent('shop:onExtendProductForm', $this, 'extend_product_form');
Backend::$events->addEvent('shop:onOverrideProductCsvExportColumns', $this, 'set_product_csv_export_columns');
Backend::$events->addEvent('shop:onOverrideProductCsvImportData', $this, 'set_product_csv_import_data');
}