Skip to content

Instantly share code, notes, and snippets.

View zaky's full-sized avatar
🏠
Working from home

zaky zaky

🏠
Working from home
View GitHub Profile
package Fibonacci
import "testing"
func TestFibonacci(t *testing.T) {
parameters := []struct {
input, expected int
}{
{0, 0}, {1, 1}, {2, 1}, {3, 2}, {4, 3}, {5, 5}, {6, 8},
}
OUTPUT = rating_migration_cli
PACKAGE= github.com/gtforge/cli_rating
GOARCH=amd64
define GRAPH_BODY
( echo "digraph G {"
go list -f '{{range .Imports}}{{printf "\t%q -> %q;\n" $$.ImportPath .}}{{end}}' $$(go list -f '{{join .Deps " "}}' github.com/gtforge/cli_rating) github.com/gtforge/cli_rating
echo "}"
) | dot -Tsvg -o deps.svg && firefox deps.svg
endef
export GRAPH_BODY
@zaky
zaky / findOne.go
Last active December 29, 2015 11:55
/*
Find if one string out of a list exists in an array of strings
*/
package main
import (
"fmt"
"strings"
"time"
)
@zaky
zaky / merge2master.sh
Created December 22, 2014 08:29
Merge flow
#Find differences
git diff --stat --color GS-1702-migrate-bo-server-to-php-55..master
#Merge master
#git checkout [branch]
git merge --no-commit --no-ff master
git commit -am"merge master"
git push
#Merge brange
@zaky
zaky / last_monday.php
Created December 17, 2014 15:44
PHP first day of the week. Return today if Monday
echo date('Y-m-d', strtotime('last monday', strtotime('tomorrow')));
@zaky
zaky / FizzBuzzClosure.go
Last active August 29, 2015 14:07
FizzBuzz closure
package main
import (
"fmt"
)
func setCheck(data map[int]string) func(nidle int) (ret string) {
f := func(nidle int) (ret string) {
for key, val := range data {
if nidle%key == 0 {