Skip to content

Instantly share code, notes, and snippets.

View robbanl's full-sized avatar

Robert robbanl

  • Codepeak AB
  • Sweden
View GitHub Profile
@ptz0n
ptz0n / gist:1217080
Created September 14, 2011 16:51
Validate JSONP Callback
<?php
/**
* Validate JSONP Callback
*
* https://github.com/tav/scripts/blob/master/validate_jsonp.py
* https://github.com/talis/jsonp-validator/blob/master/src/main/java/com/talis/jsonp/JsonpCallbackValidator.java
* http://tav.espians.com/sanitising-jsonp-callback-identifiers-for-security.html
* http://news.ycombinator.com/item?id=809291
*
@dajoho
dajoho / phpcs
Created October 4, 2012 11:39
Install PHPCS OSX
sudo cp /private/etc/php.ini.default /private/etc/php.ini;
sudo php /usr/lib/php/install-pear-nozlib.phar;
pear config-set php_ini /private/etc/php.ini;
pecl config-set php_ini /private/etc/php.ini;
sudo pear upgrade-all;
sudo pear install PHP_CodeSniffer;
----
nano /private/etc/php.ini;
include_path Zeile einkommentieren & umändern in:
#!/bin/bash
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password
# Updated to work with Vagrant 1.3.x
# Stage updated sudoers in a temporary file for syntax checking
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
@fbrnc
fbrnc / gist:7645313
Last active January 10, 2019 12:54
Reset Magento EE changelogs
truncate catalog_product_flat_cl;
truncate catalog_category_product_index_cl;
truncate catalog_category_product_cat_cl;
truncate catalog_category_flat_cl;
truncate catalogsearch_fulltext_cl;
truncate cataloginventory_stock_status_cl;
truncate catalog_product_flat_cl;
truncate catalog_product_index_price_cl;
truncate enterprise_url_rewrite_category_cl;
truncate enterprise_url_rewrite_product_cl;
@robbanl
robbanl / dex.sh
Last active April 6, 2018 06:17
Quick Docker Exec to bash
#!/bin/sh
# Feel free to create a bash alias to this file or place it in /usr/local/bin
#
# Usage: dex php to run "bash" in interactive mode on any container that contains php in it's name
CONTAINER="$(docker ps -f name=$1 | sed -n 2p)"
CONTAINER_NAME=`echo $CONTAINER | awk '{ print $NF }'`
# Make sure some argument is set