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 | |
namespace App\Repositories; | |
use Doctrine\ORM\EntityRepository; | |
use Doctrine\ORM\Internal\Hydration\IterableResult; | |
class UserRepository extends EntityRepository | |
{ | |
public function getUsersIterable(): IterableResult |
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
# /etc/X11/xorg.conf.d/20-intel.conf | |
Section "Device" | |
Identifier "Intel Graphics" | |
Driver "intel" | |
Option "AccelMethod" "sna" | |
Option "DRI" "3" | |
Option "TearFree" "true" | |
EndSection |
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 _composer | |
{ | |
$composerTmpDir = 'C:\Users\MyUser\.tmp' | |
$path = $pwd -replace "^C:\\", "/c/" -replace "\\", "/" | |
$tmpPath = $composerTmpDir -replace "^C:\\", "/c/" -replace "\\", "/" | |
$composerArgs = $args -join " " | |
$command = "docker run --interactive --user `$(id -u):`$(id -g) --rm -v '$path':/app -v '$tmpPath':/tmp composer $composerArgs" | |
docker-machine ssh default $command | |
} |
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 | |
/** | |
* Multiplica um número pelo resultado da multiplicação anterior. | |
* Exercício proposto pela página "Asolucoesweb" (http://bit.ly/2tS4qj2) | |
* | |
* @var integer $base O número a ser multiplicado | |
* @var integer $iterations O número de vezes a ser interado | |
* @var integer $multiplier O resultado da multiplicação anterior | |
* @var integer $count O quantidade de vezes já iteradas |
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
/** | |
* Range function, similar to python's one. | |
* If you want to use it in for...in loops, all 4 arguments must be passed. | |
* @param {Number} Start - If omited, it defaults to 0. | |
* @param {Number} Stop | |
* @param {Number} Step - If omited, it defaults to 1. | |
* @param {Boolean} Object - If returns an object or not. Mostly used in for...in loops. | |
* @return {Mixed} If Object is true, returns an object, otherwise, returns an array. | |
* | |
* Examples: |
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
/** | |
* Calculates the number of ways of picking k unordered. | |
* @params {Interger} | |
* @return {Interger} | |
*/ | |
function binomial(n, k) { | |
if (k === 0) { | |
return 1; | |
} else if (2*k > n) { |
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
/** | |
* Remove acentos de strings | |
* @param {String} string acentuada | |
* @return {String} string sem acento | |
*/ | |
var map={"â":"a","Â":"A","à":"a","À":"A","á":"a","Á":"A","ã":"a","Ã":"A","ê":"e","Ê":"E","è":"e","È":"E","é":"e","É":"E","î":"i","Î":"I","ì":"i","Ì":"I","í":"i","Í":"I","õ":"o","Õ":"O","ô":"o","Ô":"O","ò":"o","Ò":"O","ó":"o","Ó":"O","ü":"u","Ü":"U","û":"u","Û":"U","ú":"u","Ú":"U","ù":"u","Ù":"U","ç":"c","Ç":"C"}; | |
function removerAcentos(s){ return s.replace(/[\W\[\] ]/g,function(a){return map[a]||a}) }; |