Skip to content

Instantly share code, notes, and snippets.

Avatar

cjaoude

View GitHub Profile
@cjaoude
cjaoude / SanityTable.vue
Created Nov 10, 2019
selectable + transitions bootstrap-vue table
View SanityTable.vue
<template>
<div>
<b-table
id="table-transition-example"
:items="items"
:fields="fields"
striped
small
primary-key="a"
selectable
@cjaoude
cjaoude / bash notes.md
Created Jan 30, 2017
Bash, made easy:
View bash notes.md

Run commands, by condition:

A; B    Run A and then B, regardless of success of A
A && B  Run B if A succeeded
A || B  Run B if A failed
A &     Run A in background.



@cjaoude
cjaoude / chmod-tutorial.md
Last active Dec 18, 2021
chmod tutorial / cheat sheet / cheatsheet / for dummies
View chmod-tutorial.md

chmod
Forget the chmod octals (the numbers). Set permission the easy way using the keywords

// know the ownerships:
u = User (you)
g = Group
o = Other (aka. 'World')
a = All of the above

@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active Jan 22, 2022
Test list of Valid and Invalid Email addresses
View gist:fd9910626629b53c4d25
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@cjaoude
cjaoude / snippet-laravel-all-routes
Created Jul 22, 2014
All resource routes by action, with route names. (Laravel Snippet)
View snippet-laravel-all-routes
<snippet>
<content><![CDATA[
Route::get('${1:resource}', [ 'uses' => '${3:Controller}@index', 'as' => '${1:resource}.index']);
Route::get('${1:resource}/create', [ 'uses' => '${3:Controller}@create' , 'as' => '${1:resource}.create']);
Route::post('${1:resource}', [ 'uses' => '${3:Controller}@store', 'as' => '${1:resource}.store']);
Route::get('${1:resource}/{${2:resource}}', [ 'uses' => '${3:Controller}@show' , 'as' => '${1:resource}.show']);
@cjaoude
cjaoude / laravel-all-resource-routes
Last active Aug 29, 2015
All resource routes by action, with route names. (Laravel)
View laravel-all-resource-routes
Route::get('resource', [ 'uses' => 'Controller@index', 'as' => 'resource.index']);
Route::get('resource/create', [ 'uses' => 'Controller@create' , 'as' => 'resource.create']);
Route::post('resource', [ 'uses' => 'Controller@store', 'as' => 'resource.store']);
Route::get('resource/{resource}', [ 'uses' => 'Controller@show' , 'as' => 'resource.show']);
Route::get('resource/{resource}/edit', [ 'uses' => 'Controller@edit' , 'as' => 'resource.edit']);
@cjaoude
cjaoude / delete custom macro
Last active Jan 7, 2016
Laravel Form custom delete macro
View delete custom macro
// Create a 'delete' form in a single line. This Laravel form macro is a shortcut that
// creates a form with a DELETE method and a 'Delete' button. This macro saves you
// the trouble of creating a form each time you need to make a delete route.
// Place this code in a app/macros.php file and require this file in global.php
// ref: http://laravel.com/docs/html#custom-macros
Form::macro('delete', function($options){
$open = Form::open([
'route' => [ $options['route'], $options['id'] ],
View tar snippets
// 'cuz the last thing anyone should need is to learn tar
// the trick to tar is, the -f flag needs to be the last option enumerated
// compress and archive folder | file
tar -zcf archive_name.tar.gz directory/file
// decompress archive
tar -zxf file.tar.gz
@cjaoude
cjaoude / htaccess_gists.txt
Last active Aug 29, 2015
Hide .git files and folders with .htaccess
View htaccess_gists.txt
RedirectMatch 404 "(?:.*)/(?:\.git|file_or_dir)(?:/.*)?$"