Skip to content

Instantly share code, notes, and snippets.

@elioair
elioair / steps_gulp_livereload_simple
Created July 7, 2015 12:04
Gulp Livereload auto reload browser.
/*
Reload the page on file change.
At first it took me a while to figure out how to setup the server from
the gruntfile to work with livereload and automatically reload the page in the browser.
Here are the steps that worked for me - it needs some fine tuning though.
*/
Useful links:
-------------
https://www.npmjs.com/package/gulp-connect
@elioair
elioair / gulpfile.js
Created July 8, 2015 10:31
Auto-reload browser from gulp server on file edit.
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
less = require('gulp-less'),
connect = require('gulp-connect'),
minifyCSS = require('gulp-minify-css');
gulp.task('connect', function() {
connect.server({
root: 'files',
livereload: true,
@elioair
elioair / createapachesite
Last active October 4, 2015 00:34
Script to create a website in apache in a LAMP stack.
#!/bin/bash
# permissions
if [ "$(whoami)" != "root" ]; then
echo "Not enough privileges. Run this with sudo."
exit
fi
echo Please, enter website domain [of the form domainname.dev]
read NAME
@elioair
elioair / register.blade.php
Created November 1, 2015 23:13
Chesscaptcha and Laravel registration form view.
<?php
////////////////////////////////////////////////////////////////////
// Read the full tutorial on Chesscaptcha and Laravel here: //
// http://dev.emar.gr/blog/laravel-5-chess-captcha-authentication //
////////////////////////////////////////////////////////////////////
// The array that contains the configuration for the php side
$config = [
'divId'=>'chesscaptcha',
'whitesquare'=>'#f0d9b5',
@elioair
elioair / gist:ec5ad8094ba30ae48347
Created December 31, 2015 18:30 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@elioair
elioair / joomlapagetitle.php
Last active March 21, 2016 19:08
get joomla page title
#Get Page Title#
$doc = JFactory::getDocument();
$page_title = $doc->getTitle();
#Set Page Title#
$con = JFactory::getConfig();
$sitename = $con->getValue('config.sitename'); $
doc->setTitle($page_title.' - '.$sitename);
@elioair
elioair / getting_joomla_mod_plg_tmp_params.md
Last active November 20, 2021 21:24
Getting Joomla! module, template & plugin parameters.

==================================================== Getting Joomla! module, template & plugin parameters

Plugin parameters from inside a plugin

$param = $this->params->get('paramName', defaultValue);

Plugin parameters from outside a plugin