Skip to content

Instantly share code, notes, and snippets.

View fatih's full-sized avatar

Fatih Arslan fatih

View GitHub Profile
@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
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 / 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}"
@fatih
fatih / copyast.go
Created July 13, 2019 12:30
Fork of wire/internal/copyast with support for *ast.File
// Copyright 2018 The Wire Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,

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:

(
set -eux
cd $(mktemp -d)
export GOPATH=$(mktemp -d)
export PATH=$GOPATH/bin:$PATH
git clone https://github.com/ianthehat/godef
cd godef
git checkout f2eb530fb8dbca312f4661b985ec2ae5ba5e7b3a
go install
git clone https://github.com/digitalocean/csi-digitalocean
@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 / 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 / bumpme
Last active November 8, 2016 16:01
boooo
@fatih
fatih / changes.diff
Last active October 24, 2016 17:02
Router example
--- other.go 2016-10-16 16:23:33.000000000 +0300
+++ demo.go 2016-10-16 16:24:27.000000000 +0300
@@ -9,12 +9,12 @@
)
var Session *http.Server
-var r Router
+var r *Router
func Run(port string) {