Skip to content

Instantly share code, notes, and snippets.

View wesleyvicthor's full-sized avatar

wmsan wesleyvicthor

View GitHub Profile
@wesleyvicthor
wesleyvicthor / gist:1392036
Created November 24, 2011 19:14
twig array
{% %}
@wesleyvicthor
wesleyvicthor / gist:1392133
Created November 24, 2011 19:43
twig array
{% if cases_list.ProcessInstance is defined %}
{% for case in cases_list.ProcessInstance %}
{% for activity in case.activities.children() %}
<tr>
{% for variable in case.clientVariables.children() %}
{% for data in variable.xpath('string[2]') %}
<td>{{ data }}</td>
{% endfor %}
{% endfor %}
<td><a href="{{ cloud_link_address }}{{ activity.uuid.value }}" target="_blank">{{ activity.name }}</a></td>
{% set value = data.xpath('string[2]') %}
{{ value[0] }}
{{ value.current }}
{{ value.index }}
{{ value.first }}
regex=/^([1-9][1-9] +|\([1-9][1-9]\) *)[1-9]\d{2,4}[ .-]?\d{4}$/;
strings=[
/* Só numéricos com espaços que casam */
'11 9990000',
'11 99990000',
'11 999990000',
'11 999 0000',
'11 9999 0000',
'11 99999 0000',
@wesleyvicthor
wesleyvicthor / twm.php
Created April 5, 2012 20:03
do not do that!
<?php
public function establishConnection()
{
return "function connectToPostgres() {
\$db= '<dbname>';
\$user= '<user>';
\$pwd= '<pwd>';
\$connection = \"host=<host> port=<port> dbname='\$db' user='\$user' password='\$pwd'\";
\$connect = pg_connect(\$connection);
@wesleyvicthor
wesleyvicthor / hosts.erb
Created June 5, 2012 15:34
Template Hosts
<VirtualHost *:80>
ServerName <%= name %>
ServerAlias www.<%= name %>
ServerAlias static.<%= name %>
DocumentRoot /var/www/<%= name %>/web
FileETag none
<Directory />
Options FollowSymLinks
AllowOverride All
@wesleyvicthor
wesleyvicthor / animation.js
Created June 26, 2012 17:54
just a sample code
cardsDistribution: function()
{
var self = this;
nusers = _env.stage.getChildById('main').getChildById('users_node').children.length;
ncards = nusers * 2;
for(var i=0; i<ncards; i++) {
var card = _utils.provider.getImage('images/back-card.png');
@wesleyvicthor
wesleyvicthor / ;)
Created July 6, 2012 17:38 — forked from lfguerreiro/Config .git
.gitconfig
[user]
name = NOME
email = EMAIL
[color]
diff = auto
grep = auto
interactive = auto
status = auto
branch = auto
@wesleyvicthor
wesleyvicthor / gist:3954783
Created October 25, 2012 19:14
javascript latinize
var Latinise={};Latinise.latin_map={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"I","Ǐ":"I","Î":"I","Ï":"I","Ḯ":"I","İ":"I","Ị":"I","Ȉ":"I",
@wesleyvicthor
wesleyvicthor / function_exists.md
Created January 14, 2013 23:13
#001 function_exists

#001 function_exists

function_exists(string $function_name); é utilizada para verificar se uma determinada função existe no programa em execução. É resposável por identificar funções definidas pelo usuário ou nativas do php. Seu valor de retorno é um boolean, true caso a função exista e false caso não.

Considerando construtores da linguagem como include_once, echo, print e outros, caso sejam testados utilizando function_exists terá seu retorno como false