Skip to content

Instantly share code, notes, and snippets.

View dongilbert's full-sized avatar
😍
Mautic WOOOO

Don Gilbert dongilbert

😍
Mautic WOOOO
View GitHub Profile
@dongilbert
dongilbert / create_file_hashes.php
Last active October 2, 2015 09:18
This script outputs an array of file hashes recursively for the current directory. Useful for generating hashlist for security scanning programs.
<?php
/**
* This script outputs an array of file hashes recursively for the current directory.
* Useful for generating hashlist for security scanning programs
*
*/
function recursive_md5($dir, $types = null, $recursive = true, $baseDir = '')
{
$to_ignore = array(
'.',
@renekreijveld
renekreijveld / joomlaupdate
Last active September 17, 2021 13:12
This bash script will update your Joomla 2.5/3.1 website to the latest Joomla version. It does this by automatically downloading the correct update zipfile from Joomla.org. The script also executes the sql update commads (if needed). If specified joomlaupdate will make a backup of your website and database before updating. Joomlaupdate can also …
#!/bin/sh
# joomlaupdate
# Updates your Joomla 2.5/3.1 website to the latest version.
#
# Usage: joomlaupdate [-s] [-b] [-h] [-l]
#
# Default action is verbose on, no backup.
# -s Silent. Do not display any informational messages.
# -b Backup. Create a backup before updating.
@BloodAxe
BloodAxe / setup.sh
Last active January 3, 2018 15:59
Configure DigitalOcean Droplet for cloud image processing
# Prepare system
apt-get update
apt-get upgrade
apt-get install build-essential
apt-get install cmake
apt-get install git
apt-get install pkg-config
# Grab frest opencv library
curl -sL https://github.com/Itseez/opencv/archive/master.zip > opencv.zip
@aholmes
aholmes / Traverse.php
Last active January 2, 2016 14:49
The OOP version of https://igor.io/2014/01/08/functional-library-traversal.html for ghits and shiggles.
<?php
class Traverse implements ArrayAccess {
protected $container;
function __construct($array) {
$this->container = $array;
}
public function offsetExists($offset) {
return isset($this->container[$offset]);
}
@mbabker
mbabker / passwordReset.php
Last active August 29, 2015 13:58
This CLI script enables site administrators to require their site users to reset their password if they have not done so within a specified number of days
<?php
/**
* Password Reset Script
*
* This command line script can be run as a cron job or on user request to flag user accounts on a site
* as requiring their passwords reset. This script flags all users who have not reset their passwords
* in the number of days specified by the user and compares to the lastResetTime column in the #__users
* table.
*
* The number of days can be specified in one of two manners:
@tjamps
tjamps / README.md
Last active March 19, 2025 00:30
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :