Skip to content

Instantly share code, notes, and snippets.

View ddelrio1986's full-sized avatar

Daniel Del Rio ddelrio1986

  • eLearning Innovations
  • Seminole, Florida, United States of America
View GitHub Profile
@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.
@ericlbarnes
ericlbarnes / PewPewPew.php
Created May 7, 2020 15:12
Hold up... Wait a minute... It's a Laravel Chopper
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class PewPewPew extends Command
{
protected $signature = 'pewpewpew';
protected $description = 'Command description';
@samthor
samthor / dialog-focus-restore.js
Last active December 1, 2023 14:39
Restore focus after a HTML dialog is shown modally
/**
* Updates the passed dialog to retain focus and restore it when the dialog is closed. Won't
* upgrade a dialog more than once. Supports IE11+ and is a no-op otherwise.
* @param {!HTMLDialogElement} dialog to upgrade
*/
var registerFocusRestoreDialog = (function() {
if (!window.WeakMap || !window.MutationObserver) {
return function() {};
}
var registered = new WeakMap();
@LeaVerou
LeaVerou / dabblet.css
Created May 31, 2017 15:36
Diagonally colored text, with fallback
/**
* Diagonally colored text, with fallback
* Inspired from http://servicedesigndays.com/
*/
h1 {
max-width: 4.5em;
font: bold 300%/1 Helvetica Neue, sans-serif;
color: white;
}
@w00fz
w00fz / sphp.sh
Last active February 7, 2022 00:12
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@Koopzington
Koopzington / BarService.php
Last active November 29, 2018 13:58 — forked from grizzm0/BarService.php
Various examples of Dependency Injection done right using Zend Framework's ServiceManager and Psr\Container
<?php
namespace Application\Service;
use DateTime;
class BarService
{
protected $dateTime;
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active November 11, 2024 15:23
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@grizzm0
grizzm0 / Foo.php
Last active August 9, 2021 14:13
Best practice form/input-filter setup for ZF3
<?php
namespace Application\Entity;
/**
* Class Foo
*
* @package Application\Entity
*/
class Foo
{
@vitorbritto
vitorbritto / rm_mysql.md
Last active November 5, 2024 05:41
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing