Skip to content

Instantly share code, notes, and snippets.

View brunocarvalhodearaujo's full-sized avatar

Bruno Carvalho de Araujo brunocarvalhodearaujo

  • Rede D'Or São Luiz
  • Rio de Janeiro, Brazil
  • 19:47 (UTC -03:00)
  • X @Bruno_C_Araujo
View GitHub Profile
@brunocarvalhodearaujo
brunocarvalhodearaujo / dnsd.rb
Created March 13, 2018 17:31 — forked from mrluanma/dnsd.rb
Simple, scrappy TCP DNS server in Ruby (with protocol annotations)
# Simple, scrappy TCP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@brunocarvalhodearaujo
brunocarvalhodearaujo / schema.ts
Last active March 5, 2018 12:09
SAMU - esquema para o sistema de controle de campanhas publicitarias em pontos de onibus
type Cliente {
id: number,
cpfcnpj: number,
nome: string,
descricao?: string,
tipo?: 'privado' | 'publico', // --> enum
responsavel?: cliente, // alto referencia, não disponível inicialmente
observacoes?: string, // informações adicionais sobre o cliente
notificacoes: Array<string>
endereco?: string // no futuro daria para sugerir a um cliente onde anunciar baseado em sua localizaçao
@brunocarvalhodearaujo
brunocarvalhodearaujo / mysql_dump.sh
Created December 22, 2017 16:56 — forked from infynyxx/mysql_dump.sh
automated mysql dump using Linux Cron tab
#!/bin/sh
mysqldump -u root -pmysql123 –all-databases –routines| gzip > /root/MySQLDB_`date ‘+%m-%d-%Y’`.sql.gz
mysqldump -h 172.16.21.3 -u root -pmysql123 –all-databases –routines | gzip > /root/MySQLDB.3_`date ‘+%m-%d-%Y’`.sql.gz
#now create cron script smth like this
#crontab -e
#30 15 * * * /root/MySQLdump.sh 2>&1>> /root/MySQLdump.log
#The above will dump the database every day at 15:30.
stages:
- test
phpunit:
stage: test
image: php:7.1-cli
only:
- master
script:
- apt-get update
export class EventManager {
constructor () {
/**
* @type {{ [name:string]: Array<Function> }}
*/
this.events = {}
}
/**
* @param {string} name
version: '2'
services:
mysql:
image: mysql:5.7
volumes:
- ./database:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
command: --character-set-server=utf8 --collation-server=utf8_unicode_ci
cpu_shares: 30
@brunocarvalhodearaujo
brunocarvalhodearaujo / git.md
Created August 6, 2017 23:27 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

import socket from 'socket.io'
/**
* @type {socket}
*/
const io = socket()
/**
* @param {number} code dsadsad as
* @param {socket} socket - dsads dsad as
@for $i from 1 through 20 {
$number: $i * 5;
.fs-#{$number} {
font-size: $number + px;
font-size: $number / 16 + rem;
}
}