This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
trait Memorize | |
{ | |
/** | |
* @var array [method][parameters] | |
*/ | |
private $memorizedResults = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
# PATH TO YOUR HOSTS FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://my-site.com/wp-json/pandora/avatar | |
function my_func() | |
{ | |
register_rest_route( 'pandora', '/avatar', array( | |
'methods' => \WP_REST_Server::READABLE, | |
'callback' => 'my_call', | |
) | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var io = require('socket.io-client'); | |
var nano = require('nano')('http://localhost:5984'); | |
var server = 'http://localhost:8080'; | |
module.exports = { | |
setUp: function (callback) { | |
this.socket = io.connect(server, {'reconnect': false, 'force new connection': true}); | |
callback(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function drawCalendar($year = null){ | |
$cal = ''; | |
$month_name = array('','Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'); | |
if($year == null) | |
$year = date('Y'); |