Skip to content

Instantly share code, notes, and snippets.

View eamirgh's full-sized avatar
:octocat:
trying to make the world a better place

Amir Ghaffari eamirgh

:octocat:
trying to make the world a better place
View GitHub Profile
@eamirgh
eamirgh / _spacing-helpers.scss
Created November 23, 2017 18:18 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
{
"provinces": [
{
"id": "AZE",
"name": "آذربايجان شرقي",
"cities": [
{
"id": "4",
"name": "تبریز",
"areas": [
@eamirgh
eamirgh / fix-npm-run-dev.sh
Last active May 11, 2018 14:07
ubuntu laravel error on npm run dev
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}
/**
@eamirgh
eamirgh / git-io-custom-url.md
Created November 14, 2018 22:07 — forked from dikiaap/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
@eamirgh
eamirgh / git_avoid_pull.md
Last active November 24, 2018 20:46
git avoid from pulling

git avoid from pulling

$ git update-index --assume-unchanged

@eamirgh
eamirgh / bulma-sass-scss.rb
Created November 28, 2018 22:44 — forked from DanyHenriquez/bulma-sass-scss.rb
Convert bulma from sass to scss
#!/usr/bin/env ruby
require 'tmpdir'
require 'fileutils'
dir = Dir.tmpdir()
if File.directory?("#{dir}/bulma")
FileUtils.remove_dir("#{dir}/bulma")
end
@eamirgh
eamirgh / LEPP.md
Created May 1, 2019 16:30 — forked from cham11ng/LEPP.md
LEPP Setup - Ubuntu 16.04 LTS

A Relatively Secure Server Stack Setup in Ubuntu 16.04 LTS

Anup Dhakal

Sagar Chamling

Introduction

In this guide, LEPP stands for Linux, Nginx (pronounced as Engine-X) , Postgres and PHP (PHP Hypertext Preprocessor).

@eamirgh
eamirgh / run.py
Created June 29, 2019 13:11 — forked from amrza/run.py
How to write RTL(Arabic/Persian) text on images in python.
# Tested on Python 3.6.1
# install: pip install --upgrade arabic-reshaper
import arabic_reshaper
# install: pip install python-bidi
from bidi.algorithm import get_display
# install: pip install Pillow
from PIL import ImageFont
#!/bin/sh
#
# installer.sh
# Copyright (C) 2018 Kovid Goyal <kovid at kovidgoyal.net>
#
# Distributed under terms of the GPLv3 license.
#
python=$(command -v python3)
if [ -z "$python" ]; then