Skip to content

Instantly share code, notes, and snippets.

View ijasxyz's full-sized avatar

Ijas Ameenudeen ijasxyz

View GitHub Profile
@ijasxyz
ijasxyz / Laravel-WTR.php
Created September 23, 2019 08:44
What is The Route(WTR)? (Generate route information from a given URI)
<?php
/*
* What is The Route(WTR)? (Generate route information from a given URI)
* */
if (!function_exists('WTR')) {
function WTR($uri, $method = 'GET'){
$request = request()->create($uri, $method);
$routes = app('router')->getRoutes()->match($request);
@ijasxyz
ijasxyz / install_open_vpn.sh
Created February 9, 2019 21:58
Install & Configure OpenVPN on a VPS
#1. Download the script (https://github.com/Nyr/openvpn-install)
wget https://git.io/vpn -O openvpn-install.sh
#2. Install the script & create new 'client'
bash openvpn-install.sh
#3. (OPTIONAL) To enable multiple connections per client
echo "duplicate-cn" >> /etc/openvpn/server.conf
#4. Restart openvpn service
@ijasxyz
ijasxyz / nah?.sh
Last active November 14, 2018 16:15
# famous alias 'nah' with confirmation
# created after loosing uncommitted work using 'nah' in a wrong work
# this will show the changed files in the directory before cleaning them.
function nah(){
echo
git status
echo
echo -e "\e[1m\e[91mDo you wish to reset the repo?\e[39m"
echo
@ijasxyz
ijasxyz / ubuntu_agnoster_install.md
Created November 5, 2018 19:25 — forked from renshuki/ubuntu_agnoster_install.md
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

sudo -i # to continue as root
df -Th #list devices
umount {path_to_the_readonly_device}
dosfsck {filesystem_path}
#repair any bad sectors.
@ijasxyz
ijasxyz / filters.php
Last active November 1, 2016 10:07
Trim all input values in Laravel 4
<?php
/*
* In Laravel Filters...
*/
App::before(function (\Illuminate\Http\Request $request)
{
$request->merge(
array_map_recursive(
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related