Skip to content

Instantly share code, notes, and snippets.

View acataluddi's full-sized avatar

Adriano C. acataluddi

View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Remove Magento's orphan images web console</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext' rel='stylesheet'
type='text/css'>
<style type="text/css">
@acataluddi
acataluddi / collectionFilter.php
Created August 2, 2017 14:22
Filtros de collection do produto.
<?php
// Get All Products of a category
$collection = Mage::getResourceModel('catalog/product_collection')
->setStoreId($this->getStoreId())
->addCategoryFilter($category);
// In this the addCategoryFilter() function, is used to get all products of a particular category. So, if you want to get all products of a certain category use this function.
// Visibility Filter
$collection = Mage::getResourceModel('catalog/product_collection');
@acataluddi
acataluddi / Apache Tomcat 8 Start stop script init.d script
Created September 27, 2017 20:05 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under
@acataluddi
acataluddi / local.xml
Created February 5, 2018 17:42 — forked from raivis-vitols/local.xml
Magento local.xml layout file boilerplate
<?xml version="1.0"?>
<layout>
<default>
<!--Head Block Modifications For All Pages-->
<reference name="head">
<!-- Add CSS and JS, Files From Skin Folder -->
<action method="addItem"><type>skin_css</type><name>css/styles.css</name></action>
<action method="addItem"><type>skin_js</type><name>js/script.js</name></action>
<!--Remove CSS and JS, Files From Skin Folder-->
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@acataluddi
acataluddi / Android Privacy Policy Template
Created December 8, 2018 13:28 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@acataluddi
acataluddi / User.php
Created February 3, 2019 20:10 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@acataluddi
acataluddi / mysql-drop-all-tables.sh
Created September 18, 2019 21:08 — forked from cweinberger/mysql-drop-all-tables.sh
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
@acataluddi
acataluddi / change_ini_file_preserving_symlinks.yml
Created October 11, 2019 13:00
Modify a symlinked INI file avoiding the Ansible's bug replacing the symlink with a copy of the target file
@acataluddi
acataluddi / git-recover-branch.md
Created February 22, 2020 18:07 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring