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 / ThemeAutoloader.php
Created August 11, 2016 04:04
Autoload theme-specific controllers
<?php
namespace frontend\components;
use Yii;
/**
* Class ThemeAutoloader
*
* @package frontend\components
@arleighdickerson
arleighdickerson / init.lua
Last active November 28, 2016 17:10
init.lua for hammerspoon... tap caps lock for escape, hold for ctrl, shift and caps lock tap sends shift escape
-- adapted from https://gist.github.com/arbelt/b91e1f38a0880afb316dd5b5732759f1
-- if shift key is held during a caps lock tap, send shift-escape
ctrl_table = {
send_escape = true,
last_mods = {}
}
control_key_timer = hs.timer.delayed.new(0.15, function()
ctrl_table["send_escape"] = false
-- log.i("timer fired")
<?php
namespace console\stream;
use phpseclib\Crypt\Base;
use React\Stream\ThroughStream;
class CipherTransform extends ThroughStream {
const OP_ENCRYPT = 'encrypt';
const OP_DECRYPT = 'decrypt';
-server
-ea
-Xms4096m
-Xmx8192m
-XX:+UseStringDeduplication
-XX:+AggressiveOpts
-XX:+UseG1GC
-XX:MaxGCPauseMillis=100
-XX:G1HeapRegionSize=2
-XX:ParallelGCThreads=8
@arleighdickerson
arleighdickerson / watch.js
Created December 24, 2017 17:25
hot reloading of server-side feathersjs application (put this in src/)
const logger = require('winston');
const invalidate = require('invalidate-module');
const { resolve } = require('path');
const chokidar = require('chokidar');
process.on('unhandledRejection', (reason, p) => {
logger.error('Unhandled Rejection at: Promise ', p, reason);
});
const src = (...args) => resolve(__dirname, ...args);
@arleighdickerson
arleighdickerson / MsgpackSerializer.php
Last active January 12, 2018 13:13
Msgpack serialization support for voryx/thruway wamp2 implementation
<?php
namespace Thruway\Serializer;
use MessagePack; // composer dep rybakit/msgpack": "^0.2.2",
use Thruway\Message\Message;
use Thruway\Message\MessageException;
class MsgpackSerializer implements SerializerInterface {
/**
@arleighdickerson
arleighdickerson / php.ini
Created January 14, 2018 17:21
/etc/hhvm/php.ini
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
hhvm.php7.all = true
hhvm.php7.builtins= true
hhvm.jit_enable_rename_function = true
xdebug.idekey = PHPSTORM
xdebug.enable = 1
@arleighdickerson
arleighdickerson / create-windows-live-usb.sh
Last active December 16, 2018 01:00
Create bootable windows stick
#!/bin/bash
# ========================================
# For /dev/sdXn,
# X is one of a,b,c,...
# n is one of 1,2,3,...
# ========================================
# see https://wiki.archlinux.org/index.php/USB_flash_installation_media#Using_manual_formatting
#!/bin/bash
# ============================================================================
# entrypoint.sh
#
# An entrypoint that blocks until one or more TCP hosts become availabile
# ============================================================================
set -e
@arleighdickerson
arleighdickerson / asyncBuilder.js
Last active July 30, 2018 18:42
asynchronously configure a feathers application
// ============================================================================
// Author: Arleigh Dickerson
// (adapted from https://github.com/eliaslfox/lazy-chain)
// ============================================================================
const _ = require('lodash');
const Deferred = require('./Deferred');
const pipe = Symbol('asyncBuilder.lazyHander.pipe');
const lazyHandler = app => ({