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 | |
| /** | |
| * Get array value by path. | |
| * | |
| * @param string|array $path Array Path. | |
| * @param mixed $data Data where search. | |
| * @param mixed|null $default Default value on path not found. | |
| * @return mixed|null Value. | |
| * @see https://stackoverflow.com/a/27930028/717267 |
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 | |
| # https://gist.github.com/reduardo7/00928a0a50bf51f7c9ba218e95eb37c3 | |
| ################# Connect to Mongo DB ################# | |
| # Params: | |
| # - Environment: uat/prod | |
| # - POD Name: Optional. Specific POD. | |
| # | |
| # Examples: |
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 | |
| # https://gist.github.com/reduardo7/c8ce682f7cb02f90168c5bec23fed53e | |
| ################# Get Master Mongo POD ################# | |
| # Params: | |
| # - Environment: uat/prod | |
| # | |
| # Examples: | |
| # ./get-mongo-master.sh prod |
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
| function testUser(t) { | |
| console.info(t, | |
| /^[a-z0-9\.\-_]+$/.test(t) && /^[^\.\-_]+/.test(t) && /[^\.\-_]+$/.test(t) && !/[\.\-_]{2,}/.test(t), | |
| /^[a-z0-9\.\-_]+$/.test(t) , /^[^\.\-_]+/.test(t) , /[^\.\-_]+$/.test(t) , !/[\.\-_]{2,}/.test(t)); | |
| } | |
| // Valid | |
| testUser('foo'); | |
| testUser('foo.bar'); | |
| testUser('foo.bar-asd_123'); |
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
| #!/bin/bash | |
| ############################################### | |
| # To use: | |
| # chmod +x install-redis.sh | |
| # ./install-redis.sh | |
| ############################################### | |
| version=4.0.11 | |
| set -e |
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
| Get-Item g:\* | Foreach { "Nombre: " + $_.Name + ", Creado: " + $_.CreationTime + "; Modificado: " + $_.LastWriteTime + ", Tamaño: " + $_.Length + " k | |
| b" } |
I hereby claim:
- I am reduardo7 on github.
- I am reduardo7 (https://keybase.io/reduardo7) on keybase.
- I have a public key ASBPF9vxn6uoQaQD06IGZB1aCw7qQiLb4_htndVfHfn0mQo
To claim this, I am signing this object:
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
| (function(){ | |
| $('#files_list > [data-file-id]').each(function(i) { | |
| killIt($(this).attr('data-file-id')); | |
| function killIt(id) { | |
| console.log(id); | |
| $.post('/api/files.delete', { | |
| file: id, | |
| token: boot_data.api_token |
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
| #!/bin/bash | |
| # Stop all containers | |
| docker stop $(docker ps -a -q) | |
| # Delete all containers | |
| docker rm $(docker ps -a -q) | |
| # Delete all images | |
| docker rmi $(docker images -q) |