Skip to content

Instantly share code, notes, and snippets.

View arleighdickerson's full-sized avatar
🇺🇲
🏴󠁵󠁳󠁯󠁨󠁿 Always has been

Arleigh Dickerson arleighdickerson

🇺🇲
🏴󠁵󠁳󠁯󠁨󠁿 Always has been
View GitHub Profile
@arleighdickerson
arleighdickerson / Underscore.php
Last active February 24, 2016 23:13
No attempt at being canonical
<?php
namespace common\helpers;
use yii\base\UnknownPropertyException;
use yii\helpers\ArrayHelper;
/**
* @author Arleigh Dickerson
*
@arleighdickerson
arleighdickerson / bootstrap.php
Last active June 11, 2017 23:00
Helper functions living in the global namespace. Drop into bootstrap
<?php
use ProxyManager\Factory\AccessInterceptorValueHolderFactory;
use React\ChildProcess\Process;
use React\EventLoop\LoopInterface;
use React\Filesystem\Filesystem;
use React\Filesystem\FilesystemInterface;
use React\Promise\PromiseInterface;
Yii::$container
"xte 'keydown Super_L' 'key w' 'keyup Super_L'"
b:8
"xte 'keydown Return' 'keyup Return'"
release+b:8
"xte 'keydown Super_L' 'key s' 'keyup Super_L'"
b:2
<?php
namespace console\controllers;
use Yii;
use yii\console\Controller;
use yii\helpers\Json;
use yii\helpers\FileHelper;
<?php
/**
* A trait to add silent prompts to Yii2 Console Controller
* Requires bash shell
*/
trait SilentPromptingTrait {
/**
* @see http://www.dzone.com/snippets/password-prompt-php
* Interactively prompts for input without echoing to the terminal.
* Requires a bash shell and won't work with safe_mode settings (Uses `shell_exec`)
@arleighdickerson
arleighdickerson / seamod_rings.lua
Created December 3, 2015 23:19
Conky seamod rings for 8 core cpu
--==============================================================================
-- seamod_rings.lua
--
-- Date : 05/02/2012
-- Author : SeaJey
-- Version : v0.1
-- License : Distributed under the terms of GNU GPL version 2 or later
--
-- This version is a modification of lunatico_rings.lua wich is modification of conky_orange.lua
--
<?php
namespace console\controllers;
use yii\helpers\StringHelper;
use yii\console\Controller;
use Yii;
abstract class SimulationController extends Controller {
public $defaultAction = 'default';
@arleighdickerson
arleighdickerson / ClientUrls.php
Last active March 26, 2016 14:04
Utility to make working with yii routes easier on the client side
<?php
namespace common\helpers;
use yii\base\InvalidParamException;
use yii\helpers\Json;
use yii\helpers\Url;
class ClientUrls {
echo 8589934590 > /proc/sys/kernel/shmmax
echo 4096 > /proc/sys/vm/nr_hugepages
exit 0
<?php
namespace common\components;
use Aws\S3\S3Client;
use yii\caching\Cache;
use yii\helpers\ArrayHelper;
class S3Cache extends Cache {