Skip to content

Instantly share code, notes, and snippets.

View mehrancodes's full-sized avatar
🏠

Mehran Rasulian mehrancodes

🏠
  • UAE
  • 01:21 (UTC +04:00)
View GitHub Profile
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@leemour
leemour / Zsh & theme
Last active April 12, 2023 08:53
Zsh installation and Agnoster theme settings
# Railscast
http://railscasts.com/episodes/308-oh-my-zsh
# Install Zsh
sudo apt-get update && sudo apt-get install zsh
# Install Oh-my-zsh
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh
# Make ZSH default shell
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active May 25, 2024 06:37
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@martinbean
martinbean / pre-commit
Last active December 19, 2023 22:14
Pre-commit hook to detect if any .php files contain dd()
#!/usr/bin/php
<?php
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"');
$files = explode("\n", trim($files));
$exitCode = 0;
foreach ($files as $file) {
if (empty($file)) {
@adamwathan
adamwathan / maxBy.php
Created June 23, 2016 18:44
maxBy/minBy macros
<?php
Collection::macro('maxBy', function ($callback) {
$callback = $this->valueRetriever($callback);
return $this->reduce(function ($result, $item) use ($callback) {
if ($result === null) {
return $item;
}
return $callback($item) > $callback($result) ? $item : $result;
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - freek@spatie.be</title>
</head>
<body>
<outline text="PHP" title="PHP">
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/>
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/>
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/>
@naveenyagati
naveenyagati / Laravel PHP7 LEMP DigitalOcean.md
Last active September 1, 2020 03:59
Configuration for Installing Laravel with LEMP on Ubuntu 16.04 on Digital Ocean

Steps to install latest Laravel with LEMP on Digital Ocean Ubuntu 16.4

This tutorial is made based upon my experiences.In DigitalOcean Firewall in Configured by default so no changes are needed.Let's Encrypt has been pre-installed for us in Digita Ocean, please see: http://do.co/le-nginx

Install PHP 7 on Ubuntu

sudo apt-get update
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get install zip unzip
sudo apt-get install -y php7.0 php7.0-fpm php7.0-mysql php7.0-zip php7.0-gd
@james2doyle
james2doyle / NuxtValetDriver.php
Last active July 25, 2022 16:51
A Laravel Valet driver for running generated Nuxt.js sites. This driver assumes you have not changed the default public path (/dist) in the nuxt.config.js
<?php
/**
* NuxtValetDriver for running compiled nuxt.js sites
*/
class NuxtValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
@ajdruff
ajdruff / fix-git-line-endings
Last active May 28, 2024 15:15
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active July 4, 2024 00:18
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory: