Skip to content

Instantly share code, notes, and snippets.

View gfonseca's full-sized avatar

Georgio Barbosa da Fonseca gfonseca

View GitHub Profile
  • Tags: algorithm

Ingredients Test

Create a function that receives a string and represents the name of a Smoothie, plus additionals or decrements for that smootie like so: Classic,+chocolate,-strawberry and returns and array of strings with the ingredients of a given smoothie

{
 "Classic": ["strawberry", "banana", "pineapple", "mango", "peach", "honey", "ice", "yogurt"],
 "Forest Berry": ["strawberry", "raspberry", "blueberry", "honey", "ice", "yogurt"],

Git common issues

Git is tracking the file permission mode

$ git diff app/File.php
diff --git a/app/File.php b/app/File.php
old mode 100644
new mode 100755
@gfonseca
gfonseca / sync-and-chanels.go
Last active October 20, 2017 21:09
This simple program writen in Golang show how to transfer messages by go chanels, and how to sync the goroutines output
package main
/*
This simple program show how to transfer messages by go chanels,
and how to sync the goroutines output
*/
import (
"fmt"
@gfonseca
gfonseca / gcapp
Last active October 9, 2017 14:04
Google chrome app window opener
#!/bin/bash
#This script allow to easily start chrome pages as app windows
function register {
read -p "The app alias: " alias
read -p "The complete domain: " domain
if echo "$alias $domain" >> $HOME/.gcapp
then
#!/bin/bash
## Usage: $ wget -O - git.io/v5H1h|source /dev/stdin
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
chmod +x ./composer.phar

Docker comon issues

Problem with user/group permission to docker daemon

FATA[0000] Error starting daemon: open /var/run/docker.pid: permission denied

or

FATA[0000] Error starting daemon: open /var/run/docker.pid: permission denied