Skip to content

Instantly share code, notes, and snippets.

View drakakisgeo's full-sized avatar

Drakakis George drakakisgeo

View GitHub Profile
1) Show lines when opening files. Add the -C flag
``` nano -C file.txt ```
2) Go to line.
``` CTRL+SHIFT+_ ```
3) Select block of text
@drakakisgeo
drakakisgeo / gist:3431832d83193465dcd94ac8e53353e9
Created September 27, 2019 09:45
(ISO 3166-1 alpha-2) inline php Array
$countries = array('AF' => 'Afghanistan', 'AX' => 'Aland Islands', 'AL' => 'Albania', 'DZ' => 'Algeria', 'AS' => 'American Samoa', 'AD' => 'Andorra', 'AO' => 'Angola', 'AI' => 'Anguilla', 'AQ' => 'Antarctica', 'AG' => 'Antigua And Barbuda', 'AR' => 'Argentina', 'AM' => 'Armenia', 'AW' => 'Aruba', 'AU' => 'Australia', 'AT' => 'Austria', 'AZ' => 'Azerbaijan', 'BS' => 'Bahamas', 'BH' => 'Bahrain', 'BD' => 'Bangladesh', 'BB' => 'Barbados', 'BY' => 'Belarus', 'BE' => 'Belgium', 'BZ' => 'Belize', 'BJ' => 'Benin', 'BM' => 'Bermuda', 'BT' => 'Bhutan', 'BO' => 'Bolivia', 'BA' => 'Bosnia And Herzegovina', 'BW' => 'Botswana', 'BV' => 'Bouvet Island', 'BR' => 'Brazil', 'IO' => 'British Indian Ocean Territory', 'BN' => 'Brunei Darussalam', 'BG' => 'Bulgaria', 'BF' => 'Burkina Faso', 'BI' => 'Burundi', 'KH' => 'Cambodia', 'CM' => 'Cameroon', 'CA' => 'Canada', 'CV' => 'Cape Verde', 'KY' => 'Cayman Islands', 'CF' => 'Central African Republic', 'TD' => 'Chad', 'CL' => 'Chile', 'CN' => 'China', 'CX' => 'Christmas Island', 'CC'
@drakakisgeo
drakakisgeo / Postmarkable.php
Last active April 9, 2019 21:02
Postmark Trait for Laravel Mailable - (Support for Tag and Meta)
<?php
namespace App\Billit\Traits;
trait Postmarkable
{
/**
* @param array $tags
*/
public function setTag(array $tag): void
@drakakisgeo
drakakisgeo / Upgrading phpmyadmin
Created February 6, 2019 13:54
Upgrading phpmyadmin for apache php7.2 - Ubuntu 18.04
cd /usr/share/
sudo mv phpmyadmin/ phpmyadmin-4.8.5/
sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.zip
sudo unzip phpMyAdmin-4.8.5-all-languages.zip
sudo ln -s phpMyAdmin-4.8.5-all-languages phpmyadmin
sudo chown -R www-data:www-data /usr/share/phpmyadmin
sudo chmod -R 755 /usr/share/phpmyadmin
sudo service apache2 restart
@drakakisgeo
drakakisgeo / moneyInput.vue
Last active October 19, 2018 10:30
Vue input field for money. ( Masks amount and always return a decimal )
<template>
<cleave v-model="money" :options="options"></cleave>
</template>
<script>
import Cleave from 'vue-cleave-component';
export default {
props:{
value: {
@drakakisgeo
drakakisgeo / gist:48dcab1539612c82449b9757940ac7ee
Last active August 29, 2022 02:41
Print Access Token from Laravel Passport
<?php
namespace App\Traits;
use App\User;
use DateTime;
use GuzzleHttp\Psr7\Response;
use Illuminate\Events\Dispatcher;
use Laravel\Passport\Bridge\AccessToken;
use Laravel\Passport\Bridge\AccessTokenRepository;
@drakakisgeo
drakakisgeo / gist:44f54ef8d65380fa228dd595d1281e1a
Created December 22, 2017 14:43
Working with Init Input and old() data from laravel in VueJs
//////---------- in Controller @edit method
// set a variable with all needed initialized input (key value pairs)
$initInput = []
$initInput = setInitInput($initInput);
// The setInitInput helper function, basically merges with old() input
function setInitInput(array $input){
$oldInput = session()->getOldInput();
unset($oldInput['_token']);
@drakakisgeo
drakakisgeo / Vue input component setup
Created November 20, 2017 12:31
Example of how to build a Vue.js input component
<template>
<select :value="value" :name="name" class="form-control" v-on:input="updatevalue($event.target.value)" ref="input">
<slot></slot>
</select>
</template>
<script>
export default {
props:['value','name'],
methods: {
@drakakisgeo
drakakisgeo / select2-remove-border-radius.css
Created November 7, 2017 14:39
Remove 4px border-radius from Select2
.select2 {
border-color:1px solid #cacaca;
box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
background-color:#fefefe;
}
.select2-dropdown, .select2-container--default .select2-selection--single ,
.select2-container--default .select2-selection--multiple, .select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--classic .select2-selection--multiple , .select2-container--classic .select2-selection--multiple,
.select2-container--classic .select2-selection--multiple .select2-selection__choice, .select2-dropdown,
@drakakisgeo
drakakisgeo / Zurb foundation 6.4 paginator for Laravel
Created October 2, 2017 18:10
Zurb foundation 6.4 paginator for Laravel
@if ($paginator->hasPages())
<ul class="pagination" role="navigation" aria-label="Pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="pagination-previous disabled"></li>
@else
<li class="pagination-previous"><a href="{{ $paginator->previousPageUrl() }}" aria-label="Previous page"></a></li>
@endif
{{-- Pagination Elements --}}