Skip to content

Instantly share code, notes, and snippets.

View florinel-chis's full-sized avatar

Florinel Chis florinel-chis

  • Magendoo
  • Bucharest, Romania
View GitHub Profile
@florinel-chis
florinel-chis / Magento-Zend_Db_Statement_Pdo_execute
Created January 17, 2014 17:42
Magento - Zend_Db_Statement_Pdo::_execute - for developers
#Zend_Db_Statement_Pdo::_execute
public function _execute(array $params = null)
{
try {
if ($params !== null) {
return $this->_stmt->execute($params);
} else {
return $this->_stmt->execute();
}
@florinel-chis
florinel-chis / cloudflare-purge.sh
Created October 5, 2013 14:11
purge file on cloudflare
if [ -z "$1" ]; then
echo "Usage: $0 http://your.domain.com/url"
exit 0
fi
#get this from Account section in Cloudflare
TOKEN="YOUR_TOKEN_HERE"
EMAIL="YOUR_EMAIL_HERE"
DOMAIN="YOUR_DOMAIN_HERE"
curl https://www.cloudflare.com/api_json.html \
#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql
@florinel-chis
florinel-chis / casper-test-check-homepage-div
Created August 21, 2013 10:27
Sample CasperJS test to check if a div identified by a class (".col-main") is present.
/**
* Test if a div with the class .col-main is present on homepage
*/
console.log('checking cli options');
var casper_cli = require("casper").create();
if(!casper_cli.cli.options.url){
console.log("--url=domain.com missing");
casper_cli.exit();
}
@florinel-chis
florinel-chis / github-create-pull_request-hook
Last active December 20, 2015 23:29
Shell script to create a pull_request hook (currently you cannot do this using the github interface)
#!/bin/bash
GIT_TOKEN="YOUR_TOKEN_HERE"
GIT_USER="YOUR_USER_HERE"
GIT_REPO="YOUR_REPO_HERE"
curl -X POST -H "Authorization: token $GIT_TOKEN" \
--data '{"name": "web","active": true,"events": ["pull_request"],"config": {"url": "http://your.url.here/"}}' \
https://api.github.com/repos/$GIT_USER/$GIT_REPO/hooks
@florinel-chis
florinel-chis / github-private-repo-patch-file
Created August 8, 2013 15:30
Shell script to retrieve the patch file for a pull request in a private repo on github
#!/bin/bash
usage()
{
cat << EOF
usage: $0 pull_id
pull_id needs to be a number
EOF
}
if [ -z "$1" ]
@florinel-chis
florinel-chis / centos-install-casperjs
Created August 7, 2013 11:21
install casperjs on centos (x64)
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
bunzip2 phantomjs-1.9.1-linux-x86_64.tar.bz2
tar xf phantomjs-1.9.1-linux-x86_64.tar
mv phantomjs-1.9.1-linux-x86_64/ /opt/
ln -s /opt/phantomjs-1.9.1-linux-x86_64/ /opt/phantomjs
ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/
#check what you've just done
which phantomjs
phantomjs --version
@florinel-chis
florinel-chis / oro-crm-install-problem-1
Created May 29, 2013 13:32
oro crm install, problem 1
Problem 1
- symfony/icu v1.2.0-RC1 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/icu v1.2.0-BETA1 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- oro/platform dev-master requires symfony/icu 1.2.*@dev -> satisfiable by symfony/icu[1.2.x-dev, v1.2.0-BETA1, v1.2.0-RC1].
- Installation request for oro/platform dev-master -> satisfiable by oro/platform[dev-master].
@florinel-chis
florinel-chis / vtiger-pre-install
Last active April 2, 2020 14:41
Set required permissions on files and folders in order to install VTiger CRM.
cp htaccess.txt .htaccess
echo "php_value memory_limit 1G" >> .htaccess
echo "php_value error_reporting 512" >> .htaccess
chmod 777 config.inc.php
chmod o+w tabdata.php
chmod o+w install.php
chmod o+w parent_tabdata.php
chmod -R o+w cache/
chmod -R o+w storage/
chmod -R o+w install/
@florinel-chis
florinel-chis / gist:5078251
Created March 3, 2013 20:55
Mage_Catalog_Block_Navigation - improved cache key
//Mage_Catalog_Block_Navigation::
public function getCacheKeyInfo(){
$shortCacheId = array(
'CATALOG_NAVIGATION',
Mage::app()->getStore()->getId(),
Mage::getDesign()->getPackageName(),
Mage::getDesign()->getTheme('template'),
// Mage::getSingleton('customer/session')->getCustomerGroupId(),
'template' => $this->getTemplate(),
'name' => $this->getNameInLayout(),