Skip to content

Instantly share code, notes, and snippets.

View gabrielgodoy-zz's full-sized avatar

Gabriel Godoy gabrielgodoy-zz

View GitHub Profile
@patrickporto
patrickporto / desafio-dinheiro.md
Last active March 31, 2019 00:33
Este é um desafio adequado para Desenvolvedor Back-End Júnior da área de Banking.

Manipulação de Dinheiro

O Sistema Financeiro precisa representar valores monetários. A idéia básica é ter uma estrutura de dados que permita realizar operações financeiras com dinheiro dentro de uma mesma moeda. Essas operações financeiras precisam ser seguras e devem interromper a execução do programa em caso de erros críticos.

Sobre as operações financeiras que serão realizadas no sistema, é correto afirmar que os valores monetários devem suportar as seguintes operaçoes:

  • O sistema realizará split de transações financeiras, então deve ser possível realizar a operação de rateio de valores monetários entre diferentes indivíduos.

  • O sistema permite realizar câmbio então os valores monetários possuem uma operação para conversão de moeda.

@sam-artuso
sam-artuso / setting-up-babel-nodemon.md
Last active November 3, 2023 08:52
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
#!/bin/sh
#
# Brew packages that I use alot.
#
brew install wget
brew install node
brew install imagemagick
#
# Some cask packages that I like.
#
@chrtze
chrtze / chart.js
Created November 23, 2015 20:00
Line Chart Example
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator;
var breakPoint = 768;
d3.csv('data.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
@MartinSeeler
MartinSeeler / README.md
Last active July 3, 2023 21:36
IntelliJ's "Expand Selection" in Sublime Text

IntelliJ's "Expand Selection" feature in Sublime Text

  1. Install the sublime-expand-region plugin in Sublime Text via Package Control.
  2. Edit Preferences -> Key Bindings - User and add the following to it:
{
  "keys": [
    "alt+up"
  ],
 "command": "expand_region"
@kevinwhoffman
kevinwhoffman / loop-custom.php
Last active April 8, 2022 11:22
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
@viniciusdaniel
viniciusdaniel / d3js.pt-br.js
Created October 29, 2014 23:01
D3.js localize pt-BR for time and number formatting
/**
* Configuração de localização em Português do Brasil(PT-BR) para o D3.js realizar formatação tempo e números
* Mais detalhes conferir a documentação: https://github.com/mbostock/d3/wiki/Time-Formatting
*/
var localized = d3.locale({
"decimal": ",",
"thousands": ".",
"grouping": [3],
"currency": ["R$", ""],
@rtoal
rtoal / AnimalDemo.java
Created October 27, 2014 04:22
An example of inheritance and polymorphism in Java
abstract class Animal {
private String name;
public Animal(String name) {
this.name = name;
}
public String speak() {
return name + " says " + sound();
}
public abstract String sound();
}
@mikaelbr
mikaelbr / destructuring.js
Last active April 25, 2024 13:21
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@mattbanks
mattbanks / gulpfile.js
Created February 4, 2014 20:18
Setup for using gulp in developing and deploying WordPress themes
// Load plugins
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')({ camelize: true }),
lr = require('tiny-lr'),
server = lr();
// Styles
gulp.task('styles', function() {
return gulp.src('assets/styles/source/*.scss')
.pipe(plugins.rubySass({ style: 'expanded', compass: true }))