Skip to content

Instantly share code, notes, and snippets.

View phcostabh's full-sized avatar
🧑‍💻
Coding

Philippe Santana Costa phcostabh

🧑‍💻
Coding
View GitHub Profile
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<edit mode="assign" name="autohint" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="rgba" >
this.$suggest = $('div.p-suggest');
var navigateSuggestions = function(direction) {
var $active = this.$suggest.find('.active'),
listLenght = this.$suggest.find('ul > li').length,
index;
if ($active.length > 0) {
index = (direction === 38) ? $active.index() - 1 : $active.index() + 1;
console.log(index, listLenght);
<?php
date_default_timezone_set('America/Sao_Paulo');
error_reporting(E_ALL);
ini_set('display_errors', '1');
function microtimestamp()
{
$timeofday = gettimeofday();
return $timeofday['sec'] + $timeofday['usec'] / 1000000;
#! /bin/bash
sed -r 's,^-.*$,<li>&</li>,' $1 |\
sed '/^[0-9].*:$/,/;</ {
s,:$,&\n<ul>,;
s,;</li>,&\n</ul>,;
b
}' |\
sed 's,[0-9]\.[0-9]\..*,<li>&</li>,' |\
sed '1s,^[A-Z].*,<li>\n<b>&</b>\n<ul>,; s,^$,</ul>\n<li>,; s,^[A-Z].*,<b>&</b>\n<ul>,';
#!/bin/bash
# Colors from http://wiki.archlinux.org/index.php/Color_Bash_Prompt
# misc
NO_COLOR='\e[0m' #disable any colors
# regular colors
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
<?php
namespace Functional;
use PHPUnit_Framework_TestCase;
/**
* Helper to testing RESTful Requests with PHPUnit.
*
* @uses PHPUnit_Framework_TestCase
* @abstract
src = "#{ARGV[1]}.*.php"
tests = src.gsub("src/", "tests/Unit/")
watch(src) do |match|
match[0].gsub!("src/", "")
run_test %{tests/Unit/#{match[0]}}
end
watch(tests) do |match|
run_test match[0]
#! /bin/bash
function authme {
ssh $1 '[ ! -e ~/.ssh/ ] && mkdir ~/.ssh 2>/dev/null; cat >>.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
}
mkdir -p {{0..9},{a..f}}/{{0..9},{a..f}}/{{0..9},{a..f}}/{{0..9},{a..f}}
<?php
/**
*
*/
class FormHelper
{
/**
* Controla os indices de metadados
* @var int