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
version: '3.8' | |
services: | |
minio: | |
image: minio/minio:latest | |
container_name: minio | |
restart: always | |
command: server --console-address :9001 /data | |
environment: | |
- MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE |
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
# README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
# | |
# In addition, I recommend the | |
# [Tomorrow Night theme](https://github.com/chriskempson/tomorrow-theme) and, if | |
# you're using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over | |
# Terminal.app - it has significantly better color fidelity. |
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
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
# place this after nvm initialization! | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" | |
if [ -n "$nvmrc_path" ]; then |
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
/** | |
* SELECT * FROM users LIMIT 20 | |
limit = 10 | |
page?=1 | |
offset = (page - 1) * limit | |
LIMIT offset,limit |
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 arrayPaginate(array, page_size, page_number) { | |
--page_number; // because pages logically start with 1, but technically with 0 | |
return array.slice(page_number * page_size, (page_number + 1) * page_size); | |
} |
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 | |
$xml = simplexml_load_file('test.xml'); | |
$ns = $xml->getNamespaces(true); | |
$xml->registerXPathNamespace('c', $ns['cfdi']); | |
$xml->registerXPathNamespace('t', $ns['tfd']); | |
//EMPIEZO A LEER LA INFORMACION DEL CFDI E IMPRIMIRLA | |
foreach ($xml->xpath('//cfdi:Comprobante') as $cfdiComprobante){ | |
echo $cfdiComprobante['version']; |
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 createUUID() { | |
return uuid.v4(); | |
} | |
// version 4 | |
// createUUID.regex = '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$'; | |
createUUID.regex = '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'; | |
createUUID.is = function (str) { | |
return new RegExp(createUUID.regex).test(str); |
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
const AWS = require('aws-sdk') | |
const uuidBase62 = require('uuid-base62') | |
const mailcomposer = require('mailcomposer') | |
/** | |
* Upload file to AWS S3 Service | |
* @param {Buffer} f | |
* @param {String} path | |
* @param {String} filename Uploaded file's name | |
* @return {Promise<Object>} S3 Promise |
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 orderBy($items, $attr, $order) | |
{ | |
$sortedItems = []; | |
foreach ($items as $item) { | |
$key = is_object($item) ? $item->{$attr} : $item[$attr]; | |
$sortedItems[$key] = $item; | |
} | |
if ($order === 'desc') { |
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
db.Shopping.updateMany({ | |
_id: { | |
$nin: [ | |
ObjectId("5e0002b5ee120c01b5492a3a"), | |
ObjectId("5e0001272f7790405e7c64ed"), | |
ObjectId("5e000302fbbe813c744409b3"), | |
ObjectId("5e0002c7fbbe813c744409b0"), | |
ObjectId("5e0001e02f7790405e7c64fa"), | |
ObjectId("5e0002a22f7790405e7c6505"), | |
ObjectId("5e0001ec2f7790405e7c64fd"), |
NewerOlder