Skip to content

Instantly share code, notes, and snippets.

View Idnan's full-sized avatar

Adnan Ahmed Idnan

View GitHub Profile
@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 / 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 / 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 / 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 / _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 / 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;