Skip to content

Instantly share code, notes, and snippets.

/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns('Ext.ux.form');
/**
* @class Ext.ux.form.FileUploadField
grep -ohP 'public.*function\s*\K.*' file.php
#!/bin/bash
for ((;;)) do psql kangaroo postgresql -1 -t -c "SELECT now() as at_date, client_addr, substring(regexp_replace(trim(current_query), E'\r|\n', '', 'g'),0,100) as query, count(*) as qtd, case when count(*) > 50 then 'CRITICAL' else '' END as level FROM pg_locks pl LEFT JOIN pg_stat_activity psa ON pl.pid = psa.procpid where client_port > 0 group by client_addr, substring(regexp_replace(trim(current_query), E'\r|\n', '', 'g'),0,100)" >> /tmp/log_lock.log; sleep 1m; done;
@wagnerpinheiro
wagnerpinheiro / request.xml
Created April 27, 2016 17:44 — forked from aminin/request.xml
PHP SoapServer ignores invalid enum value
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test-service-namespace">
<SOAP-ENV:Body>
<ns1:TestOperation>
<ns1:firstArgument>
<!-- Wrong enum -->
<ns1:timeGroup>FooBar</ns1:timeGroup>
<!-- Good enum -->
<ns1:customerType>CHILD</ns1:customerType>
</ns1:firstArgument>
@wagnerpinheiro
wagnerpinheiro / xdebug.php.ini
Created April 25, 2016 16:36 — forked from larsvegas/xdebug.php.ini
xdebug php.ini default config
xdebug.auto_trace=1
;;Type: boolean, Default value: 0
;;When this setting is set to on, the tracing of function calls will be enabled just before the script is run. This makes it possible to trace code in the auto_prepend_file.
xdebug.cli_color=1
;;Type: integer, Default value: 0, Introduced in Xdebug 2.2
;;If this setting is 1, Xdebug will color var_dumps and stack traces output when in CLI mode and when the output is a tty. On Windows, the ANSICON tool needs to be installed.
;;If the setting is 2, then Xdebug will always color var_dumps and stack trace, no matter whether it's connected to a tty or whether ANSICON is installed. In this case, you might end up seeing escape codes.
;xdebug.collect_assignments=0

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
#Based on https://cwiki.apache.org/confluence/display/DRILL/Compiling+Drill+from+source
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum install apache-maven
ln -s /usr/share/apache-maven/bin/mvn /usr/bin/
yum install java-1.7.0-openjdk.x86_64
yum install java-1.7.0-openjdk-devel
@wagnerpinheiro
wagnerpinheiro / extract-methods-perl-module.bash
Last active August 29, 2015 14:04
extract methods from perl modules
#!/bin/bash
# extract methods from perl modules
# author: Wagner Pinheiro
# public
grep "^sub .*.{" *
grep -h "^sub .*.{" * | sed 's/^sub /+/g' | sed 's/ {//g' | sed 's/{//g' | sed 's/\+\_/\-\_/g' | sort
# private
grep "^my .*.{" *
grep -h "^my .*.{" * | sed 's/^my /-/g' | sed 's/ \= sub {//g'
@wagnerpinheiro
wagnerpinheiro / backup_mysql_users.sh
Created April 10, 2014 13:47
backup mysql users
mysql -BNe "select concat('\'',user,'\'@\'',host,'\'') from mysql.user where user != 'root'" | \
while read uh; do mysql -BNe "show grants for $uh" | sed 's/$/;/; s/\\\\/\\/g'; done > grants.sql