Skip to content

Instantly share code, notes, and snippets.

View ajcastro's full-sized avatar

Arjon Jason Castro ajcastro

View GitHub Profile
@ajcastro
ajcastro / db_foreign_key.sublime-snippet
Created July 2, 2015 05:46
Laravel schema foreign key declaration snippet
<snippet>
<content><![CDATA[
\$table->foreign('${1:column}')->references('${2:id}')->on('${3:table}')->onDelete('${4:restrict}')->onUpdate('${5:cascade}');
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>foreign</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
@ajcastro
ajcastro / theme-seti-settings.json
Created July 2, 2015 05:48
Theme Seti_UI sublime settings
{
"Seti_SB_bright": true,
"Seti_SB_med": true,
"Seti_sb_small_padding": true,
"Seti_sb_tree_med": true,
"Seti_tabs_small": true,
"color_scheme": "Packages/Seti_UI/Scheme/Seti_monokai.tmTheme",
"font_size": 10,
"ignored_packages":
[
@ajcastro
ajcastro / laravel-eloquent-polymorphic-table-relations.md
Last active August 29, 2015 14:24
Laravel Eloquent Custom Polymorphic Table Relations

Laravel Eloquent Polymorphic Table Relations

Consider this tables: products and product_settings.

Table products

id name
1 Laptop
2 Tablet
Github: https://github.com/adoxa/ansicon
Copy paste ansicon folder to C:\.
Run in cmd:
C:\ansicon> ansicon.exe -i
http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
Remember to chmod the .sh files for it to run.
Using php: http://carlosbuenosvinos.com/write-your-git-hooks-in-php-and-keep-them-under-git-control/
<?php
class PThread extends Thread
{
protected $id = ''; //ThreadID
public function __construct($idThread)
{
$this->id = $idThread;
}
https://getcomposer.org/doc/04-schema.md#version
https://getcomposer.org/doc/articles/versions.md
http://qpleple.com/understand-composer-versions/
https://igor.io/2013/02/07/composer-stability-flags.html
http://webtips.krajee.com/setting-composer-minimum-stability-application/
Sources for Git Workflow Tutorials
Recommended workflows: Gitlab-flow (when using gitlab) and Github-flow (when using github)
https://about.gitlab.com/2014/09/29/gitlab-flow/
http://scottchacon.com/2011/08/31/github-flow.html
http://nvie.com/posts/a-successful-git-branching-model/
https://guides.github.com/introduction/flow/
https://guides.github.com/activities/hello-world/
https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow
https://phpunit.de/manual/current/en/code-coverage-analysis.html
https://jtreminio.com/2013/03/unit-testing-tutorial-introduction-to-phpunit/
http://code.tutsplus.com/tutorials/all-about-mocking-with-phpunit--net-27252