Skip to content

Instantly share code, notes, and snippets.


appkr appkr

View GitHub Profile
View CQS_and_CQRS.cs
// CQS (Command-Query Separation)
// Bertrand Meyer devised the CQS principle
// It states that every method should either be a command that performs an action, or a
// query that returns data to the caller, but not both. In other words, asking a question
// should not change the answer. More formally, methods should return a value only if they
// are referentially transparent and hence possess no side effects.
// Example:
public class CustomerService
appkr /
Created May 9, 2017 — forked from redism/
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
"₩" = ("insertText:", "\`");
appkr / CastsValueObject.php
Created Mar 15, 2017 — forked from cmaas/CastsValueObject.php
A Trait to automatically cast value objects in Laravel without needing a Mutator and an Accessor.
View CastsValueObject.php
trait CastsValueObjects
protected function castAttribute($key, $value)
$castToClass = $this->getValueObjectCastType($key);
// no Value Object? simply pass this up to the parent
if (!$castToClass) {
return parent::castAttribute($key, $value);
View lumen_ide_helper.php
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18.
* @author Barry vd. Heuvel <>
* @see
namespace {
View docker-workflow-demo.groovy
node {
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
// We are pushing to a private secure docker registry in this demo.
appkr / SnsBroadcaster.php
Created Oct 22, 2016 — forked from jeskew/SnsBroadcaster.php
Laravel broadcasting with SNS
View SnsBroadcaster.php
use Aws\Sns\SnsClient;
use Illuminate\Contracts\Broadcasting\Broadcaster;
class SnsBroadcaster implements Broadcaster
/** @var SnsClient */
private $sns;
/** @var array */
View gist:7d85ab9c9ceb6c675f1c88a8c3f5f73c
auto_register = new Object();
auto_register.add_member = function(member_id, group_id, ignore, callback) {
x = new XMLHttpRequest();
x.onreadystatechange = function() {
if (x.readyState == 4) {
if (x.status == 200) {
if (callback)
callback(member_id, group_id);
console.log('success', member_id);
} else
appkr / Contract Killer
Created Feb 27, 2016 — forked from malarkey/Contract Killer
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post