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 October 27, 2023 19:37
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 29, 2024 13:31
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
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active April 22, 2024 17:19
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 3, 2024 05:11
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 2, 2024 20:33
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"