Skip to content

Instantly share code, notes, and snippets.

View Mardiniii's full-sized avatar

Sebastian Zapata Mardini Mardiniii

View GitHub Profile
@Mardiniii
Mardiniii / searchFormHandler.js
Last active April 30, 2018 05:39
Code snippet for medium post
$(document).ready(function() {
function parseResponse(resultsContainer, data) {
console.log(data);
const resultsAmount = data.pages.length
$(resultsContainer).html('');
if (resultsAmount > 0) {
$.each(data.pages, function(index, page) {
appendToResults(resultsContainer, page)
setResultsTitle(resultsAmount + " results found it for: " + data.input, 'green')
@Mardiniii
Mardiniii / channels_solution.go
Created April 17, 2018 20:48
Fix race data races and race conditions with mutex and channels in Go
package main
import (
"fmt"
"sync"
)
// ChannelsSolution uses a buffered channel with capacity of one
// in order to avoid data races from the go routines trying to increase
// the counter
@Mardiniii
Mardiniii / tcp_server.go
Created April 16, 2018 15:51
TCP server with HTTP protocol using Golang
package main
import (
"fmt"
"net"
"os"
)
const (
CONN_HOST = "localhost"
@Mardiniii
Mardiniii / concurrent_sudoku_recursiveSolution.go
Last active April 15, 2018 16:51
Code snippet for medium post
func recursiveSolution(grid [N][N]int, ch chan [N][N]int) {
pending, row, col := pendingPositions(grid)
if !pending && CheckBoard(grid) {
ch <- grid
close(ch)
return
}
for i := 1; i <= 9; i++ {
@Mardiniii
Mardiniii / concurrent_sudoku_solve.go
Last active April 15, 2018 16:50
Code snippet for medium post
// Solve algorithm
func Solve(grid [N][N]int) (bool, [N][N]int) {
ch := make(chan [N][N]int)
pending, row, col := pendingPositions(grid)
if !pending {
fmt.Println("Solve calls:", count)
return false, grid
}
@Mardiniii
Mardiniii / concurrent_factorial.go
Last active April 15, 2018 16:46
Snippet for medium post
package main
import "fmt"
// Factorial recursive function to find the factorial result
// using go routines and the channel passed as parameter
func Factorial(number int, product int, ch chan int) {
// Calculate the product until this point
product = product * number
@Mardiniii
Mardiniii / sudoku_solver.go
Last active April 15, 2018 16:44
Snippet for medium post
// Solve algorithm
func (s *Sudoku) Solve() bool {
// Find the next pending position in the board
pending, row, col := s.pendingPositions()
// If there aren't more pending positions we did
// and the problem is solved
if !pending {
return true
}
// If not, let's try to find a solution for the pending position
@Mardiniii
Mardiniii / finance_script_tools.md
Last active December 26, 2017 14:35
In this gist you will find the main scripts used by the finance team in its daily workflow. Feel free to add any comment or question.

Why we are doing this?

We want to have a centralized source where any person from the finance team or the product department can find easy and fast the scripts and code related to the tasks from our team.

What do you need?

You will need access to the staging and production consoles, if you are not available to got into this enviroments talk to the Systems Team in #dev-systems Slack channel.

Invoice Generation

If you want to see the current implementation for this process you can check this Flow Diagram any comment about this process ask in #dev-finance Slack channel.

For global - All agencies

@Mardiniii
Mardiniii / gist:81e2418324f3b3b81202d5b3674b8b56
Created May 16, 2017 12:18 — forked from rxaviers/gist:7360908
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:
@Mardiniii
Mardiniii / .gitconfig
Created April 24, 2017 14:16
File to set up some special GitHub aliases and profiles.
[user]
name = mardiniii
email = sezama03@hotmail.com
[color]
ui = true
[alias]
ch = checkout
com = commit -m
coma = commit -am
all = add .