Skip to content

Instantly share code, notes, and snippets.

@josecelano
josecelano / be2json.c
Created September 11, 2024 09:05 — forked from camilleoudot/be2json.c
Bencode to JSON converter
/* converts Bencoded data on stdin to JSON on stdout */
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int pos = 0;
int c;
char stack[1024], *sp = stack;
@josecelano
josecelano / currency_symbols.php
Created November 16, 2017 09:37 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@josecelano
josecelano / pre-commit
Created February 17, 2016 12:31 — forked from raphaelstolt/pre-commit
A pre-commit for running PHPUnit
#!/usr/bin/php
<?php
printf("%sGit pre-commit hook %1\$s", PHP_EOL);
$projectName = basename(getcwd());
exec('phpunit --configuration phpunit.xml', $output, $returnCode); // Assuming cwd here
if ($returnCode !== 0) {
$minimalTestSummary = array_pop($output);
printf("Test suite for %s failed: ", $projectName);
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL);
return false; // exit(1);
@josecelano
josecelano / setup_selenium.sh
Last active November 9, 2015 16:51 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update