Skip to content

Instantly share code, notes, and snippets.

View dev-alves's full-sized avatar
:octocat:
Coding

Victor Alves dev-alves

:octocat:
Coding
View GitHub Profile
@millermedeiros
millermedeiros / example.js
Last active September 10, 2022 03:06
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
@marioluan
marioluan / remover-acentos.js
Created October 10, 2013 18:27
Funcao marota para remover acentos de strings. Foi utilizado expressao regular em cima de caracteres representados na base hexadecimal.
/**
* Remove acentos de caracteres
* @param {String} stringComAcento [string que contem os acentos]
* @return {String} [string sem acentos]
*/
function removerAcentos( newStringComAcento ) {
var string = newStringComAcento;
var mapaAcentosHex = {
a : /[\xE0-\xE6]/g,
e : /[\xE8-\xEB]/g,
@rxaviers
rxaviers / gist:7360908
Last active June 17, 2024 06:20
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kimus
kimus / cx_oracle.md
Last active June 1, 2024 13:32
Installing python cx_oracle on Ubuntu

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need:

@SQiShER
SQiShER / docker_stats_with_names.sh
Last active May 5, 2020 07:35
Docker stats with Container Names instead of IDs
docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)
@suissa
suissa / Calisthenics.md
Last active September 4, 2023 19:55 — forked from bobuss/Calisthenics.md
As 9 Regras do Object Calisthenics

Object Calisthenics descreve 9 regras básicas - pt-br

  1. Um nível de recuo por método.
  2. Não use a palavra-chave ELSE.
  3. Envolver todos os primitivos e Strings em classes. (em JS nao eh necessario)
  4. Funções de primeira classe // mudei p/ Function em vez de Class
  5. Um ponto por linha.
  6. Não abrevie.
  7. Mantenha todas os módulos com menos de 50 linhas.
  8. Nenhuma função com mais de dois parâmetros.
SPACESHIP_PROMPT_ORDER=(
user # Username section
dir # Current directory section
host # Hostname section
git # Git section (git_branch + git_status)
hg # Mercurial section (hg_branch + hg_status)
exec_time # Execution time
line_sep # Line break
vi_mode # Vi-mode indicator
@vbsteven
vbsteven / Validators.kt
Created April 8, 2019 16:27
Custom Spring annotation and validator in Kotlin
package io.license.core.validation
import javax.validation.Constraint
import javax.validation.ConstraintValidator
import javax.validation.ConstraintValidatorContext
import javax.validation.Payload
import kotlin.reflect.KClass
@Target(AnnotationTarget.FIELD)
@thiagofa
thiagofa / DatabaseCleaner.java
Last active January 27, 2024 10:14
Componente Spring para limpar os dados de todas as tabelas de um banco de teste (exceto a tabela de histórico do Flyway)
// Baseado em: https://brightinventions.pl/blog/clear-database-in-spring-boot-tests/
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;