Skip to content

Instantly share code, notes, and snippets.


Ali Najafizadeh alinz

Block or report user

Report or block alinz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alinz / Certificates.go
Created Nov 12, 2019 — forked from Mattemagikern/Certificates.go
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
View Certificates.go
package main
import (
alinz /
Created Nov 12, 2019
OPENSSL encrypt decrypt
openssl aes-256-cbc -in plain.txt -out plain.enc -k cool
openssl aes-256-cbc -d -in plain.enc -out plain.txt -k cool
alinz / PROFILE.MD
Created Nov 7, 2019
Golang Profiling commands


Generate Prfile data

go test -cpuprofile -memprofile -bench .

Visual Profile data

View model.ts
export class Model {
constructor(obj: any) {
for (let key in obj) {
this.unmarshal(toCamelCase(key), obj[key])
marshal(): any {
return Object.keys(this).reduce((obj: any, key: string) => {
obj[toSnakeCase(key)] = toJS(this[key])
alinz / Makefile
Created Sep 25, 2019
Compile Zig to WebAssembly and run it in Node.js
View Makefile
zig build-exe --name test.wasm -target wasm32-freestanding --release-small test.zig
View setup react project
// babel js
"plugins": [
"import", {
"libraryName": "antd",
"libraryDirectory": "es",
alinz / golang_tls_http.go
Created Jul 11, 2019
Share tls config with server and client in golang
View golang_tls_http.go
package main
import (
alinz / router.go
Created Jul 7, 2019
router with cors
View router.go
import (
func New() chi.Router {
cors := cors.New(cors.Options{
alinz / Fetcher.js
Created Jul 7, 2019
A simple Fetch implementation
View Fetcher.js
const baseURL = process.env.API_ADDR || 'http://localhost/api'
export type Pagination<T> = {
meta: {
total: number
data: T
export interface Fetcher {
alinz / Makefile
Created May 29, 2019
WebAssembly on Node.js
View Makefile
emcc test.c -O3 -s WASM=1 -s EXPORTED_FUNCTIONS='["_add"]' -s SIDE_MODULE=1 -o test.wasm
node index.js
You can’t perform that action at this time.