Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View appkr's full-sized avatar
🎯
Focusing

appkr appkr

🎯
Focusing
View GitHub Profile
@appkr
appkr / CQS_and_CQRS.cs
Created July 1, 2017 11:34 — forked from kellabyte/CQS_and_CQRS.cs
CQS_and_CQRS
// 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
appkr / kr_won_to_backquote.sh
Created May 9, 2017 09:32 — forked from redism/kr_won_to_backquote.sh
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
#!/bin/bash
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
fi
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
{
"₩" = ("insertText:", "\`");
@appkr
appkr / CastsValueObject.php
Created March 15, 2017 03:34 — forked from cmaas/CastsValueObject.php
A Trait to automatically cast value objects in Laravel without needing a Mutator and an Accessor.
<?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);
@appkr
appkr / lumen_ide_helper.php
Created February 9, 2017 02:41 — forked from barryvdh/lumen_ide_helper.php
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 <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
node {
// https://registry.hub.docker.com/_/maven/
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.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.
@appkr
appkr / SnsBroadcaster.php
Created October 22, 2016 07:43 — forked from jeskew/SnsBroadcaster.php
Laravel broadcasting with SNS
<?php
use Aws\Sns\SnsClient;
use Illuminate\Contracts\Broadcasting\Broadcaster;
class SnsBroadcaster implements Broadcaster
{
/** @var SnsClient */
private $sns;
/** @var array */
@appkr
appkr / gist:7d85ab9c9ceb6c675f1c88a8c3f5f73c
Created August 26, 2016 07:01 — forked from egoing/gist:1f14bbe0cba467ccacfb
페이스북 자동 가입
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
appkr / Contract Killer 3.md
Created February 27, 2016 12:58 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

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