Skip to content

Instantly share code, notes, and snippets.

View appkr's full-sized avatar
🎯
Focusing

appkr appkr

🎯
Focusing
View GitHub Profile
@appkr
appkr / View.php
Created March 11, 2017 08:06
View.php
<?php
/**
* Slim - a micro PHP 5 framework
*
* @author Josh Lockhart <[email protected]>
* @copyright 2011-2017 Josh Lockhart
* @link http://www.slimframework.com
* @license http://www.slimframework.com/license
* @version 2.6.3
* @package Slim
@appkr
appkr / config.default.php
Created March 12, 2017 04:24
xhgui config
<?php
/**
* Default configuration for Xhgui
*/
return array(
'debug' => false,
'mode' => 'development',
// Can be either mongodb or file.
/*
@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 / rds_parameter_group.png
Last active March 20, 2017 12:17
rds_parameter_group_screenshot
rds_parameter_group.png
@appkr
appkr / lotto.js
Created April 5, 2017 00:33
lotto
const ball = ['foo', 'bar', 'baz', 'qux'];
const roll = (ball) => ball[Math.floor(Math.random() * ball.length)];
// console.log(`당첨자는 "${roll(ball)}" 님입니다. 축합니다.`);
@appkr
appkr / index.php
Last active April 30, 2017 04:00
SQL Injection Proof Of Conecpt
<?php
$id = $_GET['id'] ?? null;
$sql ="SELECT * FROM posts WHERE id = {$id}";
?>
<!DOCTYPE html>
<html>
<head>
@appkr
appkr / index.php
Created May 4, 2017 03:33
Associative Array methods profiling
<?php
// Code referenced from https://gist.github.com/Thinkscape/1965669
if (!isset($argv[1])) {
echo "Usage: " . $argv[0] . " (number of iterations)\n";
exit(1);
}
$tests = [
@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 / apache.png
Last active May 13, 2017 07:18
Timemachine For Testers
apache.png
@appkr
appkr / 20170527-l5code.zip
Last active May 27, 2017 04:44
20170527-l5code-for-qiak12-at-naver-dot-com
This file has been truncated, but you can view the full file.