Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View richsage's full-sized avatar

Rich Sage richsage

View GitHub Profile
@richsage
richsage / lib.php
Created March 15, 2022 08:47
Moodle Redis TLS support
protected function new_redis($server, $prefix = '', $password = '') {
$redis = new Redis();
// Check if it isn't a Unix socket to set default port.
$port = ($server[0] === '/') ? null : 6379;
// NOTE: This is the change we added
// You can supply eg tls://my.redis.host:6380/ for it to work
// Check for any protocol requirements eg TLS that have been specified.
if (strpos($server, ':')) {
$serverconf = parse_url($server);
@richsage
richsage / .gitconfig
Created May 30, 2017 10:34
global ignores. both files go in the root of your home directory
[core]
excludesfile = /Users/<your user>/.gitignore_global
@richsage
richsage / Fastfile
Created February 10, 2016 12:26
Fastfile configuration for promoting builds from QA to beta
platform :ios do
lane :qa do
increment_build_number
# Produce the build here
commit_version_bump
add_git_tag
push_to_git_remote
<?php
// Acme\DemoBundle\Twig\GravatarExtension
namespace Acme\DemoBundle\Twig;
class GravatarExtension extends \Twig_Extension
{
private $secure_request = false;

Here are some tips to help print your music successfully: (It is very important that you follow these steps from start to finish before attempting to print again)

  1. Restart your computer and printer.
  2. Use the most up to date Internet Explorer, Safari, or Mozilla Firefox.
  3. Close all other applications.
  4. Delete cookies and cache memory. (Simple guides can be located in google.)
  5. Uninstall and reinstall the recommended software. ( Adobe Air, Adobe Flash, and SMP Application)

Keybase proof

I hereby claim:

  • I am richsage on github.
  • I am richsage (https://keybase.io/richsage) on keybase.
  • I have a public key whose fingerprint is 3039 674C 2D35 46F5 9FF1 FE1D 792D C359 F082 396B

To claim this, I am signing this object:

<?php
namespace Acme\DemoBundle\Security\Encoder;
use Symfony\Component\Security\Core\Encoder\BasePasswordEncoder;
class MySQLPasswordEncoder extends BasePasswordEncoder
{
/**
* {@inheritdoc}
<?php
class DefaultController extends Controller
{
/**
* Dashboard page.
* @Permissions(perm="dashboard_view")
* @Route("/", name="ITEDashboardBundle_index")
* @Template()
* @return array
@richsage
richsage / gist:1978182
Created March 5, 2012 12:43
errors lol
/**
* Gets all field errors
*
* @param $form
* @return array
*/
protected function getAllErrors($form)
{
$errors = array();
foreach ($form->getErrors() as $key => $error) {
services:
my.twig.helperextension:
class: My\OwnBundle\Twig\Extension\MyHelperExtension
tags:
- { name: twig.extension, alias: myhelperextension }
my.notificationsextension:
class: My\OwnBundle\Twig\Extension\NotificationsExtension
arguments:
container: "@service_container"
context: "@security.context"