Skip to content

Instantly share code, notes, and snippets.

View prestarocket's full-sized avatar

Adonis Karavokyros prestarocket

View GitHub Profile
@prestarocket
prestarocket / .gitignore
Created July 7, 2011 15:53 — forked from micahwalter/.gitignore
wordpress .gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@prestarocket
prestarocket / prestashop gitignore
Created July 8, 2011 00:43
Prestashop gitignore
# This is a template .gitignore file for git-managed Prestashop projects. Inspired by micahwalter wordpress gitignore
#Ignore ds_store
*.DS_Store
# Ignore everything in the root except modules, themes and override.
/*
!modules/
!themes/
@prestarocket
prestarocket / wordpress-last-class.php
Created July 11, 2011 08:57
wordpress : add last class to menu item
/* Add last_item class to last li in wp_nav_menu lists*/
function add_last_item_class($strHTML) {
$intPos = strripos($strHTML,'menu-item');
printf("%s last_item %s",
substr($strHTML,0,$intPos),
substr($strHTML,$intPos,strlen($strHTML))
);
}
add_filter('wp_nav_menu','add_last_item_class');
@prestarocket
prestarocket / normalized.html
Created January 19, 2012 11:11 — forked from scottkellum/normalized.html
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
@prestarocket
prestarocket / snippet.js
Created March 8, 2012 23:13 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@prestarocket
prestarocket / prestashop-blank-module.php
Created March 9, 2012 14:50
Prestashop : base module
<?php
/*
www.prestarocket.com
Twitter : @prestarocket
*/
if ( !defined( '_PS_VERSION_' ) )
exit;
class MyModule extends Module
{
public function __construct()
@prestarocket
prestarocket / bootstrap_buttons.less
Created April 9, 2012 09:27 — forked from charliepark/bootstrap_buttons.less
A Less Implementation of the Bootstrap Buttons Generator
.customButton(@cHue: 201, @cSaturation: 1, @cLightness: .4, @cDelta: .1, @cMultiplier: 1.5) {
.cTextColor(@a, @b) when (@a < .5) { color: #fff; .cAlphaShadow(0, -1, 1, 0, (@b * 3.3)); }
.cTextColor(@a, @b) when (@a > .5) { color: #333; .cAlphaShadow(0, 1, 1, 255, (@b * 3.3)); }
.cTextColor(@a) { -webkit-font-smoothing: antialiased; }
.cAlphaShadow(@a, @b, @c, @d, @e) when (@e > 1) { text-shadow: (0px + @a) (0px + @b) (0px + @c) rgba(@d, @d, @d, 1); }
.cAlphaShadow(@a, @b, @c, @d, @e) when (@e < 1) { text-shadow: (0px + @a) (0px + @b) (0px + @c) rgba(@d, @d, @d, @e); }
@cHighlight: percentage(@cLightness + @cDelta);
@cLowlight: percentage(@cLightness - @cDelta);
@cSuperLowLight: percentage(@cLightness - @cDelta * @cMultiplier);
@prestarocket
prestarocket / metabox
Created April 11, 2012 17:08 — forked from shawnsandy/metabox
meta-box
<?php /**
* *****************************************************************************
* Add Metaboxes
* *****************************************************************************
*/
//add_action( 'add_meta_boxes', 'cwpt_custom_metaboxes' );
function cwpt_custom_metaboxes(){
add_meta_box('cwpt_preview', 'Site Preview', 'cwpt_preview_box', 'cwp_custom_options', 'normal', 'high');
@prestarocket
prestarocket / prestashop-product-override-attribut
Created June 4, 2012 14:08
Prestashop : override product for order groupe attribut by name and not by public name
<?php
class Product extends ProductCore {
public function getAttributesGroups($id_lang)
{
return Db::getInstance()->ExecuteS('
SELECT ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name, a.`id_attribute`, al.`name` AS attribute_name,
a.`color` AS attribute_color, pa.*
FROM `'._DB_PREFIX_.'product_attribute` pa
@prestarocket
prestarocket / blockcms.tpl
Created June 5, 2012 04:59
prestashop : nofollow blockcms
<!-- MODULE Block footer -->
<div class="block_various_links" id="block_various_links_footer">
<h4>{l s='Informations' mod='blockcms'}</h4>
<ul>
{foreach from=$cmslinks item=cmslink}
{if $cmslink.meta_title != ''}
<li class="item"><a href="{$cmslink.link|addslashes}" title="{$cmslink.meta_title|escape:'htmlall':'UTF-8'}" rel="nofollow">{$cmslink.meta_title|escape:'htmlall':'UTF-8'}</a></li>
{/if}
{/foreach}
<!-- <li class="last_item">{l s='Powered by' mod='blockcms'} <a href="http://www.prestashop.com" rel="nofollow">PrestaShop</a>&trade;</li> -->