Skip to content

Instantly share code, notes, and snippets.

View afrikaan-official's full-sized avatar
💭
I may be slow to respond.

Kaan afrikaan-official

💭
I may be slow to respond.
View GitHub Profile
@afrikaan-official
afrikaan-official / main.go
Created October 4, 2016 12:17
sample sync package in go
package main
import ("fmt"
"net/http"
"time"
"sync"
)
var wg=sync.WaitGroup{}
@afrikaan-official
afrikaan-official / main.go
Created October 5, 2016 08:09
sample http health checker with http package
package main
import (
"net/http"
_ "github.com/lib/pq"
"github.com/astaxie/beego/orm"
"encoding/json"
)
@afrikaan-official
afrikaan-official / Paralel.cs
Last active October 18, 2016 07:11
csharp paralel requests.
public static async Task<string> CalculateDistance(string origins, string destination)
{
string url = string.Format(urlBase, origins, destination);
RestClient client = new RestClient(url);
var request = new RestRequest();
var response = await client.ExecuteGetTaskAsync(request);
DistanceModel model = JsonConvert.DeserializeObject<DistanceModel>(response.Content);
@afrikaan-official
afrikaan-official / docker-things.sh
Last active January 30, 2017 09:51 — forked from tugberkugurlu/docker-things.sh
Docker CLI Cheatsheet
# List all stopped containers
docker ps --filter "status=exited"
# Remove all stopped containers
docker rm $(docker ps --filter "status=exited" -aq --no-trunc)
# Remove all unused images (http://stackoverflow.com/a/32723127)
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
#Remove dangling Images
@afrikaan-official
afrikaan-official / main.go
Created July 3, 2017 13:04
reverse an array without using a temp variable
package main
import "fmt"
func main() {
v := []int{
1,
2,
3,
@afrikaan-official
afrikaan-official / app.conf
Created October 5, 2017 16:44
Griffin project's config file
appname = central-api
httpport = 8080
runmode = dev
autorender = false
copyrequestbody = true
EnableDocs = true
RedisHost=172.17.0.2
RedisPort=6379
MySQL=readonly:readonly*34@tcp(146.185.158.165:3306)/container
@afrikaan-official
afrikaan-official / dir.go
Created October 20, 2017 13:26
testable dir.go file
package service
import "os"
type DirExistCreator interface {
Exist(path string) bool
Create(path string) bool
}
type DirService struct{}
@afrikaan-official
afrikaan-official / main.go
Created March 5, 2018 13:27
Pop orm to with custom time type
package main
import (
"fmt"
"time"
"encoding/json"
"github.com/gobuffalo/pop"
)
{
"passBundle":[{
"name": "Vodafone İletişim Pass",
"headerIcon": "URLpath/x.png",
"availableAppsIcon":{
"availableAppsTitle": "Kullanabileceğin uygulamalar", //Max karakter sayısı iletilecektir.
"icons":[
{
"iconUrl": "URLpath/x.png",
"iconDescription": "WhatsApp" //Max karakter sayısı iletilecektir.
gesture swipe up xdotool key ctrl+alt+Up
gesture swipe left xdotool key ctrl+alt+Right
gesture swipe right xdotool key ctrl+alt+Left
gesture swipe down xdotool key ctrl+alt+Down