Skip to content

Instantly share code, notes, and snippets.

View pietromalerba's full-sized avatar

Pietro Malerba pietromalerba

  • M3
  • Civitanova Marche (MC) - Italy
View GitHub Profile
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# 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
<?php
/*
Plugin Name: Listing Content Item
Plugin URI:
Description:
Author:
Version: 1.0
Author URI:
*/
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@leibovic
leibovic / iconscrape.py
Created July 26, 2011 18:51
A script to look for icons specified in link tags with rel="icon" and the sizes attribute, or with rel="apple-touch-icon"
#! /usr/bin/env python
import csv
import urllib2
import sgmllib
class LinkParser(sgmllib.SGMLParser):
def parse(self, s):
self.feed(s)
self.close()
@alanleard
alanleard / gist:1278595
Created October 11, 2011 16:26
PageFlip with Pinch/Zoom
var win = Ti.UI.currentWindow;
Titanium.PageFlip = Ti.PageFlip = require('ti.pageflip');
var pdf = 'http://assets.appcelerator.com.s3.amazonaws.com/docs/Appcelerator-IDC-Q1-2011-Mobile-Developer-Report.pdf';
var fileName = pdf.split('/').pop();
var pdfFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, fileName);
function downloadPDF() {
var progressBar = Ti.UI.createProgressBar({ max: 1, min: 0, value: 0, visible: true });
win.add(progressBar);
@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()
@gpassarelli
gpassarelli / gist:2134851
Created March 20, 2012 12:42
CSS: File Type Icon
a[href^="http:"] {
display:inline-block;
padding-right:14px;
background:transparent url(/Images/ExternalLink.gif) center right no-repeat;
}
a[href^="mailto:"] {
display:inline-block;
padding-left:20px;
line-height:18px;
background:transparent url(/Images/MailTo.gif) center left no-repeat;
@manastungare
manastungare / css-compress.php
Created May 7, 2012 00:23
On-the-fly CSS Compression
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
*
@trey
trey / happy_git_on_osx.md
Last active September 19, 2024 16:23
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "[email protected]"

@ekka21
ekka21 / gist:3018426
Created June 29, 2012 14:52
Wordpress: Using wordpress call Ajax the right way
jQuery.ajax({
url: '/wp-admin/admin-ajax.php',
type: 'GET',//POST, JSON, XML
dataType: 'html',
data: ({
action: 'MY_AJAX_FUNCTION',
state: state,
}),
success: function(data){
if (data){