Skip to content

Instantly share code, notes, and snippets.

View danilostrazzullo's full-sized avatar

Danilo Strazzullo danilostrazzullo

View GitHub Profile
@danilostrazzullo
danilostrazzullo / README.md
Created January 25, 2013 09:15 — forked from zenorocha/README.md
README.md Template

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

// RETINA MEDIA QUERY
// '@include background-image-retina('foobar', 'png', 10px, 20px);'
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@danilostrazzullo
danilostrazzullo / momentum-scrolling
Created March 24, 2015 11:09
Momentum Scrolling
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
@danilostrazzullo
danilostrazzullo / install.sh
Last active April 13, 2016 09:07 — forked from JeffreyWay/install.sh
Super-fast LAMP + 5.5 install script.
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
@danilostrazzullo
danilostrazzullo / Vagrantfile
Created April 13, 2016 09:09 — forked from JeffreyWay/Vagrantfile
Quickie vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
@danilostrazzullo
danilostrazzullo / import-dump.sh
Created May 4, 2016 14:02
Import a large sql dump file to a MySQL database from command line
#!/bin/sh
# Import a large sql dump file to a MySQL database from command line
# https://cmanios.wordpress.com/2013/03/19/import-a-large-sql-dump-file-to-a-mysql-database-from-command-line/
# store start date to a variable
imeron=`date`
echo "Import starting..."
dumpfile="/path/to/dumpfile.sql"
@danilostrazzullo
danilostrazzullo / namespace_remove_inherited_sidebars.php
Last active July 27, 2016 15:01
Remove Custom Sidebars inheritance for child pages [ if you improve this solution, please, let me know :) ]
<?php
/**
* Remove Custom Sidebars inheritance for child pages
*
* The issue is described at the following link
* @link https://wordpress.org/support/topic/option-to-remove-inheritance
*/
function namespace_remove_inherited_sidebars( $replacements ) {
global $post;
@danilostrazzullo
danilostrazzullo / wp-autopopulate-taxonomy
Created November 18, 2016 17:13 — forked from brenna/wp-autopopulate-taxonomy
WordPress function to auto-populate a taxonomy with a custom post type's entries.
function custom_tax_init(){
//set some options for our new custom taxonomy
$args = array(
'label' => __( 'My Custom Taxonomy' ),
'hierarchical' => true,
'capabilities' => array(
// allow anyone editing posts to assign terms
'assign_terms' => 'edit_posts',
/* but you probably don't want anyone