Skip to content

Instantly share code, notes, and snippets.

View arehmandev's full-sized avatar
🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • Freelance
  • London, UK
View GitHub Profile
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-9501c8fa"
},
@arehmandev
arehmandev / both files
Last active August 24, 2017 15:02
tmux
#~/.bashrc
if command -v tmux>/dev/null; then
[[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux
fi
alias fortune='fortune | cowsay | lolcat'
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
tmux source-file ~/.tmux.conf
@arehmandev
arehmandev / main.go
Created September 8, 2017 15:27
Finding files in a directory using go - absolute filepath
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"regexp"
)
@arehmandev
arehmandev / vscode
Last active March 12, 2019 10:49
VScode settings
So vscode rocks, I've happily moved to it from Atom
#code --list-extensions
Borke.puppet
HookyQR.beautify
PeterJausovec.vscode-docker
RomanPeshkov.go-test-outline
bbenoist.vagrant
bibhasdn.django-html
package main
import (
"fmt"
"gopkg.in/yaml.v2"
)
type T struct {
Charts []struct {
@arehmandev
arehmandev / main.go
Last active February 25, 2022 08:29
Doing a git clone of a tag in Go - the easy way
package main
import (
"log"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4"
)
@arehmandev
arehmandev / curlkube.sh
Last active September 19, 2017 14:27
Curl kubernetes apiserver (run kubectl get with curl)
#!/bin/bash
APIKEYFILE=~/.minikube/apiserver.key
APICERTFILE=~/.minikube/apiserver.crt
CAFILE=~/.minikube/ca.crt
curl https://192.168.99.100:8443/api/v1/namespaces \
--key $APIKEYFILE \
--cert $APICERTFILE \
--cacert $CAFILE
@arehmandev
arehmandev / changed.yaml
Created September 20, 2017 18:36
Changing value in yaml file in go
Charts:
name: foo
repo: foo.com
tags: realtag
@arehmandev
arehmandev / reverse.go
Created September 28, 2017 13:59
Reverse a string (2 different ways) in go
package main
import (
"fmt"
"strings"
)
var (
word = "test"
reversedstringarray []string
@arehmandev
arehmandev / struct.go
Last active October 3, 2017 09:44
Example of instantiating a nested struct and Marshalling it to JSON
package main
import (
"encoding/json"
"fmt"
"log"
)
// Deployment -
type Deployment struct {