This file contains 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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int potencia(int base, int exp); | |
int main(int argc, char *argv[]) | |
{ | |
This file contains 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
#include <cstdlib> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int pos[2] = {1,1}; | |
while (pos[0] != 8 || pos[1] != 8) { |
This file contains 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
__author__ = 'hormiga' | |
rango = [10,11] | |
verdulerias = [ | |
[0,3], | |
[2,3], | |
[1,8], | |
[7,9], | |
[7,1], |
This file contains 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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int m[5][5] = { | |
{1,2,3,4,5}, | |
{6,7,8,9,10}, |
This file contains 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
mysql -u username -p database_name < file.sql |
This file contains 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
function time_elapsed_string($datetime, $full = false) { | |
$now = new \DateTime; | |
$ago = $datetime; | |
$diff = (array) $now->diff($ago); | |
$diff['w'] = floor($diff['d'] / 7); | |
$diff['d'] -= $diff['w'] * 7; | |
$string = array( | |
'y' => 'año', |
This file contains 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
function slugify($text) | |
{ | |
// replace non letter or digits by - | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
// trim | |
$text = trim($text, '-'); | |
// transliterate | |
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); |
This file contains 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
{% for label, flashes in app.session.flashbag.all %} | |
{% for flash in flashes %} | |
<div class="alert alert-{{ label }}"> | |
{{ flash }} | |
</div> | |
{% endfor %} | |
{% endfor %} |
This file contains 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
/** | |
* @param $value | |
* @param string $param | |
* @return string | |
*/ | |
public function appendParam($param, $value) | |
{ | |
$url = $this->request->getUri(); | |
$queryString = parse_url($url, PHP_URL_QUERY); | |
$params = []; |
This file contains 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 | |
class User | |
{ | |
/** | |
* @var string | |
*/ | |
private $name; |