Skip to content

Instantly share code, notes, and snippets.

@tonythere
tonythere / Linux Static IP
Last active August 4, 2016 07:51 — forked from fernandoaleman/Linux Static IP
Linux Static IP
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@tonythere
tonythere / Boxfile
Created August 10, 2013 14:25
Demo Boxfile (Pagoda config file)
web1:
shared_writable_dirs:
- app/storage/
document_root: public
php_upload_max_filesize: "8M"
php_version: 5.4.14
php_extensions:
- apc
- pdo_mysql
- mcrypt
@tonythere
tonythere / genymotionwithplay.txt
Last active August 4, 2016 07:52 — forked from wbroek/genymotionwithplay.txt
genymotionwithgoogleplay
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 4.4 (http://goo.gl/TVcd93)
Google Apps for Android 4.3 (http://goo.im/gapps/gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (http://goo.im/gapps/gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (http://goo.im/gapps/gapps-jb-20121011-signed.zip)
@tonythere
tonythere / MainActivity.java
Created July 15, 2014 02:12
Draw number to marker (Google Map for Android)
package asia.idoo.trygmap2;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.*;
import android.location.Location;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
@tonythere
tonythere / stuns
Last active August 29, 2015 14:10 — forked from yetithefoot/stuns
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
<?php
/**
* @param String $url
* @return object
*/
function get_yt_info($url)
{
$id = get_yt_id($url);
if (is_null($id)) {
return Response::json(['error' => 'Link không hợp lệ!']);
$(window).load(function () {
$('.ads-close').show();
$('.ads-close2').hide();
$('.ads-fly').fadeIn(400);
});
sudo apt-get install libxi-dev libxmu-dev
# go to your genymotion directory
mkdir QtLibs && mv *Qt*.so* QtLibs
@tonythere
tonythere / redis-cheatsheet
Last active August 4, 2016 07:59
Redis cheatsheet
# Remove keys by prefix
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 prefix:*
redis-cli KEYS "prefix:*" | xargs redis-cli DEL
  • Go to File -> Settings -> PHP -> PHPUNIT.
  • Select Use custom loader and then enter the autoload.php file from your projects vendor directory. This autoloader will autoload all the dependencies managed by Composer (including PHPUnit).
  • Specify the default configuration file (this is usually phpunit.xml.dist from your project's app directory). image 1

@aderuwe's answer works but that config isn't scoped per project, it's for all projects. Since PHPStorm 6 (actually even EAP version PS-126.260) you can do the following:

Go to File -> Settings -> PHP -> PHPUNIT. Select Use custom loader and then enter the autoload.php file from your projects vendor directory. This autoloader will autoload all the dependencies managed by Composer (including PHPUnit).