Skip to content

Instantly share code, notes, and snippets.

View masihtehrani's full-sized avatar
🙎‍♂️

Mahmoud Masih Tehrani masihtehrani

🙎‍♂️
View GitHub Profile
@dragonde
dragonde / sre-roadmap.md
Last active September 28, 2024 21:06
SRE Roadmap

SRE Roadmap

  1. Scripting and Programming

    • Bash
    • Python
    • Go
  2. Documentation tools

    • Markdown
  • Serializers: YML,JSON

PlatformIO with Vim (neomake, clang, coc-vim, ale)

Requirements

PlatformIO

clangd

@miguelmota
miguelmota / struct_custom_unmarshal.go
Created March 15, 2018 04:12
Golang custom struct unmarshal function example
package main
import (
"encoding/json"
"fmt"
"log"
"time"
)
type MyStruct struct {
@sixlive
sixlive / 0.POST.md
Last active August 9, 2022 20:40
My Current PHP CS Fixer Workflow

This is the process and standard that I use for the vast majority of my Laravel code bases and projects.

For more information about php-cs-fixer visit the project repository: FriendsOfPHP/PHP-CS-FIXER.

Setup

Add the following .php_cs file to the root of your project.

.php_cs

@reagent
reagent / 00_README.md
Last active January 31, 2025 08:46
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (
@elithrade
elithrade / vimfiler-shortcuts
Last active October 12, 2022 21:13
Common vimfiler keyboard shortcuts
Toggle safe mode: gs
Create new file: N
Delete file: d
Rename file: r
New directory: K
Open file: e
Move file: m
Open VimFilerExplorer: e
Open current directory in a new buffer: dl
Open current directory in a new split: ds
@thg303
thg303 / gist:ea5ff438ead0bbf0a87dfe7ebb8896b0
Last active March 18, 2025 11:47 — forked from ebraminio/gist:5292017
Check Iranian National Code Validity - بررسی صحت کد ملی ایرانی - Clojure, C#, Ruby, JavaScript, Python, Scala, Java 8, PHP, C, Go
// Check Iranian National Code Validity - Clojure, C#, Ruby, JavaScript, Python, Scala, Java 8, PHP, C, Go
// بررسی صحت کد ملی ایران - کلوژر، سی‌شارپ، روبی، جاوااسکریپت، پایتون، اسکالا، جاوا ۸، پی‌اچ‌پی، سی، گو
// در نسخه‌های قبل یکسان بودن اعداد نا معتبر تشخیص داده می‌شد ولی
// اعداد یکسان نامعتبر نیست http://www.fardanews.com/fa/news/127747
/**
* @author Ebrahim Byagowi (2013-)
* @lincense: Public Domain
*/
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active March 21, 2025 14:47
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active May 16, 2025 00:24
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@wdullaer
wdullaer / install.sh
Last active April 3, 2025 19:08
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"