This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$chars = array_merge(range('a', 'z'), range('A','Z'), range(0,9), [' ', ',', "'"]); | |
shuffle($chars); | |
$table = []; | |
$header = ' '; | |
foreach (range(1,8) as $row) { | |
$header .= " $row "; | |
$table[$row] = array_slice($chars, ($row-1)*8, 8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` | |
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` | |
# Determine if a file list is passed | |
if [ "$#" -eq 1 ] | |
then | |
oIFS=$IFS | |
IFS=' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1MUfF2w9PAE9rVmxA3DYzCNrScKwPruQTc https://explorer.blockstack.org/address/1MUfF2w9PAE9rVmxA3DYzCNrScKwPruQTc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O ~/.ssh/authorized_keys -o /dev/null https://github.com/johncongdon.keys | |
chmod 600 ~/.ssh/authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/php | |
<?php | |
# PHP LINTING | |
$output = array(); | |
$return = 0; | |
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return); | |
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904'; | |
exec("git diff-index --diff-filter=ACMRTUXB --cached --name-only {$against}", $output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$auto = $_POST['auto']; | |
error_reporting(E_ALL ^ E_NOTICE); | |
ini_set(display_errors,1); | |
require_once('../INCLUDES/db.func.php'); | |
connect('localhost','*****','*****','*****'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Purpose: To have a Dependency Injected cache (we can change caching source easily) | |
* Question: Does throwing if not in cache make sense? This allows me to store FALSE as a value. | |
*/ | |
class blah { | |
public function removeCachedKey($key) { } | |
public function putIntoCache($key, $value, $expirationTime = 3600) | |
{ | |
$cache = self::$cache; | |
if ($cache && method_exists($cache, 'set')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Set the current page name in a mysql variable | |
* | |
* This will be useful when the general_log is turned on and | |
* you want to drill down to a find out where these queries are running. | |
*/ | |
$page = mysql_real_escape_string($_SERVER['REQUEST_URI']); | |
mysql_query("SET @page='$page'"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Changed based on feedback from rdohms | |
*/ | |
$requiredFields = array( | |
'price', | |
'name', | |
'description', | |
'type', | |
'shippingCost', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@homestead:~/Projects/DiegoDev/CrimeWorldMafia/api$ php artisan migrate:refresh | |
PHP Fatal error: Class 'CreateUserFinancesTable' not found in /home/vagrant/Projects/DiegoDev/CrimeWorldMafia/api/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php on line 297 | |
PHP Stack trace: | |
PHP 1. {main}() /home/vagrant/Projects/DiegoDev/CrimeWorldMafia/api/artisan:0 | |
PHP 2. Symfony\Component\Console\Application->run() /home/vagrant/Projects/DiegoDev/CrimeWorldMafia/api/artisan:59 | |
PHP 3. Symfony\Component\Console\Application->doRun() /home/vagrant/Projects/DiegoDev/CrimeWorldMafia/api/vendor/symfony/console/Symfony/Component/Console/Application.php:121 | |
PHP 4. Symfony\Component\Console\Application->doRunCommand() /home/vagrant/Projects/DiegoDev/CrimeWorldMafia/api/vendor/symfony/console/Symfony/Component/Console/Application.php:191 | |
PHP 5. Illuminate\Console\Command->run() /home/vagrant/Projects/DiegoDev/CrimeWorldMafia/api/vendor/symfony/console/Symfony/Component/Console/Application.php:88 |
NewerOlder