Skip to content

Instantly share code, notes, and snippets.

View wesleyvicthor's full-sized avatar

wmsan wesleyvicthor

View GitHub Profile
@wesleyvicthor
wesleyvicthor / svgfixer.js
Created June 16, 2016 18:12 — forked from leonderijke/svgfixer.js
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html
@wesleyvicthor
wesleyvicthor / easypaginate.js
Created February 7, 2013 14:06
a simple refactoring.
/*
* Easy Paginate 1.0 - jQuery plugin
* written by Alen Grakalic
* http://cssglobe.com/
*
* Copyright (c) 2011 Alen Grakalic (http://cssglobe.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built for jQuery library
@wesleyvicthor
wesleyvicthor / oauthapi.php
Created January 22, 2013 16:59
a simple oauth client api.
<?php
$router->oauth('secret', 'key')->handle('access_token_uri', function ($token) {
// do whatever you want with your token.
});
@wesleyvicthor
wesleyvicthor / Daily PHP Function.md
Created January 14, 2013 23:20
Daily PHP Function

Daily PHP Function

Daily PHP function tem como objetivo diariamente fornecer uma explicação sobre qualquer função do php.

Qualquer um pode contribuir enviando um gist post para @dailyphpfunc, ou forkando os gist posts e atribuindo mais de sua experiencia sobre uma determinada função.

@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

@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 / ;)
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 / 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 / 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 / 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);