Skip to content

Instantly share code, notes, and snippets.

@lucalbert
lucalbert / sass-convert.sh
Last active October 29, 2018 09:48
Mass beautifier sass files
sass-convert -F scss -T scss -i -R --indent 2 -E UTF-8 --unix-newlines ./sass
@lucalbert
lucalbert / apache-php7-fpm.example.conf
Last active December 6, 2016 10:47
Apache Vhost example config for use PHP7-FPM
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.tld
ServerAlias www.example.tld
<FilesMatch \.php$>
SetHandler proxy:unix:/run/php/php7.0-fpm.sock|fcgi://127.0.0.1:9001
</FilesMatch>
DocumentRoot /var/www/html/
@lucalbert
lucalbert / git_specific_commit_date.sh
Created October 17, 2016 09:34
Modify git commit date
$ export GIT_AUTHOR_DATE="2011-10-19T06:28:12+01:00" && export GIT_COMMITTER_DATE="2011-10-19T06:28:12+01:00"
$ git commit
@lucalbert
lucalbert / gitignore_global.txt
Last active July 11, 2023 11:45
Default global gitignore
# Ignore thumbnails created by windows
Thumbs.db
# Ignore Mac
.DS_Store
# Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
@lucalbert
lucalbert / isIndexedArray.php
Last active July 1, 2016 14:54
Test if an array is a real indexed array.
<?php
function isIndexedArray(array $array)
{
// keys are strings : associative array
if ((bool) count(array_filter(array_keys($array), 'is_string'))) {
return false;
}
// Create normal index and compare
$indexes = \array_keys(\array_fill(0, count($array), null));
@lucalbert
lucalbert / magentoDeleteNonSystemProductAttribute.php
Last active July 1, 2016 14:56
Snippet to delete non system product attributes for Magento 1.x
<?php
require 'app/Mage.php';
Mage::app();
$attributes = Mage::getResourceModel('eav/entity_attribute_collection');
$attributes->addFieldToFilter('entity_type_id', 4);
$attributes->addFieldToFilter('is_user_defined', 1);
foreach ($attributes as $attribute) {
try {