Skip to content

Instantly share code, notes, and snippets.

View drakakisgeo's full-sized avatar

Drakakis George drakakisgeo

View GitHub Profile
@drakakisgeo
drakakisgeo / google-analytics-for-static-sites.sh
Created December 8, 2015 15:22 — forked from stevenscg/google-analytics-for-static-sites.sh
Add Google Analytics tracking to an existing static website
#!/bin/sh
#
# Add a Google Analytics tag to static website files
# @see http://adambuchanan.me/post/26345221717/updating-google-analytics-code-on-many-static-pages
# Tested on MacOS 10.8.X
#
# Usage:
# Set the GA parameters below
# Execute the script from the top-level of the static site
#
@drakakisgeo
drakakisgeo / GAFB
Created December 8, 2015 17:59
Add Google Analytics and FB tracking to html files
#!/bin/sh
FBCODE_ID='xxxxxxxxxx'
GACODE='xxxxxxxx'
FBBLOCK=$(cat <<EOF
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
@drakakisgeo
drakakisgeo / gist:4f33f18e2751247eebb3195c97645075
Last active April 27, 2016 11:35
How to change document root in Cpanel
You must edit the file:
/var/cpanel/userdata/USERNAME/DOMAIN.COM
and change the line:
documentroot: /home/USERNAME/public_html
to
documentroot: /home/USERNAME/public_html/DOMAIN.COM
@drakakisgeo
drakakisgeo / Check Spam source
Created December 2, 2016 07:58
Check Spam sourcein a shared server
grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n
More info at http://www.inmotionhosting.com/support/email/exim/find-spam-script-location-with-exim
@drakakisgeo
drakakisgeo / gist:e0d21a04cc7b0f888e373bd02d156534
Created January 31, 2017 16:30
Debug Sql queries executed in Laravel app
DB::enableQueryLog();
... query ...
... query ...
... query ...
... query ...
dd(DB::getQueryLog());
<?php
namespace App\Console\Commands;
use DB;
use Illuminate\Console\Command;
class ModelFactoryHelper extends Command
{
/**
@drakakisgeo
drakakisgeo / Greekports.json
Created September 25, 2017 11:24
Greek Ports destinations-departures pairs from forthcrs
{
"departures": {
"from": [
{
"code": "PNA",
@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 --}}
@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 / 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: {