Skip to content

Instantly share code, notes, and snippets.

jose jareis

Block or report user

Report or block jareis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jareis
jareis / skeleton-daemon.sh
Created May 23, 2017 — forked from shawnrice/skeleton-daemon.sh
A template to write a quick daemon as a bash script
View skeleton-daemon.sh
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@jareis
jareis / backup
Created Mar 1, 2017
Simple backup script
View backup
#!/bin/sh
# Local Source
SOURCE=
# Local Destination
DESTINATION=
# Database Backup User
DATABASE=''
View install-joomla-extension.php
<?php
/**
* Command-line extension installer. This file is meant to be copied into your Joomla! 3 site's cli directory.
*/
// Define ourselves as a parent file
define('_JEXEC', 1);
// Required by the CMS
define('DS', DIRECTORY_SEPARATOR);
@jareis
jareis / tree.php
Last active Aug 29, 2015
Generates a parent child tree from object or array
View tree.php
<?php
class Tree
{
private $data = array();
public $rendered;
public function __construct(&$Input)
{
@jareis
jareis / .htaccess
Last active Oct 22, 2015
My htaccess.
View .htaccess
#Disable Server signature
ServerSignature Off
# no folder listing
Options All -Indexes
# Follow symlinks?
# Options +FollowSymlinks
# pass the default character set
AddDefaultCharset utf-8
@jareis
jareis / index.php
Last active Aug 29, 2015
Compress XHTML page
View index.php
<?php
/* start the output buffer */
ob_start('compress_page');
?>
<!-- all xhtml content here -->
<?php
/* end the buffer, echo the page content */
ob_end_flush();
/* function that gets rid of tabs, line breaks, and extra spaces */
function compress_page($buffer)
@jareis
jareis / fn.slugify.sql
Created Jun 18, 2014
slugify function for MySQL
View fn.slugify.sql
/*
The MIT License (MIT)
Copyright (c) 2014 jose reis<jose.reis@artbit.pt>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
You can’t perform that action at this time.