Skip to content

Instantly share code, notes, and snippets.

View Idnan's full-sized avatar

Adnan Ahmed Idnan

View GitHub Profile
@Idnan
Idnan / RestControllerTrait.php
Last active February 6, 2023 11:35
Laravel Lumen: RESTful trait
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait {
public function index() {
$model = self::MODEL;
@Idnan
Idnan / _ide_helper.php
Created March 19, 2016 15:21 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.1.31 (LTS) on 2016-03-01.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@Idnan
Idnan / gist:f52da684b7f4f6ed55250715fdd1a4e0
Last active June 23, 2016 07:40 — forked from lukas-vlcek/gist:6039115
Torturing Word Delimiter TokenFilter in ElasticSearch
#!/bin/sh
curl -X DELETE 'localhost:9200/i/'
curl -X POST 'localhost:9200/i/' -d '{
"settings" : {
"analysis" : {
"analyzer" : {
"crazy" : {
"type" : "custom",
@Idnan
Idnan / bigfoot.zsh-theme
Created August 1, 2016 13:34
Oh My Zsh Theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='
%{$fg_bold[yellow]%}%! =>%{$reset_color%} %{$fg_bold[white]%}%*%{$reset_color%} : %{$fg_bold[red]%}%n%{$reset_color%} %{$fg_bold[yellow]%}@%{$reset_color%} %{$fg_bold[cyan]%}%M%{$reset_color%} %{$fg_bold[yellow]%}${PWD/#$HOME/~}% %{$fg_bold[blue]%} $(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@Idnan
Idnan / guzzle-custom-curlfactory.php
Created August 23, 2016 13:13 — forked from puckbag/guzzle-custom-curlfactory.php
Custom Guzzle CurlFactory
<?php
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlFactory;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\Handler\CurlMultiHandler;
use GuzzleHttp\Handler\EasyHandle;
@Idnan
Idnan / new_user.sh
Created August 14, 2017 13:50 — forked from meabed/new_user.sh
OVH Ubuntu Kernel
#!/bin/bash
#
# #############################################################################
# Create new SSH user (Ubuntu)
# 1) Download the "raw" with - wget -O createNewSSHUser.sh
# 2) Make it executable with - chmod a+x createNewSSHUser.sh
# 5) Immediately set a new password by logging in once with -
# su newUsrName
# #############################################################################
#
@Idnan
Idnan / iterm2-solarized.md
Created February 22, 2018 07:34 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@Idnan
Idnan / sublime-command-line.md
Created February 27, 2018 13:38 — forked from adrianorsouza/sublime-command-line.md
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@Idnan
Idnan / HOWTO.md
Created April 4, 2018 07:42 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@Idnan
Idnan / sample.log
Last active September 29, 2018 10:12
API Logs
2018-05-23T09:00:29+0000 [10.10.0.100::192.168.99.1][]:[DEBUG][799.9999][POST http://api.local:8080/cart/order-69a2397b-e6d3-4967-bd22-706c4c19daa2/coupon/cap800][PostmanRuntime/7.1.1][][5105008][0]
2018-05-23T09:00:29+0000 [10.10.0.100::192.168.99.1][]:[DEBUG][799.9999][POST http://api.local:8080/cart/order-69a2397b-e6d3-4967-bd22-706c4c19daa2/coupon/cap800][PostmanRuntime/7.1.1][][5104944][0]
2018-05-23T09:04:49+0000 [10.10.0.100::192.168.99.1][]:[ERROR][Call to undefined function PHPSTORM_META\type()][POST http://api.local:8080/cart/order-69a2397b-e6d3-4967-bd22-706c4c19daa2/coupon/cap800][PostmanRuntime/7.1.1][][4911344][0] #0 /var/www/api/vendor/src/Base/Order/CartOrderAttributeTrait.php(1305): Base\Order\CartModel->calculateTotal() #1 /var/www/api/vendor/src/Base/Order/CartOrderAttributeTrait.php(2047): Base\Order\CartModel->collectTotals() #2 /var/www/api/vendor/src/Base/Order/CartOrderAttributeTrait.php(992): Base\Order\CartModel->collectTotal() #3 /var/www/api/vendor/src/Base/Order/CartModel.php(221)