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
/** | |
* code from: https://gist.github.com/sr2ds/1786aaff13948c89f4efcb7124ce2222 | |
* | |
* Author: David Silva | |
* Dependencies: expressJs, mongoose, mocha, chai and chaiHttp | |
* necessary run mocha command with --delay param | |
* | |
* how it works: | |
* this project will allow you to store the state of all requests | |
* and use it to do automatic tests |
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
// Mongoose model to store logs | |
logModel = () => { | |
const db = require('../lib/db'); | |
const Schema = db.Schema; | |
const logsSchema = new Schema({ | |
method: { type: String, trim: true }, | |
url: { type: String, trim: true }, | |
query: { type: Object, }, |
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 | |
// https://www.php.net/manual/en/function.memory-get-usage.php#96280 | |
function convert($size) | |
{ | |
$unit=array('b','kb','mb','gb','tb','pb'); | |
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; | |
} | |
echo convert(memory_get_usage(true)); // 123 kb |
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
[] |
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
[ | |
{ | |
"date": "2020-06", | |
"title": "", | |
"description": "Em desenvolvimento ...", | |
"category": "Tech Lead - Sr Developer", | |
"icon": "code", | |
"color": "white", | |
"tags": [ | |
"Linux", |
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
#!/bin/bash | |
## Check Queues Health Redis Docker Containers | |
# if your have many redis containers with queue processing, this script can help you | |
# when any application worker stop or have delayed, this script can send mail for you with this information | |
sendTo="email@email.com" | |
lengthToWarning="10" | |
docker ps | grep redis | awk '{print $1}' | while read container; do |
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
<template> | |
<div> | |
<div class="row"> | |
<div class="col-sm-4"> | |
<a :href="fileUrl"> | |
<canvas :id="_uid" /> | |
</a> | |
</div> | |
</div> | |
</div> |
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 moment = require('moment') | |
// Define your local projects in here | |
const projects = [ | |
{ name: 'painel', source: '~/apps/apis/api-carrinho', tags: [] }, | |
{ name: 'pagamento', source: '~/apps/apis/api-pagamento', tags: [] } | |
] | |
// https://gist.github.com/sr2ds/20666cbae5621cf2ede8e7bffec8ae0d | |
const gitCommand = ` \ |
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
// import lib to execute shell | |
const shellExec = require('shell-exec') | |
// build shell command to get tags with subject and date | |
const gitCommand = ` \ | |
git tag -l \ | |
--format='{\n | |
"tag": "%(tag)", \n \ | |
"subject": "%(subject)", \n \ | |
"created": "%(creatordate)" \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
#!/bin/bash | |
git branch --merge | grep -v develop| grep -v master | awk '{ print $1 }'| while read branch; do git branch -D $branch; done |
NewerOlder