Skip to content

Instantly share code, notes, and snippets.

@elioair
elioair / joomlapagetitle.php
Last active Mar 21, 2016
get joomla page title
View joomlapagetitle.php
#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 / gist:ec5ad8094ba30ae48347
Created Dec 31, 2015 — 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
View gist:ec5ad8094ba30ae48347
<?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 / register.blade.php
Created Nov 1, 2015
Chesscaptcha and Laravel registration form view.
View register.blade.php
<?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 / createapachesite
Last active Oct 4, 2015
Script to create a website in apache in a LAMP stack.
View createapachesite
#!/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 / getting_joomla_mod_plg_tmp_params.md
Last active Nov 20, 2021
Getting Joomla! module, template & plugin parameters.
View getting_joomla_mod_plg_tmp_params.md

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

Plugin parameters from inside a plugin

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

Plugin parameters from outside a plugin

@elioair
elioair / gulpfile.js
Created Jul 8, 2015
Auto-reload browser from gulp server on file edit.
View gulpfile.js
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 / steps_gulp_livereload_simple
Created Jul 7, 2015
Gulp Livereload auto reload browser.
View steps_gulp_livereload_simple
/*
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