[21:35:16] 1. Controllers call out to a repository to answer questions (like give me comments for a post, or are there any active users)
[21:35:27] so the repositories contain those business rules
[21:35:37] the entities (orm models) contain the application agnostic business rules
[21:35:42] like what makes a valid person
[21:36:09] 2. The repository interacts with the ORM to get the entities
[21:36:42] 3. The controller is merely responsible for processing the request, calling out to the appropriate repositories, and constructing the response
[21:36:52] All of the interactions are injected of course
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML::macro('flash', function() | |
{ | |
$message_status = Session::get('message_status'); | |
$message = Session::get('message'); | |
return ($message && $message_status) ? '<div class="flash flash-' . $message_status . '">' . $message . '</div>' : ''; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait CacheableTrait | |
{ | |
protected $cache = array(); | |
public function request_cache($key, \Closure $closure) | |
{ | |
// return the cache if it exists | |
if(!isset($this->cache[$key])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app['router'] = $app->share(function($app) | |
{ | |
return new Feather\Routing\Router($app); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* .elem outline box | |
*/ | |
.elem { | |
border: solid #6AC5AC 3px; | |
position: relative; | |
} | |
.elem p { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
with(new Page())->makeRoot(); | |
with(new Page())->makePreviousSiblingOf(Page::find(1)) | |
with(new Page())->makeNextSiblingOf(Page::find(1)) | |
with(new Page())->makeLastChildOf(Page::find(5)) | |
with(new Page())->makeFirstChildOf(Page::find(2)) | |
Page::find(2)->children() | |
Page::find(2)->parent() | |
Page::find(2)->sibling() | |
Page::find(2)->isDescendant(Page::find(3)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DBconfiguratorObject implements ArrayAccess, Serializable { | |
protected $config = array(); | |
protected $table = null; | |
private static $_instance = null; | |
public static function instance($tableName = 'config'){ | |
if(self::$_instance === null){ | |
self::$_instance = new self($tableName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Carbon\Carbon; | |
class Comment extends Eloquent { | |
protected $guarded = array(); | |
protected $softDelete = true; | |
public static $rules = array(); |
This was used to find all possible urls of twitter's emojis.
The list is used for BetterTweetDeck's emojis replacement script.
First we export all characters from /System/Library/Input Methods/CharacterPalette.app/Contents/Resources/CharacterDB.sqlite3
(column uchr
from table unihan_dict
) as csv (could have used sqlite from nodejs). This file contains all unicode characters (54072).
Then this csv is parsed with nodejs, which outputs corresponding urls.
To find all emojis from there, you just have to test every urls (example, another, with paralelism) (be gentle, use HEAD) to remove those that return 404.
I hereby claim:
- I am meroje on github.
- I am meroje (https://keybase.io/meroje) on keybase.
- I have a public key whose fingerprint is A279 58B4 FB91 2782 FC8D 5D3C 198D BC8B 3952 A88D
To claim this, I am signing this object: