Skip to content

Instantly share code, notes, and snippets.

View fatih's full-sized avatar

Fatih Arslan fatih

View GitHub Profile
@fatih
fatih / set.go
Created August 11, 2013 21:05
Concurrent safe SET data structure in Go (Golang)
// A very simple example about how to use concurrent-safe SETs (using string as keys) in GO
package main
import (
"fmt"
"sync"
)
type Set struct {
m map[string]bool
@fatih
fatih / poly-file-layer.txt
Created March 19, 2023 17:44
Poly file layer
Poly File Layer
Idea: A single file content to represent a set of identical or similar files.
* Files can be templated. Files generated by the template are identical in the PFL (Poly File Layer)
* Files that have common lines, can be linked and marked as a Poly File.
Prior Art
* [ ] Read the paper
* Extracting a Unified Directory Tree to Compare Similar Software Products: https://sel.ist.osaka-u.ac.jp/lab-db/betuzuri/archive/1012/1012.pdf
* Fast Search in Hamming Space with Multi-Index Hashing: http://www.cs.toronto.edu/~norouzi/research/papers/multi_index_hashing.pdf

Keybase proof

I hereby claim:

  • I am fatih on github.
  • I am arslan (https://keybase.io/arslan) on keybase.
  • I have a public key ASDcvzZWuMBwyPHwpUkOEmBS_jMOB_3NiOjUP-6vPAYePQo

To claim this, I am signing this object:

package main
import (
"testing"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestValidate(t *testing.T) {
@fatih
fatih / Makefile
Created March 24, 2016 10:51
Makefile
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
GIT_TREE_STATE=clean
else
GIT_TREE_STATE=dirty
endif
all: build
build:
@echo "==> Building the project"
@fatih
fatih / md-to-hugo.go
Created November 29, 2017 03:22
Markdown to Hugo converter
package main
import (
"bytes"
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
@fatih
fatih / ring.go
Created December 24, 2013 00:47
container/ring example golang
package main
import (
"container/ring"
"fmt"
"time"
)
func main() {
coffee := []string{"kenya", "guatemala", "ethiopia"}
@fatih
fatih / caption-transform.go
Created November 16, 2017 19:06
Wordpress captions to Hugo shortcodes. This is a terrible hack, not performant. Only here for reference
package main
import (
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
"path/filepath"
"regexp"
@fatih
fatih / gist:3359902
Created August 15, 2012 12:53
Rastgele TC Kimlik No üreticisi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Without tk: http://rastgele-tc-kimlik-no-uretici.googlecode.com/svn/trunk/rastgele-tc-kimlik-no-uretici.py
from random import randint
while True:
tcno = randint(10000000000,99999999999)
tc = str(tcno)
listetc = [int(tc[i]) for i in range(11)]
tc10 = 0
@fatih
fatih / switchgo.sh
Last active December 31, 2019 13:58
Switch between go version using https://github.com/golang/dl
function switchgo() {
version=$1
if [ -z $version ]; then
echo "Usage: switchgo [version]"
return
fi
if ! command -v "go$version" > /dev/null 2>&1; then
echo "version does not exist, download with: "
echo " go get golang.org/dl/go${version}"