Skip to content

Instantly share code, notes, and snippets.

View nicoaudy's full-sized avatar

Nico Audy nicoaudy

View GitHub Profile
@nicoaudy
nicoaudy / CI_phpStorm.php
Created February 4, 2016 04:23 — forked from topdown/CI_phpStorm.php
Code Completion for CodeIgniter in phpStorm
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
syntax enable
colorscheme desert
"-------------General Settings--------------"
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader = ',' "The default leader is \, but a comma is much better.
set number "Let's activate line numbers.
{
"color_scheme": "Packages/User/SublimeLinter/InspiredGitHub (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"findreplace_small": true,
"font_face": "Fira Code",
"font_size": 11,
"highlight_line": false,
"hot_exit": false,
"ignored_packages":
[
@nicoaudy
nicoaudy / laravel.js
Created May 2, 2017 07:28 — forked from soufianeEL/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@nicoaudy
nicoaudy / bash
Created March 21, 2018 04:25
composer error mismatch. make confusing. this is how to solved
composer config -g repo.packagist composer https://packagist.phpcomposer.com
@nicoaudy
nicoaudy / .vimrc
Created September 7, 2018 02:06
.vimrc ubuntu kantor
set nocompatible " be iMproved, required
filetype off " required <<========== We can turn it on later
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@nicoaudy
nicoaudy / vim.md
Created September 17, 2018 08:42
Vim cheat set

Vim Commands Cheat Sheet

How to Exit

Command Description
:q[uit] Quit Vim. This fails when changes have been made.
:q[uit]! Quit without writing.
:cq[uit] Quit always, without writing.
@nicoaudy
nicoaudy / ctags.setup
Created November 10, 2018 01:25 — forked from nazgob/ctags.setup
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@nicoaudy
nicoaudy / BaseController.php
Created December 13, 2018 08:52 — forked from thepsion5/BaseController.php
Example of using A Laravel Controller to automatically handle validation exceptions and auth failures
<?php
class BaseController extends Controller
{
public function callAction($method, $params)
{
$ajax = Request::isAjax();
try {
return parent::callAction($method, $params);
@nicoaudy
nicoaudy / ApiController.php
Created April 27, 2019 08:00
trait for api
<?php
namespace App\Http\Traits;
use Illuminate\Http\Response;
trait ApiController {
/**
* @var int
*/