Skip to content

Instantly share code, notes, and snippets.

View brutuscat's full-sized avatar

Mauro Asprea brutuscat

View GitHub Profile
@brutuscat
brutuscat / gist:5858480
Last active December 18, 2015 22:59
Codeception #waitForAjax helper method
<?php
public function waitForAjax() {
$timeoutMicroSeconds = 2000000;
$isAjaxActive = '
var isAngularAjaxActive = false;
try {
var http = angular.element(".ng-scope").injector().get("$http");
isAngularAjaxActive = !!(http.pendingRequests.length);
}
@brutuscat
brutuscat / cantor.php
Created July 11, 2013 18:30
PHP Cantor implementation using BCMath extension
<?php
# Need Composer with PHPUnit
require 'vendor/autoload.php';
function cantor($x, $y)
{
// ((x + y) * (x + y + 1)) / 2 + y;
return bcadd(bcdiv(bcmul(bcadd($x, $y), bcadd(bcadd($x, $y), 1)), 2), $y);
}
@brutuscat
brutuscat / README.md
Last active December 31, 2015 10:39
Codeception auto tests setup using ruby's Guard

Codeception auto tests setup using ruby's Guard

Instructions

  • Drop the Gemfile and the Guardfile in your project
  • Run bundle install
  • Run bundle exec guard
@brutuscat
brutuscat / README.md
Created December 16, 2013 17:38
focus-on directive that will listen $on the event emitted and will focus the element when event is triggered

Example usage:

In a template:

<element focus-on="modelUpdated">
</element>

In a controller:

@brutuscat
brutuscat / README.md
Last active January 1, 2016 15:19
Instructions and patch to compile MAME 0.151 in OSX using Homebrew
@brutuscat
brutuscat / README.md
Last active January 1, 2016 22:19
[SOLVED] How to solve Maverick's beach ball of death recurrent issues?

Solving OSX Maverick's beach ball of death issues

  • Make sure you re-enable Trim support in your SSD
  • Disable memory compression mechanisms:
sudo nvram boot-args="vm_compressor=1"
@brutuscat
brutuscat / 1 - Calendario Laboral de España.md
Last active January 2, 2016 01:09
[Festivos 2014] Calendario Laboral de España

[2014] Calendario Laboral de España

El calendario laboral de 2014 recoge un total de nueve fiestas nacionales comunes a todas las comunidades autónomas, según se aprobó en Noviembre del 2013 por la Dirección General de Empleo.

En total, en España suele haber diez festivos nacionales, dos de las comunidades autónomas y dos fiestas locales.

En concreto, las nueve fiestas nacionales son el 1 de enero (Año Nuevo), el 6 de enero (Epifanía del Señor), el 18 de abril (Viernes Santo), el 1 de mayo (Fiesta del Trabajo), el 15 de agosto (Asunción de la Virgen), el 1 de noviembre (Día de Todos los Santos), el 6 de diciembre (Día de la Constitución española), el 8 de diciembre (La Inmaculada Concepción) y el 25 de diciembre (Natividad del Señor).

Introduction
The mobile games industry is a multi-billion dollar industry - mobile gaming is
big business and is set to continue growing at an alarming rate. Smart phone
and tablet market penetration is increasing exponentially, with over one billion
units sold worldwide in 2013 alone. The power of mobile gaming devices is
increasing just as fast: mobile processing power has developed to the extent
that smartphones and tablets can produce near console-quality graphics.
At the same time, digital marketplaces have become crowded, and the cost of
raising your head above the parapet through user acquisition has never been
higher. The mobile games industry is under increasing pressure to perform,
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
else
c_reset=
@brutuscat
brutuscat / 99java
Last active August 29, 2015 14:02 — forked from dz0ny/99java
## Setup java
if [ `uname -m` == 'x86_64' ]; then
PATH="/usr/lib64/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib64/jvm/java-7-oracle/"
else
PATH="/usr/lib/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
fi