Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
I Love Open Source

Naser Mirzaei nasermirzaei89

:octocat:
I Love Open Source
View GitHub Profile
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7xEVG3+icx/fsVrS0G9yMDL0aa2o8qT+kL28jZl/7+ucNcz7IrZRcgQI9WErlT7Z+/HBZ0Qmpi+MckhtMSi7yKmH3euqmDWmmU9zFFGgyBde4YD1PunrH1Tb+v/x8Wh54o0xEwLEMLjl4ulxmwRmO86Jr44yZSuH6jT279qlhsJmHS9rOB5+2JdhLupGpFg9VA1qNja/8Li/XSxR6mnjakSx9NCjGM4wGpjML6Hsprs11NdNkJt6JDJwcIldmr/K2EVTIEcrL1at1aXdOAtv+kSzAAJdnI8TmG6z54fSKPcV84kAFjKvpff4d18FcGbS6OaVGWj+IWKXr84T8xGtB nasermirzaei89@gmail.com
View encrypt-decrypt.go
package main
import (
"crypto/rand"
"crypto/rsa"
"log"
)
func main() {
rnd := rand.Reader
@nasermirzaei89
nasermirzaei89 / genres.csv
Last active Apr 7, 2018
ID3v1 Genres List
View genres.csv
Index Title
0 Blues
1 Classic Rock
2 Country
3 Dance
4 Disco
5 Funk
6 Grunge
7 Hip-Hop
8 Jazz
@nasermirzaei89
nasermirzaei89 / Makefile
Created Mar 6, 2017
Check Docker Compose Validation
View Makefile
#@IgnoreInspection BashAddShebang
check-docker-compose:
docker-compose -f docker-compose.yml config
reformat-docker-compose: check-docker-compose
docker-compose -f docker-compose.yml config > docker-compose.yml.tmp
mv docker-compose.yml.tmp docker-compose.yml
@nasermirzaei89
nasermirzaei89 / run.sh
Created Dec 22, 2016
How to see what packages my app imports
View run.sh
go list -f '{{join .Deps "\n"}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
View pagination.sql
SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY "order" ASC) AS row_number FROM myschema.mytable) AS foo WHERE row_number > 200 AND row_number <= 210
View common_initialisms.go
// commonInitialisms is a set of common initialisms.
// Only add entries that are highly unlikely to be non-initialisms.
// For instance, "ID" is fine (Freudian code is rare), but "AND" is not.
// https://github.com/golang/lint/blob/3d26dc39376c307203d3a221bada26816b3073cf/lint.go#L482
var commonInitialisms = map[string]bool{
"API": true,
"ASCII": true,
"CPU": true,
"CSS": true,
"DNS": true,
View generic_json_field.go
package models
import (
"database/sql/driver"
"encoding/json"
"errors"
)
// GenericJSONField is used to handle generic json data in postgres
type GenericJSONField map[string]interface{}