├── app
├── commands
│ └── .gitkeep
├── config
│ ├── packages
│ │ ├── .gitkeep
│ │ ├── thomaswelton
│ │ │ └── laravel-gravatar
│ │ │ │ ├── .gitkeep
│ │ │ │ └── config.php
│ │ └── itsgoingd
│ │ │ └── clockwork
│ │ │ └── config.php
│ ├── local
│ │ ├── app.php
│ │ ├── cache.php
│ │ ├── queue.php
│ │ └── session.php
│ ├── sitemap.php
│ ├── compile.php
│ ├── testing
│ │ ├── cache.php
│ │ └── session.php
│ ├── workbench.php
│ ├── view.php
│ ├── config.php
│ ├── navigation.php
│ ├── queue.php
│ ├── social.php
│ ├── remote.php
│ └── auth.php
├── database
│ ├── seeds
│ │ ├── .gitkeep
│ │ ├── DatabaseSeeder.php
│ │ ├── UsersTableSeeder.php
│ │ ├── TagsTableSeeder.php
│ │ └── CategoriesTableSeeder.php
│ ├── migrations
│ │ ├── .gitkeep
│ │ ├── 2013_11_22_072925_add_spam_to_tricks_table.php
│ │ ├── 2013_11_20_072925_add_order_to_category_table.php
│ │ ├── 2013_11_13_222809_create_categories_table.php
│ │ ├── 2014_04_17_181442_add_remember_to_user_table.php
│ │ ├── 2013_11_25_202456_create_password_reminders_table.php
│ │ ├── 2013_11_13_222806_create_users_table.php
│ │ ├── 2013_11_13_222808_create_tags_table.php
│ │ ├── 2013_11_13_222810_create_votes_table.php
│ │ ├── 2013_11_13_222811_create_tag_trick_table.php
│ │ ├── 2013_11_13_222807_create_tricks_table.php
│ │ ├── 2013_11_13_222812_create_category_trick_table.php
│ │ └── 2013_11_13_222813_create_profiles_table.php
│ └── production.sqlite
├── start
│ ├── local.php
│ ├── artisan.php
│ └── global.php
├── storage
│ ├── cache
│ │ └── .gitignore
│ ├── logs
│ │ └── .gitignore
│ ├── meta
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── views
│ │ └── .gitignore
│ └── .gitignore
├── views
│ ├── admin
│ │ ├── tags
│ │ │ ├── new.blade.php
│ │ │ └── edit.blade.php
│ │ ├── users
│ │ │ ├── new.blade.php
│ │ │ ├── edit.blade.php
│ │ │ └── list.blade.php
│ │ ├── categories
│ │ │ ├── new.blade.php
│ │ │ └── edit.blade.php
│ │ └── tricks
│ │ │ ├── edit.blade.php
│ │ │ ├── list.blade.php
│ │ │ └── new.blade.php
│ ├── home
│ │ ├── terms.blade.php
│ │ ├── privacy.blade.php
│ │ ├── index.blade.php
│ │ ├── error.blade.php
│ │ └── about.blade.php
│ ├── partials
│ │ ├── footer.blade.php
│ │ └── search.blade.php
│ ├── emails
│ │ └── auth
│ │ │ └── reminder.blade.php
│ ├── user
│ │ ├── favorites.blade.php
│ │ ├── profile.blade.php
│ │ └── public.blade.php
│ ├── browse
│ │ ├── index.blade.php
│ │ ├── tags.blade.php
│ │ └── categories.blade.php
│ ├── feeds
│ │ ├── atom.blade.php
│ │ └── rss.blade.php
│ ├── tricks
│ │ ├── delete.blade.php
│ │ ├── grid.blade.php
│ │ └── card.blade.php
│ ├── search
│ │ └── result.blade.php
│ └── password
│ │ ├── remind.blade.php
│ │ └── reset.blade.php
├── Tricks
│ ├── Exceptions
│ │ ├── TagNotFoundException.php
│ │ ├── UserNotFoundException.php
│ │ ├── CategoryNotFoundException.php
│ │ ├── AbstractNotFoundException.php
│ │ ├── GithubEmailAccessException.php
│ │ └── GithubEmailNotVerifiedException.php
│ ├── Services
│ │ └── Forms
│ │ │ ├── TagForm.php
│ │ │ ├── CategoryForm.php
│ │ │ ├── TrickForm.php
│ │ │ ├── TrickEditForm.php
│ │ │ ├── RegistrationForm.php
│ │ │ ├── SettingsForm.php
│ │ │ └── AbstractForm.php
│ ├── Facades
│ │ ├── Disqus.php
│ │ ├── Github.php
│ │ ├── ImageUpload.php
│ │ ├── Navigation.php
│ │ └── GithubProvider.php
│ ├── Providers
│ │ ├── EventServiceProvider.php
│ │ ├── SitemapServiceProvider.php
│ │ ├── UploadServiceProvider.php
│ │ ├── NavigationServiceProvider.php
│ │ ├── RepositoryServiceProvider.php
│ │ └── SocialServiceProvider.php
│ ├── Tag.php
│ ├── Category.php
│ ├── Profile.php
│ ├── Repositories
│ │ ├── Eloquent
│ │ │ ├── AbstractRepository.php
│ │ │ └── ProfileRepository.php
│ │ ├── ProfileRepositoryInterface.php
│ │ ├── TagRepositoryInterface.php
│ │ ├── UserRepositoryInterface.php
│ │ └── CategoryRepositoryInterface.php
│ ├── Presenters
│ │ └── UserPresenter.php
│ ├── Trick.php
│ └── Events
│ │ └── ViewTrickHandler.php
├── lang
│ └── en
│ │ ├── emails.php
│ │ ├── search.php
│ │ ├── user_tricks.php
│ │ ├── layouts.php
│ │ ├── feeds.php
│ │ ├── pagination.php
│ │ ├── browse.php
│ │ ├── password.php
│ │ ├── reminders.php
│ │ ├── partials.php
│ │ ├── tricks.php
│ │ ├── user.php
│ │ └── admin.php
├── tests
│ ├── Tricks
│ │ ├── ProfileTest.php
│ │ ├── TagTest.php
│ │ ├── CategoryTest.php
│ │ ├── Providers
│ │ │ ├── SitemapServiceProviderTest.php
│ │ │ ├── EventServiceProviderTest.php
│ │ │ ├── UploadServiceProviderTest.php
│ │ │ ├── NavigationServiceProviderTest.php
│ │ │ └── RepositoryServiceProviderTest.php
│ │ ├── Services
│ │ │ └── Forms
│ │ │ │ ├── TrickFormTest.php
│ │ │ │ ├── RegistrationFormTest.php
│ │ │ │ └── TrickEditFormTest.php
│ │ ├── Repositories
│ │ │ └── Eloquent
│ │ │ │ └── AbstractRepositoryTest.php
│ │ └── TrickTest.php
│ └── TestCase.php
└── Controllers
│ ├── SitemapController.php
│ ├── Admin
│ └── UsersController.php
│ ├── FeedsController.php
│ ├── HomeController.php
│ ├── SearchController.php
│ └── BaseController.php
├── .gitattributes
├── public
├── packages
│ └── .gitkeep
├── img
│ ├── avatar
│ │ ├── index.php
│ │ ├── temp
│ │ │ └── index.php
│ │ ├── 7568ca66ee70f18cfaad8caa8ff6d7576891a3e4.jpg
│ │ └── 865643780afe76667ffcd467c78a30ad44fc5b7d.jpg
│ ├── index.php
│ ├── logo.png
│ ├── logo-big.png
│ ├── logo@2x.png
│ ├── pattern.jpg
│ ├── ui.totop.png
│ ├── icon-likes.png
│ ├── icon-search.png
│ ├── icon-views.png
│ ├── logo-white.png
│ ├── icon-comments.png
│ ├── no-userpic-big.gif
│ ├── laratricks-logo.png
│ ├── logo-white50x34.png
│ └── thumbnails
│ │ └── default.jpg
├── robots.txt
├── favicon.ico
├── favicon.jpg
├── css
│ ├── Jcrop.gif
│ ├── highlight
│ │ ├── pojoaque.jpg
│ │ ├── school_book.png
│ │ ├── brown_papersq.png
│ │ ├── ascetic.css
│ │ ├── mono-blue.css
│ │ ├── tomorrow.css
│ │ ├── tomorrow-night-bright.css
│ │ ├── tomorrow-night-eighties.css
│ │ ├── solarized_dark.css
│ │ ├── solarized_light.css
│ │ ├── tomorrow-night.css
│ │ ├── tomorrow-night-blue.css
│ │ ├── foundation.css
│ │ ├── vs.css
│ │ ├── ir_black.css
│ │ ├── pojoaque.css
│ │ ├── monokai_sublime.css
│ │ ├── dark.css
│ │ ├── rainbow.css
│ │ ├── brown_paper.css
│ │ ├── idea.css
│ │ ├── github.css
│ │ ├── far.css
│ │ ├── zenburn.css
│ │ └── docco.css
│ └── ui.totop.css
├── js
│ ├── vendor
│ │ ├── uploader
│ │ │ ├── FileAPI.flash.swf
│ │ │ ├── FileAPI.flash.image.swf
│ │ │ ├── FileAPI.flash.camera.swf
│ │ │ └── crossdomain.xml
│ │ ├── jquery.ui.totop.min.js
│ │ ├── jquery.spin.js
│ │ └── placeholder.min.js
│ ├── trick-new-edit.min.js
│ ├── selectize
│ │ └── less
│ │ │ └── plugins
│ │ │ ├── optgroup_columns.less
│ │ │ ├── drag_drop.less
│ │ │ ├── dropdown_header.less
│ │ │ └── remove_button.less
│ ├── new-trick-backup.js
│ ├── trick-grid-backup.js
│ └── trick-like-backup.js
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
└── index.php
├── .gitignore
├── .editorconfig
├── bootstrap
├── testing.php
└── paths.php
├── server.php
├── Boxfile
├── phpunit.xml
├── LICENSE
└── composer.json
/app/commands/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/app/config/packages/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/packages/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/database/production.sqlite:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/start/local.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/storage/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/app/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/app/storage/meta/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/app/storage/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/app/storage/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/app/views/admin/tags/new.blade.php:
--------------------------------------------------------------------------------
1 | new.blade.php
--------------------------------------------------------------------------------
/app/views/admin/users/new.blade.php:
--------------------------------------------------------------------------------
1 | new.blade.php
--------------------------------------------------------------------------------
/app/views/home/terms.blade.php:
--------------------------------------------------------------------------------
1 | terms.blade.php
--------------------------------------------------------------------------------
/public/img/avatar/temp/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/admin/categories/new.blade.php:
--------------------------------------------------------------------------------
1 | new.blade.php
--------------------------------------------------------------------------------
/app/views/admin/tricks/edit.blade.php:
--------------------------------------------------------------------------------
1 | edit.blade.php
--------------------------------------------------------------------------------
/app/views/admin/tricks/list.blade.php:
--------------------------------------------------------------------------------
1 | list.blade.php
--------------------------------------------------------------------------------
/app/views/admin/tricks/new.blade.php:
--------------------------------------------------------------------------------
1 | new.blade.php
--------------------------------------------------------------------------------
/app/views/admin/users/edit.blade.php:
--------------------------------------------------------------------------------
1 | edit.blade.php
--------------------------------------------------------------------------------
/app/views/home/privacy.blade.php:
--------------------------------------------------------------------------------
1 | privacy.blade.php
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/app/config/packages/thomaswelton/laravel-gravatar/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/storage/.gitignore:
--------------------------------------------------------------------------------
1 | services.manifest
2 | clockwork
3 |
--------------------------------------------------------------------------------
/public/img/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/config/local/app.php:
--------------------------------------------------------------------------------
1 | true
5 | );
6 |
--------------------------------------------------------------------------------
/app/config/local/cache.php:
--------------------------------------------------------------------------------
1 | 'file',
5 | );
--------------------------------------------------------------------------------
/app/config/local/queue.php:
--------------------------------------------------------------------------------
1 | 'sync'
5 | );
6 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/favicon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/favicon.jpg
--------------------------------------------------------------------------------
/public/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/logo.png
--------------------------------------------------------------------------------
/app/config/local/session.php:
--------------------------------------------------------------------------------
1 | 'native',
6 |
7 | );
--------------------------------------------------------------------------------
/public/css/Jcrop.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/css/Jcrop.gif
--------------------------------------------------------------------------------
/public/img/logo-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/logo-big.png
--------------------------------------------------------------------------------
/public/img/logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/logo@2x.png
--------------------------------------------------------------------------------
/public/img/pattern.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/pattern.jpg
--------------------------------------------------------------------------------
/public/img/ui.totop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/ui.totop.png
--------------------------------------------------------------------------------
/public/img/icon-likes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/icon-likes.png
--------------------------------------------------------------------------------
/public/img/icon-search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/icon-search.png
--------------------------------------------------------------------------------
/public/img/icon-views.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/icon-views.png
--------------------------------------------------------------------------------
/public/img/logo-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/logo-white.png
--------------------------------------------------------------------------------
/public/img/icon-comments.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/icon-comments.png
--------------------------------------------------------------------------------
/public/img/no-userpic-big.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/no-userpic-big.gif
--------------------------------------------------------------------------------
/public/img/laratricks-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/laratricks-logo.png
--------------------------------------------------------------------------------
/public/img/logo-white50x34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/logo-white50x34.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bootstrap/compiled.php
2 | /vendor
3 | /report
4 | composer.phar
5 | composer.lock
6 | .DS_Store
7 | Thumbs.db
8 |
--------------------------------------------------------------------------------
/public/css/highlight/pojoaque.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/css/highlight/pojoaque.jpg
--------------------------------------------------------------------------------
/public/img/thumbnails/default.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/img/thumbnails/default.jpg
--------------------------------------------------------------------------------
/public/css/highlight/school_book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/css/highlight/school_book.png
--------------------------------------------------------------------------------
/public/css/highlight/brown_papersq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/css/highlight/brown_papersq.png
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | end_of_line = lf
3 | insert_final_newline = true
4 | indent_style = space
5 | indent_size = 2
6 |
--------------------------------------------------------------------------------
/public/js/vendor/uploader/FileAPI.flash.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/js/vendor/uploader/FileAPI.flash.swf
--------------------------------------------------------------------------------
/app/config/packages/thomaswelton/laravel-gravatar/config.php:
--------------------------------------------------------------------------------
1 | 100,
5 | 'default' => 'mm'
6 | );
7 |
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/public/js/vendor/uploader/FileAPI.flash.image.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/js/vendor/uploader/FileAPI.flash.image.swf
--------------------------------------------------------------------------------
/public/js/vendor/uploader/FileAPI.flash.camera.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodepadME/laravel-tricks/HEAD/public/js/vendor/uploader/FileAPI.flash.camera.swf
--------------------------------------------------------------------------------
/app/Tricks/Exceptions/TagNotFoundException.php:
--------------------------------------------------------------------------------
1 | 'Password Reset',
5 | 'reset_password_here' => 'To reset your password, complete this form: :form_link',
6 |
7 | );
--------------------------------------------------------------------------------
/app/lang/en/search.php:
--------------------------------------------------------------------------------
1 | 'Search results for ":term"',
5 | 'please_provide_search_term' => 'Please provide a search term',
6 |
7 | );
8 |
9 |
--------------------------------------------------------------------------------
/app/Tricks/Exceptions/AbstractNotFoundException.php:
--------------------------------------------------------------------------------
1 | 'Trick has been updated',
5 | 'trick_deleted' => 'Trick has been deleted',
6 | 'trick_does_not_belong_to_you' => 'This trick doesn\'t belong to you',
7 |
8 | );
--------------------------------------------------------------------------------
/bootstrap/testing.php:
--------------------------------------------------------------------------------
1 | init([
7 | 'debug' => true,
8 | 'includePaths' => [
9 | __DIR__ . "/../app" // testing constructors
10 | ]
11 | ]);
12 |
--------------------------------------------------------------------------------
/app/lang/en/layouts.php:
--------------------------------------------------------------------------------
1 | 'Laravel tricks is a website that aggregates useful tips and tricks for Laravel PHP framework',
5 | 'meta_author' => 'Stidges, @stidges and Maks Surguy, @msurguy',
6 | 'site_title' => 'Laravel-Tricks.com',
7 |
8 | );
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/views/partials/footer.blade.php:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/app/views/partials/search.blade.php:
--------------------------------------------------------------------------------
1 | {{ Form::open(['url'=>'search','method'=>'GET']);}}
2 |
3 |
4 | {{ Form::close()}}
5 |
--------------------------------------------------------------------------------
/app/Tricks/Services/Forms/TagForm.php:
--------------------------------------------------------------------------------
1 | 'required'
14 | ];
15 | }
16 |
--------------------------------------------------------------------------------
/public/js/trick-new-edit.min.js:
--------------------------------------------------------------------------------
1 | (function(e){e("#tags").selectize({maxItems:5});e("#categories").selectize({maxItems:5});var t=ace.edit("editor-content");var n=e("#code-editor");t.setTheme("ace/theme/github");t.getSession().setMode("ace/mode/php");t.getSession().setValue(n.val());n.closest("form").submit(function(){n.val(t.getSession().getValue())})})(jQuery)
2 |
--------------------------------------------------------------------------------
/app/views/emails/auth/reminder.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{ trans('emails.password_reset') }}
8 |
9 |
10 | {{ trans('emails.reset_password_here', array('form_link' => URL::to('password/reset', array($token)))) }}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/Tricks/Facades/Disqus.php:
--------------------------------------------------------------------------------
1 | 'required',
14 | 'description' => 'required|min:4'
15 | ];
16 | }
17 |
--------------------------------------------------------------------------------
/app/Tricks/Facades/GithubProvider.php:
--------------------------------------------------------------------------------
1 | app['events']->listen('trick.view', 'Tricks\Events\ViewTrickHandler');
12 | }
13 |
14 | public function register()
15 | {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/public/js/selectize/less/plugins/optgroup_columns.less:
--------------------------------------------------------------------------------
1 | .selectize-dropdown.plugin-optgroup_columns {
2 | .optgroup {
3 | border-right: 1px solid #f2f2f2;
4 | border-top: 0 none;
5 | float: left;
6 | .selectize-box-sizing(border-box);
7 | }
8 | .optgroup:last-child {
9 | border-right: 0 none;
10 | }
11 | .optgroup:before {
12 | display: none;
13 | }
14 | .optgroup-header {
15 | border-top: 0 none;
16 | }
17 | }
--------------------------------------------------------------------------------
/app/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call('UsersTableSeeder');
15 | $this->call('TricksTableSeeder');
16 | $this->call('CategoriesTableSeeder');
17 | $this->call('TagsTableSeeder');
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/app/start/artisan.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/lang/en/feeds.php:
--------------------------------------------------------------------------------
1 | 'Laravel-Tricks',
5 | 'link' => 'http://www.laravel-tricks.com',
6 | 'sub_title' => 'Laravel tricks is a website that aggregates useful tips and tricks for Laravel PHP framework',
7 | 'author' => '
8 |
9 | Maks Surguy
10 | http://twitter.com/msurguy
11 |
12 |
13 | Stidges
14 | http://twitter.com/stidges
15 | ',
16 | );
17 |
18 |
--------------------------------------------------------------------------------
/app/views/home/index.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('home.welcome'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
{{ trans('home.latest_tricks') }}
8 |
9 |
10 | @include('partials.search')
11 |
12 |
13 |
14 | @include('tricks.grid', ['tricks' => $tricks])
15 |
16 | @stop
17 |
--------------------------------------------------------------------------------
/app/config/sitemap.php:
--------------------------------------------------------------------------------
1 | array(
6 | 'priority' => '0.9',
7 | 'freq' => 'weekly',
8 | 'lastMod' => 'created_at',
9 | ),
10 |
11 | 'tags' => array(
12 | 'priority' => '0.9',
13 | 'freq' => 'daily',
14 | 'lastMod' => 'created_at',
15 | ),
16 |
17 | 'categories' => array(
18 | 'priority' => '0.9',
19 | 'freq' => 'daily',
20 | 'lastMod' => 'created_at',
21 | ),
22 |
23 | );
24 |
--------------------------------------------------------------------------------
/app/Tricks/Providers/SitemapServiceProvider.php:
--------------------------------------------------------------------------------
1 | app->alias('sitemap', 'Roumen\Sitemap\Sitemap');
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/config/compile.php:
--------------------------------------------------------------------------------
1 | .selectize-input > div.ui-sortable-placeholder {
3 | visibility: visible !important;
4 | background: #f2f2f2 !important;
5 | background: rgba(0,0,0,0.06) !important;
6 | border: 0 none !important;
7 | .selectize-box-shadow(inset 0 0 12px 4px #fff);
8 | }
9 | .ui-sortable-placeholder::after {
10 | content: '!';
11 | visibility: hidden;
12 | }
13 | .ui-sortable-helper {
14 | .selectize-box-shadow(0 2px 5px rgba(0,0,0,0.2));
15 | }
16 | }
--------------------------------------------------------------------------------
/app/Tricks/Tag.php:
--------------------------------------------------------------------------------
1 | belongsToMany('Tricks\Trick');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Tricks/Category.php:
--------------------------------------------------------------------------------
1 | belongsToMany('Tricks\Trick');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Tricks/Profile.php:
--------------------------------------------------------------------------------
1 | belongsTo('Tricks\User');
24 | }
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/app/Tricks/Providers/UploadServiceProvider.php:
--------------------------------------------------------------------------------
1 | app['upload.image'] = $this->app->share(function ($app) {
18 | return new ImageUploadService($app['files']);
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/public/js/new-trick-backup.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | $('#tags').selectize({
3 | maxItems: 5
4 | });
5 | $('#categories').selectize({
6 | maxItems: 5
7 | });
8 | var editor = ace.edit("editor-content");
9 | var codeEditor = $('#code-editor');
10 | editor.setTheme("ace/theme/github");
11 | editor.getSession().setMode("ace/mode/php");
12 | editor.getSession().setValue(codeEditor.val());
13 |
14 | codeEditor.closest('form').submit(function () {
15 | codeEditor.val(editor.getSession().getValue());
16 | })
17 | })(jQuery);
18 |
--------------------------------------------------------------------------------
/app/Tricks/Providers/NavigationServiceProvider.php:
--------------------------------------------------------------------------------
1 | app['navigation.builder'] = $this->app->share(function ($app) {
18 | return new Builder($app['config'], $app['auth']);
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/views/user/favorites.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('user.my_favorites'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
{{ trans('user.my_favorites') }}
8 |
9 |
10 | @include('partials.search')
11 |
12 |
13 |
14 | @include('tricks.grid', ['tricks' => $tricks])
15 |
16 | @stop
17 |
--------------------------------------------------------------------------------
/server.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 |
18 | 'next' => 'Next »',
19 |
20 | );
--------------------------------------------------------------------------------
/public/js/trick-grid-backup.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | $container = $('.js-trick-container');
3 |
4 | $container.masonry({
5 | gutter: 0,
6 | itemSelector: '.trick-card',
7 | columnWidth: '.trick-card'//,
8 | //transitionDuration: 0
9 | });
10 | $('.js-goto-trick a').click(function(e) { e.stopPropagation() });
11 |
12 | $('.js-goto-trick').click(function(e)
13 | {
14 | e.preventDefault();
15 | var url = "{{ route('tricks.show') }}";
16 | var slug = $(this).data('slug');
17 | window.location = url + '/' + slug;
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/app/config/testing/cache.php:
--------------------------------------------------------------------------------
1 | 'array',
19 |
20 | );
--------------------------------------------------------------------------------
/app/tests/Tricks/ProfileTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
23 |
24 | $mock
25 | ->shouldReceive('belongsTo')
26 | ->atLeast()->once()
27 | ->with('Tricks\User')
28 | ->andReturn('mocked');
29 |
30 | $this->assertEquals('mocked', $mock->user());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/tests/Tricks/TagTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
23 |
24 | $mock
25 | ->shouldReceive('belongsToMany')
26 | ->atLeast()->once()
27 | ->with('Tricks\Trick')
28 | ->andReturn('mocked');
29 |
30 | $this->assertEquals('mocked', $mock->tricks());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/tests/Tricks/CategoryTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
23 |
24 | $mock
25 | ->shouldReceive('belongsToMany')
26 | ->atLeast()->once()
27 | ->with('Tricks\Trick')
28 | ->andReturn('mocked');
29 |
30 | $this->assertEquals('mocked', $mock->tricks());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/config/testing/session.php:
--------------------------------------------------------------------------------
1 | 'array',
20 |
21 | );
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_22_072925_add_spam_to_tricks_table.php:
--------------------------------------------------------------------------------
1 | boolean('spam')->default(0)->after('id');
17 | });
18 | }
19 |
20 | /**
21 | * Reverse the migrations.
22 | *
23 | * @return void
24 | */
25 | public function down()
26 | {
27 | Schema::table('tricks', function($table)
28 | {
29 | $table->dropColumn('spam');
30 | });
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/lang/en/browse.php:
--------------------------------------------------------------------------------
1 | ':title | Laravel-Tricks.com',
5 | 'browsing_most_recent_tricks' => 'Browsing Most Recent Laravel Tricks',
6 | 'browsing_most_popular_tricks' => 'Browsing Most Popular Laravel Tricks',
7 | 'browsing_tag' => 'Browsing Tag ":tag"',
8 | 'tag' => 'Tag ":tag"',
9 | 'tags' => 'Tags',
10 | 'category' => 'Category ":category"',
11 | 'categories' => 'Categories',
12 | 'recent' => 'Recent',
13 | 'popular' => 'Popular',
14 | 'most_commented' => 'Most commented',
15 | 'browsing_most_commented_tricks' => 'Browsing Most Commented Laravel Tricks',
16 | 'browsing_category' => 'Browsing Category ":category"',
17 |
18 | );
--------------------------------------------------------------------------------
/app/lang/en/password.php:
--------------------------------------------------------------------------------
1 | 'Reset password',
5 | 'resetting_password' => 'Resetting password',
6 | 'mail_has_been_sent' => 'An e-mail with the password reset link has been sent.',
7 | 'email' => 'Email',
8 | 'email_reset_placeholder' => 'Email',
9 | 'new_password' => 'New Password',
10 | 'confirm_password' => 'Confirm New Password',
11 | 'reset' => 'Reset password',
12 | 'remember_password' => 'Remembered password? Login',
13 | 'invalid_password_or_mail' => 'The password reset token or email is invalid',
14 | 'resetting_password' => 'Resetting password',
15 | 'email_placeholder' => 'E-mail to send password reminder...',
16 |
17 | );
18 |
19 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_20_072925_add_order_to_category_table.php:
--------------------------------------------------------------------------------
1 | integer('order')->unsigned()->after('description');
17 | });
18 | }
19 |
20 | /**
21 | * Reverse the migrations.
22 | *
23 | * @return void
24 | */
25 | public function down()
26 | {
27 | Schema::table('categories', function($table)
28 | {
29 | $table->dropColumn('order');
30 | });
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/views/home/error.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.main')
2 |
3 | @section('title', trans('home.error'))
4 |
5 | @section('content')
6 |
7 |
8 |
9 |
{{ trans('home.error_title') }}
10 |
11 |
12 | @include('partials.search')
13 |
14 |
15 |
16 |
17 |
18 | {{ $error }}
19 |
20 |
21 |
22 | @stop
23 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222809_create_categories_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->string('name');
15 | $table->string('slug')->unique();
16 | $table->string('description')->nullable()->default(NULL);
17 | $table->timestamps();
18 | });
19 | }
20 |
21 | public function down()
22 | {
23 | Schema::drop('categories');
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/app/database/migrations/2014_04_17_181442_add_remember_to_user_table.php:
--------------------------------------------------------------------------------
1 | string('remember_token',100)->nullable()->after('id');
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('users', function($table)
29 | {
30 | $table->dropColumn('remember_token');
31 | });
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_25_202456_create_password_reminders_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token')->index();
19 | $table->timestamp('created_at');
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::drop('password_reminders');
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222806_create_users_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->string('email')->unique();
15 | $table->string('photo')->nullable()->default(NULL);
16 | $table->string('username');
17 | $table->string('password');
18 | $table->boolean('is_admin')->default(0);
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | public function down()
24 | {
25 | Schema::drop('users');
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/app/database/seeds/UsersTableSeeder.php:
--------------------------------------------------------------------------------
1 | truncate();
8 |
9 | $users = [
10 | [
11 | 'username' => 'msurguy',
12 | 'email' => 'user1@example.com',
13 | 'password' => Hash::make('password'),
14 | 'is_admin' => '1'
15 | ],
16 | [
17 | 'username' => 'stidges',
18 | 'email' => 'user2@example.com',
19 | 'password' => Hash::make('password'),
20 | 'is_admin' => '1'
21 | ]
22 | ];
23 |
24 | DB::table('users')->insert($users);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/public/js/selectize/less/plugins/dropdown_header.less:
--------------------------------------------------------------------------------
1 | .selectize-dropdown-header {
2 | position: relative;
3 | padding: @selectize-padding-dropdown-item-y @selectize-padding-dropdown-item-x;
4 | border-bottom: 1px solid @selectize-color-border;
5 | background: mix(@selectize-color-dropdown, @selectize-color-border, 85%);
6 | .selectize-border-radius(@selectize-border-radius @selectize-border-radius 0 0);
7 | }
8 | .selectize-dropdown-header-close {
9 | position: absolute;
10 | right: @selectize-padding-dropdown-item-x;
11 | top: 50%;
12 | color: @selectize-color-text;
13 | opacity: 0.4;
14 | margin-top: -12px;
15 | line-height: 20px;
16 | font-size: 20px !important;
17 | }
18 | .selectize-dropdown-header-close:hover {
19 | color: darken(@selectize-color-text, 25%);
20 | }
--------------------------------------------------------------------------------
/app/views/browse/index.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', $pageTitle)
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
{{{ $type }}} tricks
8 |
9 |
10 | @include('partials.search')
11 |
12 |
13 |
14 | @if(Request::is('/') || Request::is('popular') || Request::is('comments'))
15 |
16 |
17 |
18 | {{ Navigation::make(Request::path(), 'browse') }}
19 |
20 |
21 |
22 | @endif
23 |
24 | @include('tricks.grid', ['tricks' => $tricks])
25 |
26 | @stop
27 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Providers/SitemapServiceProviderTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
24 |
25 | $mock
26 | ->shouldReceive('alias')
27 | ->atLeast()->once()
28 | ->with('sitemap', 'Roumen\Sitemap\Sitemap');
29 |
30 | $provider = new SitemapServiceProvider(
31 | $mock
32 | );
33 |
34 | App::register($provider, [], true);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/views/feeds/atom.blade.php:
--------------------------------------------------------------------------------
1 | {{ '' }}
2 |
3 |
4 | {{ trans('feeds.title') }}
5 | {{ trans('feeds.sub_title') }}
6 |
7 | {{ Carbon\Carbon::now()->toATOMString() }}
8 | {{ trans('feeds.author') }}
9 | tag:{{ Request::getHost() }},{{ date('Y') }}:/feed.atom
10 |
11 | @foreach($tricks as $trick)
12 |
13 | {{ $trick->title }}
14 |
15 | {{ $trick->tagUri }}
16 | {{ $trick->updated_at->toATOMString() }}
17 | {{ $trick->description }}
18 |
19 | @endforeach
20 |
21 |
--------------------------------------------------------------------------------
/app/Tricks/Services/Forms/TrickForm.php:
--------------------------------------------------------------------------------
1 | 'required|min:4|unique:tricks,title',
14 | 'description' => 'required|min:10',
15 | 'tags' => 'required',
16 | 'categories' => 'required',
17 | 'code' => 'required'
18 | ];
19 |
20 | /**
21 | * Get the prepared input data.
22 | *
23 | * @return array
24 | */
25 | public function getInputData()
26 | {
27 | return array_only($this->inputData, [
28 | 'title', 'description', 'tags', 'categories', 'code'
29 | ]);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Controllers/SitemapController.php:
--------------------------------------------------------------------------------
1 | builder = $builder;
27 | }
28 |
29 | /**
30 | * Show the sitemap.
31 | *
32 | * @return void
33 | */
34 | public function getIndex()
35 | {
36 | return $this->builder->render();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/public/js/selectize/less/plugins/remove_button.less:
--------------------------------------------------------------------------------
1 | .selectize-control.plugin-remove_button {
2 | [data-value] {
3 | position: relative;
4 | padding-right: 24px !important;
5 | }
6 | [data-value] .remove {
7 | position: absolute;
8 | top: 0;
9 | right: 0;
10 | bottom: 0;
11 | width: 17px;
12 | text-align: center;
13 | font-weight: bold;
14 | font-size: 12px;
15 | color: inherit;
16 | text-decoration: none;
17 | vertical-align: middle;
18 | display: inline-block;
19 | padding: @selectize-padding-item-y 0 0 0;
20 | border-left: 1px solid @selectize-color-item-border;
21 | .selectize-border-radius(0 2px 2px 0);
22 | .selectize-box-sizing(border-box);
23 | }
24 | [data-value] .remove:hover {
25 | background: rgba(0,0,0,0.05);
26 | }
27 | [data-value].active .remove {
28 | border-left-color: @selectize-color-item-active-border;
29 | }
30 | }
--------------------------------------------------------------------------------
/public/css/ui.totop.css:
--------------------------------------------------------------------------------
1 | /*
2 | |--------------------------------------------------------------------------
3 | | UItoTop jQuery Plugin 1.2
4 | | http://www.mattvarone.com/web-design/uitotop-jquery-plugin/
5 | |--------------------------------------------------------------------------
6 | */
7 |
8 | #toTop {
9 | display:none;
10 | text-decoration:none;
11 | position:fixed;
12 | bottom:10px;
13 | right:10px;
14 | overflow:hidden;
15 | width:51px;
16 | height:51px;
17 | border:none;
18 | text-indent:100%;
19 | background:url(../img/ui.totop.png) no-repeat left top;
20 | }
21 |
22 | #toTopHover {
23 | background:url(../img/ui.totop.png) no-repeat left -51px;
24 | width:51px;
25 | height:51px;
26 | display:block;
27 | overflow:hidden;
28 | float:left;
29 | opacity: 0;
30 | -moz-opacity: 0;
31 | filter:alpha(opacity=0);
32 | }
33 |
34 | #toTop:active, #toTop:focus {
35 | outline:none;
36 | }
--------------------------------------------------------------------------------
/app/lang/en/reminders.php:
--------------------------------------------------------------------------------
1 | "Passwords must be at least six characters and match the confirmation.",
17 |
18 | "user" => "We can't find a user with that e-mail address.",
19 |
20 | "token" => "This password reset token is invalid.",
21 |
22 | "sent" => "Password reminder sent!",
23 |
24 | "your_password_reminder" => "Your Password Reminder for Laravel Tricks",
25 |
26 | );
27 |
--------------------------------------------------------------------------------
/app/Tricks/Repositories/Eloquent/AbstractRepository.php:
--------------------------------------------------------------------------------
1 | model = $model;
24 | }
25 |
26 | /**
27 | * Get a new instance of the model.
28 | *
29 | * @param array $attributes
30 | * @return \Illuminate\Database\Eloquent\Model
31 | */
32 | public function getNew(array $attributes = array())
33 | {
34 | return $this->model->newInstance($attributes);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/lang/en/partials.php:
--------------------------------------------------------------------------------
1 | 'Website built with Laravel by Stidges & Maks Surguy ',
5 | 'about' => 'About',
6 | 'register' => 'Register',
7 | 'login' => 'Login',
8 | 'profile' => 'Profile',
9 | 'my_tricks' => 'My Tricks',
10 | 'my_profile' => 'My Profile',
11 | 'toggle_navigation' => 'Toggle navigation',
12 | 'search_placeholder' => 'Search...',
13 | 'my_favorites' => 'My Favorites',
14 | 'settings' => 'Settings',
15 | 'logout' => 'Logout',
16 | 'footer_links' => '
17 | |
18 | ',
19 |
20 | );
21 |
22 |
--------------------------------------------------------------------------------
/app/views/tricks/delete.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 | {{ trans('tricks.are_you_sure_text') }}
11 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | getProperty($property);
22 | $reflectionProperty->setAccessible(true);
23 | $reflectionProperty->setValue($class, $value);
24 | }
25 |
26 | public function getProtectedProperty($class, $property)
27 | {
28 | return Assert::readAttribute($class, $property);
29 | }
30 |
31 | protected function incomplete($message = 'This test has not been implemented yet.')
32 | {
33 | $this->markTestIncomplete($message);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/database/seeds/TagsTableSeeder.php:
--------------------------------------------------------------------------------
1 | '1',
10 | 'name' => 'database',
11 | 'slug' => 'database',
12 | ],
13 | [
14 | 'id' => '2',
15 | 'name' => 'view data',
16 | 'slug' => 'view-data',
17 | ],
18 | [
19 | 'id' => '3',
20 | 'name' => '4.1',
21 | 'slug' => '41',
22 | ],
23 | ];
24 |
25 | DB::table('tags')->insert($tags);
26 |
27 | DB::table('tag_trick')->insert([
28 | [ 'tag_id' => '1', 'trick_id' => '1' ],
29 | [ 'tag_id' => '2', 'trick_id' => '2' ],
30 | [ 'tag_id' => '1', 'trick_id' => '3' ],
31 | [ 'tag_id' => '3', 'trick_id' => '3' ],
32 | ]);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/views/feeds/rss.blade.php:
--------------------------------------------------------------------------------
1 | {{ '' }}
2 |
3 |
4 |
5 | {{ trans('feeds.title') }}
6 | {{ trans('feeds.link') }}
7 |
8 | {{ trans('feeds.sub_title') }}
9 | en-us
10 | {{ Carbon\Carbon::now()->toRSSString() }}
11 |
12 | @foreach($tricks as $trick)
13 | -
14 |
{{ $trick->title }}
15 | {{ route('tricks.show', $trick->slug) }}
16 | {{ route('tricks.show', $trick->slug) }}
17 | description}}]]>
18 | {{ $trick->created_at->toRSSString() }}
19 |
20 | @endforeach
21 |
22 |
23 |
--------------------------------------------------------------------------------
/public/css/highlight/ascetic.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | background: white; color: black;
10 | }
11 |
12 | pre .string,
13 | pre .tag .value,
14 | pre .filter .argument,
15 | pre .addition,
16 | pre .change,
17 | pre .apache .tag,
18 | pre .apache .cbracket,
19 | pre .nginx .built_in,
20 | pre .tex .formula {
21 | color: #888;
22 | }
23 |
24 | pre .comment,
25 | pre .template_comment,
26 | pre .shebang,
27 | pre .doctype,
28 | pre .pi,
29 | pre .javadoc,
30 | pre .deletion,
31 | pre .apache .sqbracket {
32 | color: #CCC;
33 | }
34 |
35 | pre .keyword,
36 | pre .tag .title,
37 | pre .ini .title,
38 | pre .lisp .title,
39 | pre .clojure .title,
40 | pre .http .title,
41 | pre .nginx .title,
42 | pre .css .tag,
43 | pre .winutils,
44 | pre .flow,
45 | pre .apache .tag,
46 | pre .tex .command,
47 | pre .request,
48 | pre .status {
49 | font-weight: bold;
50 | }
51 |
--------------------------------------------------------------------------------
/app/config/workbench.php:
--------------------------------------------------------------------------------
1 | '',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Workbench Author E-Mail Address
21 | |--------------------------------------------------------------------------
22 | |
23 | | Like the option above, your e-mail address is used when generating new
24 | | workbench packages. The e-mail is placed in your composer.json file
25 | | automatically after the package is created by the workbench tool.
26 | |
27 | */
28 |
29 | 'email' => '',
30 |
31 | );
--------------------------------------------------------------------------------
/app/Controllers/Admin/UsersController.php:
--------------------------------------------------------------------------------
1 | users = $users;
28 | }
29 |
30 | /**
31 | * Show the users index page.
32 | *
33 | * @return \Response
34 | */
35 | public function getIndex()
36 | {
37 | $users = $this->users->findAllPaginated();
38 |
39 | $this->view('admin.users.list', compact('users'));
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/config/view.php:
--------------------------------------------------------------------------------
1 | array(__DIR__.'/../views'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Pagination View
21 | |--------------------------------------------------------------------------
22 | |
23 | | This view will be used to render the pagination link output, and can
24 | | be easily customized here to show any view you like. A clean view
25 | | compatible with Twitter's Bootstrap is given to you by default.
26 | |
27 | */
28 |
29 | 'pagination' => 'pagination::slider-3',
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/public/js/trick-like-backup.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 |
3 | $('.js-like-trick').click(function (e) {
4 | e.preventDefault();
5 | var liked = $(this).data('liked') == '0';
6 |
7 | var data = {"_token": "{{ csrf_token() }}" };
8 |
9 | $.post('{{ route("tricks.like", $trick->slug) }}', data, function (res) {
10 | if (res != 'error') {
11 |
12 | if (!liked) {
13 |
14 | $('.js-like-trick .fa').removeClass('text-primary');
15 |
16 | $('.js-like-trick').data('liked', '0');
17 |
18 | $('.js-like-status').html('Like this?');
19 | } else {
20 |
21 | $('.js-like-trick .fa').addClass('text-primary');
22 |
23 | $('.js-like-trick').data('liked', '1');
24 |
25 | $('.js-like-status').html('You like this');
26 | }
27 |
28 | $('.js-like-count').html(res + ' likes');
29 | }
30 | });
31 |
32 | });
33 | })(jQuery)
34 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222808_create_tags_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->string('name');
15 | $table->string('slug')->unique();
16 | $table->integer('user_id')->unsigned()->nullable()->default(NULL);
17 | $table->timestamps();
18 |
19 | $table->foreign('user_id')
20 | ->references('id')->on('users')
21 | ->onUpdate('cascade')
22 | ->onDelete('set null');
23 | });
24 | }
25 |
26 | public function down()
27 | {
28 | Schema::table('tags', function($table)
29 | {
30 | $table->dropForeign('tags_user_id_foreign');
31 | });
32 | Schema::drop('tags');
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/Tricks/Repositories/ProfileRepositoryInterface.php:
--------------------------------------------------------------------------------
1 | builder = $builder;
27 | }
28 |
29 | /**
30 | * Show the ATOM feed.
31 | *
32 | * @return \Response
33 | */
34 | public function getAtom()
35 | {
36 | return $this->builder->render('atom');
37 | }
38 |
39 | /**
40 | * Show the RSS feed.
41 | *
42 | * @return \Response
43 | */
44 | public function getRss()
45 | {
46 | return $this->builder->render('rss');
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/lang/en/tricks.php:
--------------------------------------------------------------------------------
1 | 'Trick',
5 | 'submitted' => 'Submitted :timeago :categories',
6 | 'are_you_sure' => 'Are you sure?',
7 | 'cancel' => 'Cancel',
8 | 'creating_new_trick' => 'Creating a new trick',
9 | 'update_trick' => 'Update Trick',
10 | 'delete' => 'Delete',
11 | 'title' => 'Title',
12 | 'no_tricks_found' => 'Sorry, but I couldn\'t find any tricks for you!',
13 | 'tag_trick_placeholder' => 'Tag this trick',
14 | 'categorize_trick_placeholder' => 'Choose Categories for this trick',
15 | 'title_placeholder' => 'Name this trick',
16 | 'description' => 'Description',
17 | 'remove_trick' => 'Remove trick',
18 | 'trick_description_placeholder' => 'Give detailed description of the trick',
19 | 'trick_code' => 'Trick code:',
20 | 'save_trick' => 'Save Trick',
21 | 'editing_trick' => 'Editing trick',
22 | 'errors_while_editing' => 'There were errors while editing this trick:',
23 | 'errors_while_creating' => 'There were errors while creating this trick:',
24 | 'are_you_sure_text' => 'Are you sure you want to remove this trick?',
25 | );
--------------------------------------------------------------------------------
/Boxfile:
--------------------------------------------------------------------------------
1 | web1:
2 | document_root: public
3 | php_version: 5.4.14
4 | php_upload_max_filesize: "10M"
5 | php_post_max_size: "10M"
6 | php_extensions:
7 | - mbstring
8 | - mcrypt
9 | - curl
10 | - gd
11 | - pdo_mysql
12 | - redis
13 | - zip
14 | - xcache
15 | php_session_save_handler: redis
16 | php_session_save_path: "tcp://tunnel.pagodabox.com:6379"
17 | shared_writable_dirs:
18 | - app/storage/cache
19 | - app/storage/logs
20 | - app/storage/meta
21 | - app/storage/sessions
22 | - app/storage/views
23 | - public/img/screenshots
24 | - public/img/avatars
25 | - public/img/avatar
26 | - public/img/screenshots/temp
27 | after_build:
28 | - "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install --prefer-source"
29 | after_deploy:
30 | - "rm -f app/storage/cache/*"
31 | - "php artisan cache:clear"
32 | - "rm -f app/storage/views/*"
33 | before_deploy:
34 | - "php artisan migrate"
35 | cache1:
36 | type: redis
37 |
38 | db1:
39 | type: mysql
40 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Providers/EventServiceProviderTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
24 |
25 | $dispatcherMock
26 | ->shouldReceive('listen')
27 | ->atLeast()->once()
28 | ->with('trick.view', 'Tricks\Events\ViewTrickHandler');
29 |
30 | $applicationMock = Mockery::mock('Illuminate\Foundation\Application')
31 | ->makePartial();
32 |
33 | $applicationMock
34 | ->shouldReceive('offsetGet')
35 | ->atLeast()->once()
36 | ->with('events')
37 | ->andReturn($dispatcherMock);
38 |
39 | $provider = new EventServiceProvider(
40 | $applicationMock
41 | );
42 |
43 | App::register($provider, [], true);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/config/config.php:
--------------------------------------------------------------------------------
1 | 3600,
6 |
7 | 'version' => '1.0.0',
8 | 'version_date' => 'February 19, 2014',
9 |
10 | 'analytics_property_id' => 'UA-XXXX-Y',
11 | 'disqus_shortname' => 'Your Disqus shortname here',
12 |
13 | // Admin email (the notifications are sent to this email, also see the mail.php config for the "From" address)
14 | 'admin_email' => '',
15 |
16 | // available user permission types that are matched by user_type column in the users table
17 | 'user_types' => array(
18 | 'admin' => 100,
19 | 'reviewer' => 20,
20 | 'user' => 10
21 | ),
22 |
23 | // Some potential usernames should be protected and new or existing users will not
24 | // be able to take any of the following usernames :
25 | 'forbidden_usernames' => [
26 | 'tricks',
27 | 'trick',
28 | 'user',
29 | 'admin',
30 | 'privacy',
31 | 'license',
32 | 'resources',
33 | 'about',
34 | 'login',
35 | 'logout',
36 | 'register',
37 | 'img',
38 | 'css',
39 | 'js',
40 | 'feed',
41 | 'feed.atom',
42 | 'feed.xml'
43 | ],
44 | );
45 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 | app/tests
17 |
18 |
19 |
20 |
21 | app/Controllers
22 | app/Tricks
23 |
24 | app/Tricks/Facades
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/public/css/highlight/mono-blue.css:
--------------------------------------------------------------------------------
1 | /*
2 | Five-color theme from a single blue hue.
3 | */
4 | pre code {
5 | display: block; padding: 0.5em;
6 | background: #EAEEF3; color: #00193A;
7 | }
8 |
9 | pre .keyword,
10 | pre .title,
11 | pre .important,
12 | pre .request,
13 | pre .header,
14 | pre .javadoctag {
15 | font-weight: bold;
16 | }
17 |
18 | pre .comment,
19 | pre .chunk,
20 | pre .template_comment {
21 | color: #738191;
22 | }
23 |
24 | pre .string,
25 | pre .title,
26 | pre .parent,
27 | pre .built_in,
28 | pre .literal,
29 | pre .filename,
30 | pre .value,
31 | pre .addition,
32 | pre .tag,
33 | pre .argument,
34 | pre .link_label,
35 | pre .blockquote,
36 | pre .header {
37 | color: #0048AB;
38 | }
39 |
40 | pre .decorator,
41 | pre .prompt,
42 | pre .yardoctag,
43 | pre .subst,
44 | pre .symbol,
45 | pre .doctype,
46 | pre .regexp,
47 | pre .preprocessor,
48 | pre .pi,
49 | pre .attribute,
50 | pre .attr_selector,
51 | pre .javadoc,
52 | pre .xmlDocTag,
53 | pre .deletion,
54 | pre .shebang,
55 | pre .string .variable,
56 | pre .link_url,
57 | pre .bullet {
58 | color: #4C81C9;
59 | }
60 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Services/Forms/TrickFormTest.php:
--------------------------------------------------------------------------------
1 | 'foo',
23 | 'description' => 'bar',
24 | 'tags' => '1,2,3',
25 | 'categories' => '1,2,3',
26 | 'code' => 'baz',
27 | 'invalid' => 'YOU SHALL NOT PASS'
28 | ];
29 |
30 | $after = [
31 | 'title' => 'foo',
32 | 'description' => 'bar',
33 | 'tags' => '1,2,3',
34 | 'categories' => '1,2,3',
35 | 'code' => 'baz'
36 | ];
37 |
38 | $trickForm = new TrickForm();
39 |
40 | $this->setProtectedProperty($trickForm, 'inputData', $before);
41 |
42 | $this->assertEquals(
43 | array_keys($after),
44 | array_keys($trickForm->getInputData())
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/database/seeds/CategoriesTableSeeder.php:
--------------------------------------------------------------------------------
1 | '1',
10 | 'name' => 'Views',
11 | 'slug' => 'views',
12 | 'description' => 'All tricks related to the View class, e.g. View Composers.',
13 | 'order' => '1',
14 | ],
15 | [
16 | 'id' => '2',
17 | 'name' => 'Eloquent',
18 | 'slug' => 'eloquent',
19 | 'description' => 'Eloquent ORM',
20 | 'order' => '2',
21 | ],
22 | ];
23 |
24 | DB::table('categories')->insert($categories);
25 | DB::table('category_trick')->insert([
26 | [ 'category_id' => '2', 'trick_id' => '1' ],
27 | [ 'category_id' => '1', 'trick_id' => '2' ],
28 | [ 'category_id' => '2', 'trick_id' => '3' ],
29 | ]);
30 | }
31 | }
32 |
33 |
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2014 Stidges and Maksim Surguy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/app/Controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | tricks = $tricks;
27 | }
28 |
29 | /**
30 | * Show the homepage.
31 | *
32 | * @return \Response
33 | */
34 | public function getIndex()
35 | {
36 | $tricks = $this->tricks->findAllPaginated();
37 |
38 | $this->view('home.index', compact('tricks'));
39 | }
40 |
41 | /**
42 | * Show the about page.
43 | *
44 | * @return \Response
45 | */
46 | public function getAbout()
47 | {
48 | $this->view('home.about');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/Controllers/SearchController.php:
--------------------------------------------------------------------------------
1 | tricks = $tricks;
28 | }
29 |
30 | /**
31 | * Show the search results page.
32 | *
33 | * @return \Response
34 | */
35 | public function getIndex()
36 | {
37 | $term = e(Input::get('q'));
38 | $tricks = null;
39 |
40 | if (! empty($term)) {
41 | $tricks = $this->tricks->searchByTermPaginated($term, 12);
42 | }
43 |
44 | $this->view('search.result', compact('tricks', 'term'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/views/tricks/grid.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @if($tricks->count())
3 | @foreach($tricks as $trick)
4 | @include('tricks.card', [ 'trick' => $trick ])
5 | @endforeach
6 | @else
7 |
8 |
9 | {{ trans('tricks.no_tricks_found') }}
10 |
11 |
12 | @endif
13 |
14 | @if($tricks->count())
15 |
16 |
17 | @if(isset($appends))
18 | {{ $tricks->appends($appends)->links(); }}
19 | @else
20 | {{ $tricks->links(); }}
21 | @endif
22 |
23 |
24 | @endif
25 |
26 | @section('scripts')
27 | @if(count($tricks))
28 |
29 |
32 | @endif
33 | @stop
34 |
--------------------------------------------------------------------------------
/app/config/navigation.php:
--------------------------------------------------------------------------------
1 | array(
8 | array(
9 | 'label' => 'Browse',
10 | 'route' => 'browse.recent',
11 | 'active' => array('/','popular','comments')
12 | ),
13 | array(
14 | 'label' => 'Categories',
15 | 'route' => 'browse.categories',
16 | 'active' => array('categories*')
17 | ),
18 | array(
19 | 'label' => 'Tags',
20 | 'route' => 'browse.tags',
21 | 'active' => array('tags*')
22 | ),
23 | array(
24 | 'label' => 'Create New',
25 | 'route' => 'tricks.new',
26 | 'active' => array('user/tricks/new'),
27 | // 'logged_in' => true
28 | ),
29 | ),
30 |
31 | 'browse' => array(
32 | array(
33 | 'label' => 'Most recent',
34 | 'route' => 'browse.recent',
35 | 'active' => array('/')
36 | ),
37 | array(
38 | 'label' => 'Most popular',
39 | 'route' => 'browse.popular',
40 | 'active' => array('popular')
41 | ),
42 | array(
43 | 'label' => 'Most commented',
44 | 'route' => 'browse.comments',
45 | 'active' => array('comments')
46 | ),
47 | ),
48 |
49 | );
50 |
--------------------------------------------------------------------------------
/app/views/user/profile.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('user.profile'))
2 |
3 | @section('content')
4 |
5 | @if(Session::has('first_use'))
6 |
7 |
×
8 |
{{ trans('user.welcome') }}
9 |
{{ trans('user.welcome_subtitle') }}
10 |
11 | @endif
12 |
13 | @if(Session::has('success'))
14 |
15 | ×
16 |
{{ Session::get('success') }}
17 |
18 | @endif
19 |
20 |
21 |
22 |
{{ trans('user.my_tricks') }}
23 |
24 |
27 |
28 |
29 | @include('tricks.grid', [ 'tricks' => $tricks ])
30 |
31 | @stop
32 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "description": "The Laravel Framework.",
4 | "keywords": ["framework", "laravel"],
5 | "license": "MIT",
6 | "require": {
7 | "laravel/framework": "4.1.*",
8 | "mccool/laravel-auto-presenter": "1.0.*",
9 | "league/oauth2-client": "dev-master",
10 | "intervention/image": "1.5.*",
11 | "thomaswelton/laravel-gravatar": "0.0.*",
12 | "roumen/sitemap": "2.4.*"
13 | },
14 | "require-dev" : {
15 | "mockery/mockery" : "dev-master",
16 | "phpunit/phpunit" : "3.7.*",
17 | "codeception/aspect-mock" : "*"
18 | },
19 | "autoload": {
20 | "classmap": [
21 | "app/commands",
22 | "app/database/migrations",
23 | "app/database/seeds",
24 | "app/tests/TestCase.php"
25 | ],
26 | "psr-0": {
27 | "Controllers": "app/",
28 | "Tricks": "app/"
29 | }
30 | },
31 | "scripts": {
32 | "post-install-cmd": [
33 | "php artisan optimize"
34 | ],
35 | "post-update-cmd": [
36 | "php artisan clear-compiled",
37 | "php artisan optimize"
38 | ],
39 | "post-create-project-cmd": [
40 | "php artisan key:generate"
41 | ]
42 | },
43 | "config": {
44 | "preferred-install": "dist"
45 | },
46 | "minimum-stability": "dev",
47 | "prefer-stable": true
48 | }
49 |
--------------------------------------------------------------------------------
/app/Tricks/Providers/RepositoryServiceProvider.php:
--------------------------------------------------------------------------------
1 | app->bind(
17 | 'Tricks\Repositories\UserRepositoryInterface',
18 | 'Tricks\Repositories\Eloquent\UserRepository'
19 | );
20 |
21 | $this->app->bind(
22 | 'Tricks\Repositories\ProfileRepositoryInterface',
23 | 'Tricks\Repositories\Eloquent\ProfileRepository'
24 | );
25 |
26 | $this->app->bind(
27 | 'Tricks\Repositories\TrickRepositoryInterface',
28 | 'Tricks\Repositories\Eloquent\TrickRepository'
29 | );
30 |
31 | $this->app->bind(
32 | 'Tricks\Repositories\TagRepositoryInterface',
33 | 'Tricks\Repositories\Eloquent\TagRepository'
34 | );
35 |
36 | $this->app->bind(
37 | 'Tricks\Repositories\CategoryRepositoryInterface',
38 | 'Tricks\Repositories\Eloquent\CategoryRepository'
39 | );
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222810_create_votes_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->integer('user_id')->unsigned();
15 | $table->integer('trick_id')->unsigned();
16 | $table->timestamps();
17 |
18 | $table->foreign('user_id')
19 | ->references('id')->on('users')
20 | ->onUpdate('cascade')
21 | ->onDelete('cascade');
22 |
23 | $table->foreign('trick_id')
24 | ->references('id')->on('tricks')
25 | ->onUpdate('cascade')
26 | ->onDelete('cascade');
27 | });
28 | }
29 |
30 | public function down()
31 | {
32 | Schema::table('votes', function($table)
33 | {
34 | $table->dropForeign('votes_user_id_foreign');
35 | $table->dropForeign('votes_trick_id_foreign');
36 | });
37 |
38 | Schema::drop('votes');
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222811_create_tag_trick_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->integer('tag_id')->unsigned();
15 | $table->integer('trick_id')->unsigned();
16 | $table->timestamps();
17 |
18 | $table->foreign('tag_id')
19 | ->references('id')->on('tags')
20 | ->onUpdate('cascade')
21 | ->onDelete('cascade');
22 |
23 | $table->foreign('trick_id')
24 | ->references('id')->on('tricks')
25 | ->onUpdate('cascade')
26 | ->onDelete('cascade');
27 | });
28 | }
29 |
30 | public function down()
31 | {
32 | Schema::table('tag_trick', function($table)
33 | {
34 | $table->dropForeign('tag_trick_tag_id_foreign');
35 | $table->dropForeign('tag_trick_trick_id_foreign');
36 | });
37 |
38 | Schema::drop('tag_trick');
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222807_create_tricks_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->string('title', 140);
15 | $table->string('slug')->unique();
16 | $table->text('description')->nullable()->default(NULL);
17 | $table->text('code');
18 | $table->integer('vote_cache')->unsigned()->default(0);
19 | $table->integer('view_cache')->unsigned()->default(0);
20 | $table->integer('user_id')->unsigned();
21 | $table->timestamps();
22 |
23 | $table->foreign('user_id')
24 | ->references('id')->on('users')
25 | ->onUpdate('cascade')
26 | ->onDelete('cascade');
27 | });
28 | }
29 |
30 | public function down()
31 | {
32 | Schema::table('tricks', function($table)
33 | {
34 | $table->dropForeign('tricks_user_id_foreign');
35 | });
36 |
37 | Schema::drop('tricks');
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/views/browse/tags.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('browse.tags'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
{{ trans('browse.tags') }}
8 |
9 |
10 | @include('partials.search')
11 |
12 |
13 |
14 |
31 |
32 |
33 | @stop
34 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222812_create_category_trick_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->integer('category_id')->unsigned();
15 | $table->integer('trick_id')->unsigned();
16 | $table->timestamps();
17 |
18 | $table->foreign('category_id')
19 | ->references('id')->on('categories')
20 | ->onUpdate('cascade')
21 | ->onDelete('cascade');
22 |
23 | $table->foreign('trick_id')
24 | ->references('id')->on('tricks')
25 | ->onUpdate('cascade')
26 | ->onDelete('cascade');
27 | });
28 | }
29 |
30 | public function down()
31 | {
32 | Schema::table('category_trick', function($table)
33 | {
34 | $table->dropForeign('category_trick_category_id_foreign');
35 | $table->dropForeign('category_trick_trick_id_foreign');
36 | });
37 | Schema::drop('category_trick');
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/public/js/vendor/jquery.ui.totop.min.js:
--------------------------------------------------------------------------------
1 | /* UItoTop jQuery Plugin 1.2 | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */
2 | (function($){$.fn.UItoTop=function(options){var defaults={text:'To Top',min:200,inDelay:600,outDelay:400,containerID:'toTop',containerHoverID:'toTopHover',scrollSpeed:1200,easingType:'linear'},settings=$.extend(defaults,options),containerIDhash='#'+settings.containerID,containerHoverIDHash='#'+settings.containerHoverID;$('body').append(''+settings.text+' ');$(containerIDhash).hide().on('click.UItoTop',function(){$('html, body').animate({scrollTop:0},settings.scrollSpeed,settings.easingType);$('#'+settings.containerHoverID,this).stop().animate({'opacity':0},settings.inDelay,settings.easingType);return false;}).prepend(' ').hover(function(){$(containerHoverIDHash,this).stop().animate({'opacity':1},600,'linear');},function(){$(containerHoverIDHash,this).stop().animate({'opacity':0},700,'linear');});$(window).scroll(function(){var sd=$(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){$(containerIDhash).css({'position':'absolute','top':sd+$(window).height()-50});}
3 | if(sd>settings.min)
4 | $(containerIDhash).fadeIn(settings.inDelay);else
5 | $(containerIDhash).fadeOut(settings.Outdelay);});};})(jQuery);
--------------------------------------------------------------------------------
/app/views/tricks/card.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{{ $trick->title }}}
5 |
6 |
7 |
8 |
{{ trans('tricks.submitted', array('timeago' => $trick->timeago, 'categories' => $trick->categories)) }}
9 |
{{$trick->view_cache}}
10 |
11 |
{{$trick->vote_cache}}
12 |
13 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/views/admin/tags/edit.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('admin.editing_tag'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
10 | @if($errors->all())
11 |
12 |
{{ trans('admin.please_fix_errors') }}
13 | {{ HTML::ul($errors->all())}}
14 |
15 | @endif
16 |
17 | {{ Form::model($tag,array('class'=>'form-horizontal'))}}
18 |
24 |
29 | {{ Form::close()}}
30 |
31 |
32 |
33 | @stop
--------------------------------------------------------------------------------
/app/views/browse/categories.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('browse.categories'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
{{ trans('browse.categories') }}
8 |
9 |
10 | @include('partials.search')
11 |
12 |
13 |
14 |
31 |
32 |
33 | @stop
34 |
--------------------------------------------------------------------------------
/app/lang/en/user.php:
--------------------------------------------------------------------------------
1 | 'Account Settings',
5 | 'my_favorites' => 'My Favorites',
6 | 'profile' => 'Profile',
7 | 'settings' => 'Settings',
8 | 'welcome' => 'Welcome to Laravel tricks!',
9 | 'welcome_subtitle' => 'Explore the tricks, create and share some of your own!',
10 | 'my_tricks' => 'My tricks',
11 | 'create_new' => 'Create new',
12 | 'submitted_tricks' => 'Submitted tricks',
13 | 'last_trick' => 'Last trick:',
14 | 'total_tricks' => 'Total tricks:',
15 | 'joined' => 'Joined:',
16 | 'upload' => 'Upload',
17 | 'crop_picture' => 'Crop the picture',
18 | 'reset_form' => 'Reset form',
19 | 'update' => 'Update',
20 | 'confirm_password' => 'Confirm Password',
21 | 'password' => 'Password',
22 | 'new_password' => 'New Password',
23 | 'uploading' => 'Uploading',
24 | 'username' => 'Username',
25 | 'user_settings' => 'User settings',
26 | 'back_to_profile' => 'Back to profile',
27 | 'choose' => 'Choose',
28 | 'notice' => 'Notice:',
29 | 'notice_password' => 'Please create a password if you\'d like to login with email as well',
30 | 'profile_picture' => 'Profile Picture',
31 | 'settings_updated' => 'Your settings have been updated!',
32 | 'email' => 'Email',
33 | 'github_user_already_taken' => 'Your Github username has already been taken on this site, please choose a different username',
34 | );
35 |
--------------------------------------------------------------------------------
/app/Tricks/Services/Forms/TrickEditForm.php:
--------------------------------------------------------------------------------
1 | 'required|min:4|unique:tricks,title',
21 | 'description' => 'required|min:10',
22 | 'tags' => 'required',
23 | 'categories' => 'required',
24 | 'code' => 'required'
25 | ];
26 |
27 | public function __construct($id)
28 | {
29 | parent::__construct();
30 |
31 | $this->id = $id;
32 | }
33 |
34 | /**
35 | * Get the prepared validation rules.
36 | *
37 | * @return array
38 | */
39 | protected function getPreparedRules()
40 | {
41 | $this->rules['title'] .= ',' . $this->id;
42 |
43 | return $this->rules;
44 | }
45 |
46 | /**
47 | * Get the prepared input data.
48 | *
49 | * @return array
50 | */
51 | public function getInputData()
52 | {
53 | return array_only($this->inputData, [
54 | 'title', 'description', 'tags', 'categories', 'code'
55 | ]);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Providers/UploadServiceProviderTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
24 |
25 | $mock
26 | ->shouldReceive('share')
27 | ->atLeast()->once()
28 | ->with(Mockery::on(function($callback) {
29 | $mock = Mockery::mock('Illuminate\Foundation\Application');
30 |
31 | $mock
32 | ->shouldReceive('offsetGet')
33 | ->atLeast()->once()
34 | ->with('files')
35 | ->andReturn(
36 | Mockery::mock('Illuminate\Filesystem\Filesystem')
37 | );
38 |
39 | $this->assertInstanceOf('Tricks\Services\Upload\ImageUploadService', $callback($mock));
40 |
41 | return true;
42 | }))
43 | ->andReturn('mocked');
44 |
45 | $mock
46 | ->shouldReceive('offsetSet')
47 | ->atLeast()->once()
48 | ->with('upload.image', 'mocked');
49 |
50 | $provider = new UploadServiceProvider(
51 | $mock
52 | );
53 |
54 | App::register($provider, [], true);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/lang/en/admin.php:
--------------------------------------------------------------------------------
1 | 'Editing category',
5 | 'viewing_category' => 'Viewing category',
6 | 'category_for_tricks' => 'Categories for Laravel tricks',
7 | 'add_new_category' => 'Add new Category',
8 | 'title' => 'Title',
9 | 'name' => 'Name',
10 | 'username' => 'Username',
11 | 'description' => 'Description',
12 | 'num_of_tricks' => '# of Tricks',
13 | 'actions' => 'Actions',
14 | 'cancel' => 'Cancel',
15 | 'edit' => 'Edit',
16 | 'create' => 'Create',
17 | 'keep' => 'Keep',
18 | 'tag' => 'Tag',
19 | 'add_new_tag' => 'Add new Tag',
20 | 'viewing_users' => 'Viewing Users',
21 | 'tag_will_be_deleted' => 'This Tag will be deleted!',
22 | 'all_tags' => 'All Tags',
23 | 'adding_new_tag' => 'Adding new Tag',
24 | 'delete' => 'Delete',
25 | 'viewing_tags' => 'Viewing Tags',
26 | 'adding_new_category' => 'Adding new category',
27 | 'editing_a_category' => 'Editing a category',
28 | 'editing_tag' => 'Editing tag',
29 | 'editing_a_tag' => 'Editing a tag',
30 | 'save_category' => 'Save category',
31 | 'save_tag' => 'Save tag',
32 | 'please_fix_errors' => 'Please fix the errors below:',
33 | 'are_you_sure' => 'Are you sure?',
34 | 'category_will_be_deleted' => 'This Category will be deleted!',
35 | 'showing_all_users' => 'Showing all users',
36 | 'avatar' => 'Avatar',
37 | 'email' => 'Email',
38 | 'tricks' => 'Tricks',
39 | 'date_registered' => 'Date Registered',
40 | 'github_profile' => 'Github Profile?',
41 |
42 | );
43 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Repositories/Eloquent/AbstractRepositoryTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
29 |
30 | $concreteRepository = new ConcreteRepository($modelMock);
31 |
32 | $this->assertSame(
33 | $modelMock,
34 | $this->getProtectedProperty($concreteRepository, 'model')
35 | );
36 | }
37 |
38 | /**
39 | * @group tricks/repositories
40 | */
41 | public function testGetNew()
42 | {
43 | $data = [
44 | 'foo' => 1,
45 | 'bar' => 2,
46 | 'baz' => 3
47 | ];
48 |
49 | $modelMock = Mockery::mock('Illuminate\Database\Eloquent\Model')
50 | ->makePartial();
51 |
52 | $modelMock
53 | ->shouldReceive('newInstance')
54 | ->atLeast()->once()
55 | ->with($data)
56 | ->andReturn('mocked newInstance');
57 |
58 | $concreteRepository = new ConcreteRepository($modelMock);
59 |
60 | $this->assertSame(
61 | 'mocked newInstance',
62 | $concreteRepository->getNew($data)
63 | );
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/Tricks/Presenters/UserPresenter.php:
--------------------------------------------------------------------------------
1 | resource = $user;
19 | }
20 |
21 | /**
22 | * Get the timestamp of the last posted trick of this user.
23 | *
24 | * @param \Illuminate\Pagination\Paginator $tricks
25 | * @return string
26 | */
27 | public function lastActivity($tricks)
28 | {
29 | if (count($tricks) == 0) {
30 | return 'No activity';
31 | }
32 |
33 | $collection = $tricks->getCollection();
34 | $sorted = $collection->sortBy(function ($trick) {
35 | return $trick->created_at;
36 | })->reverse();
37 |
38 | $last = $sorted->first();
39 |
40 | return $last->created_at->diffForHumans();
41 | }
42 |
43 | /**
44 | * Get the full name of this user.
45 | *
46 | * @return string
47 | */
48 | public function fullName()
49 | {
50 | $profile = $this->resource->profile;
51 |
52 | if (! is_null($profile) && ! empty($profile->name)) {
53 | return $profile->name;
54 | }
55 |
56 | return $this->resource->username;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/views/admin/users/list.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('admin.viewing_users'))
2 |
3 | @section('content')
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 | {{ trans('admin.avatar') }}
18 | {{ trans('admin.username') }}
19 | {{ trans('admin.email') }}
20 | {{ trans('admin.tricks') }}
21 | {{ trans('admin.date_registered') }}
22 | {{ trans('admin.github_profile') }}
23 |
24 |
25 |
26 | @foreach($users as $user)
27 |
28 |
29 | {{$user->username}}
30 | {{$user->email}}
31 | {{count($user->tricks)}}
32 | {{$user->created_at}}
33 | {{$user->profile ? 'yes' : 'no'}}
34 |
35 | @endforeach
36 |
37 |
38 |
39 |
40 |
41 |
42 |
{{ $users->links(); }}
43 |
44 |
45 |
46 | @stop
47 |
--------------------------------------------------------------------------------
/public/css/highlight/tomorrow.css:
--------------------------------------------------------------------------------
1 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
2 | .tomorrow-comment, pre .comment, pre .title {
3 | color: #8e908c;
4 | }
5 |
6 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
7 | color: #c82829;
8 | }
9 |
10 | .tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
11 | color: #f5871f;
12 | }
13 |
14 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
15 | color: #eab700;
16 | }
17 |
18 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
19 | color: #718c00;
20 | }
21 |
22 | .tomorrow-aqua, pre .css .hexcolor {
23 | color: #3e999f;
24 | }
25 |
26 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
27 | color: #4271ae;
28 | }
29 |
30 | .tomorrow-purple, pre .keyword, pre .javascript .function {
31 | color: #8959a8;
32 | }
33 |
34 | pre code {
35 | display: block;
36 | background: white;
37 | color: #4d4d4c;
38 | padding: 0.5em;
39 | }
40 |
41 | pre .coffeescript .javascript,
42 | pre .javascript .xml,
43 | pre .tex .formula,
44 | pre .xml .javascript,
45 | pre .xml .vbscript,
46 | pre .xml .css,
47 | pre .xml .cdata {
48 | opacity: 0.5;
49 | }
50 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Services/Forms/RegistrationFormTest.php:
--------------------------------------------------------------------------------
1 | assertEquals(
26 | $repositoryMock,
27 | $this->getProtectedProperty($registrationForm, 'config')
28 | );
29 | }
30 |
31 | /**
32 | * @group tricks/services
33 | */
34 | public function testGetPreparedRules()
35 | {
36 | $repositoryMock = Mockery::mock('Illuminate\Config\Repository');
37 |
38 | $repositoryMock
39 | ->shouldReceive('get')
40 | ->atLeast()->once()
41 | ->with('config.forbidden_usernames')
42 | ->andReturn([
43 | 'first',
44 | 'second'
45 | ]);
46 |
47 | $registrationFormMock = Mockery::mock('Tricks\Services\Forms\RegistrationForm', [
48 | $repositoryMock
49 | ])
50 | ->shouldAllowMockingProtectedMethods()
51 | ->makePartial();
52 |
53 | $before = $this->getProtectedProperty($registrationFormMock, 'rules');
54 |
55 | $after = $before;
56 | $after["username"] .= '|not_in:first,second';
57 |
58 | $this->assertEquals(
59 | $after,
60 | $registrationFormMock->getPreparedRules()
61 | );
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/Tricks/Repositories/TagRepositoryInterface.php:
--------------------------------------------------------------------------------
1 | name) pairs of all tags.
9 | *
10 | * @return array
11 | */
12 | public function listAll();
13 |
14 | /**
15 | * Find all tags.
16 | *
17 | * @param string $orderColumn
18 | * @param string $orderDir
19 | * @return \Illuminate\Database\Eloquent\Collection|\Tricks\Tag[]
20 | */
21 | public function findAll($orderColumn = 'created_at', $orderDir = 'desc');
22 |
23 | /**
24 | * Find a tag by id.
25 | *
26 | * @param mixed $id
27 | * @return \Tricks\Tag
28 | */
29 | public function findById($id);
30 |
31 | /**
32 | * Find all tags with the associated number of tricks.
33 | *
34 | * @return \Illuminate\Database\Eloquent\Collection
35 | */
36 | public function findAllWithTrickCount();
37 |
38 | /**
39 | * Create a new tag in the database.
40 | *
41 | * @param array $data
42 | * @return \Tricks\Tag
43 | */
44 | public function create(array $data);
45 |
46 | /**
47 | * Update the specified tag in the database.
48 | *
49 | * @param mixed $id
50 | * @param array $data
51 | * @return \Tricks\Category
52 | */
53 | public function update($id, array $data);
54 |
55 | /**
56 | * Delete the specified tag from the database.
57 | *
58 | * @param mixed $id
59 | * @return void
60 | */
61 | public function delete($id);
62 | }
63 |
--------------------------------------------------------------------------------
/app/Tricks/Trick.php:
--------------------------------------------------------------------------------
1 | belongsToMany('Tricks\User', 'votes');
38 | }
39 |
40 | /**
41 | * Query the user that posted the trick.
42 | *
43 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
44 | */
45 | public function user()
46 | {
47 | return $this->belongsTo('Tricks\User');
48 | }
49 |
50 | /**
51 | * Query the tags under which the trick was posted.
52 | *
53 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
54 | */
55 | public function tags()
56 | {
57 | return $this->belongsToMany('Tricks\Tag');
58 | }
59 |
60 | /**
61 | * Query the categories under which the trick was posted.
62 | *
63 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
64 | */
65 | public function categories()
66 | {
67 | return $this->belongsToMany('Tricks\Category');
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/config/queue.php:
--------------------------------------------------------------------------------
1 | 'iron',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => array(
32 |
33 | 'sync' => array(
34 | 'driver' => 'sync',
35 | ),
36 |
37 | 'beanstalkd' => array(
38 | 'driver' => 'beanstalkd',
39 | 'host' => 'localhost',
40 | 'queue' => 'default',
41 | ),
42 |
43 | 'sqs' => array(
44 | 'driver' => 'sqs',
45 | 'key' => 'your-public-key',
46 | 'secret' => 'your-secret-key',
47 | 'queue' => 'your-queue-url',
48 | 'region' => 'us-east-1',
49 | ),
50 |
51 | 'iron' => array(
52 | 'driver' => 'iron',
53 | 'project' => '',
54 | 'token' => '',
55 | 'queue' => '',
56 | ),
57 |
58 | ),
59 |
60 | );
61 |
--------------------------------------------------------------------------------
/app/views/user/public.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', $user->fullName)
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{ $user->fullName }}
15 |
16 |
17 | {{ trans('user.joined') }} {{ $user->created_at->diffForHumans() }}
18 |
19 |
20 |
21 |
22 |
23 | {{ trans('user.total_tricks') }}
24 | {{ count($tricks) }}
25 |
26 |
27 | {{ trans('user.last_trick') }}
28 | {{ $user->lastActivity($tricks) }}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
{{ trans('user.submitted_tricks') }}
38 |
39 |
40 |
41 | @include('tricks.grid', [ 'tricks' => $tricks ])
42 |
43 |
44 |
45 | @stop
46 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Providers/NavigationServiceProviderTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
24 |
25 | $mock
26 | ->shouldReceive('share')
27 | ->atLeast()->once()
28 | ->with(Mockery::on(function($callback) {
29 | $mock = Mockery::mock('Illuminate\Foundation\Application')
30 | ->makePartial();
31 |
32 | $mock
33 | ->shouldReceive('offsetGet')
34 | ->atLeast()->once()
35 | ->with('config')
36 | ->andReturn(
37 | Mockery::mock('Illuminate\Config\Repository')
38 | );
39 |
40 | $mock
41 | ->shouldReceive('offsetGet')
42 | ->atLeast()->once()
43 | ->with('auth')
44 | ->andReturn(
45 | Mockery::mock('Illuminate\Auth\AuthManager')
46 | );
47 |
48 | $this->assertInstanceOf('Tricks\Services\Navigation\Builder', $callback($mock));
49 |
50 | return true;
51 | }))
52 | ->andReturn('mocked');
53 |
54 | $mock
55 | ->shouldReceive('offsetSet')
56 | ->atLeast()->once()
57 | ->with('navigation.builder', 'mocked');
58 |
59 | $provider = new NavigationServiceProvider(
60 | $mock
61 | );
62 |
63 | App::register($provider, [], true);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/public/css/highlight/tomorrow-night-bright.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Bright Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
4 | .tomorrow-comment, pre .comment, pre .title {
5 | color: #969896;
6 | }
7 |
8 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
9 | color: #d54e53;
10 | }
11 |
12 | .tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
13 | color: #e78c45;
14 | }
15 |
16 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
17 | color: #e7c547;
18 | }
19 |
20 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
21 | color: #b9ca4a;
22 | }
23 |
24 | .tomorrow-aqua, pre .css .hexcolor {
25 | color: #70c0b1;
26 | }
27 |
28 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
29 | color: #7aa6da;
30 | }
31 |
32 | .tomorrow-purple, pre .keyword, pre .javascript .function {
33 | color: #c397d8;
34 | }
35 |
36 | pre code {
37 | display: block;
38 | background: black;
39 | color: #eaeaea;
40 | padding: 0.5em;
41 | }
42 |
43 | pre .coffeescript .javascript,
44 | pre .javascript .xml,
45 | pre .tex .formula,
46 | pre .xml .javascript,
47 | pre .xml .vbscript,
48 | pre .xml .css,
49 | pre .xml .cdata {
50 | opacity: 0.5;
51 | }
52 |
--------------------------------------------------------------------------------
/public/css/highlight/tomorrow-night-eighties.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Eighties Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
4 | .tomorrow-comment, pre .comment, pre .title {
5 | color: #999999;
6 | }
7 |
8 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
9 | color: #f2777a;
10 | }
11 |
12 | .tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
13 | color: #f99157;
14 | }
15 |
16 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
17 | color: #ffcc66;
18 | }
19 |
20 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
21 | color: #99cc99;
22 | }
23 |
24 | .tomorrow-aqua, pre .css .hexcolor {
25 | color: #66cccc;
26 | }
27 |
28 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
29 | color: #6699cc;
30 | }
31 |
32 | .tomorrow-purple, pre .keyword, pre .javascript .function {
33 | color: #cc99cc;
34 | }
35 |
36 | pre code {
37 | display: block;
38 | background: #2d2d2d;
39 | color: #cccccc;
40 | padding: 0.5em;
41 | }
42 |
43 | pre .coffeescript .javascript,
44 | pre .javascript .xml,
45 | pre .tex .formula,
46 | pre .xml .javascript,
47 | pre .xml .vbscript,
48 | pre .xml .css,
49 | pre .xml .cdata {
50 | opacity: 0.5;
51 | }
52 |
--------------------------------------------------------------------------------
/app/views/search/result.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('search.search_results_for', array('term' => $term)))
2 |
3 | @section('scripts')
4 |
7 |
8 | @if(count($tricks))
9 |
10 |
13 | @endif
14 | @stop
15 |
16 | @section('content')
17 |
18 | @if($term != '')
19 |
20 |
21 |
{{ $tricks->getTotal(); }} Search {{Str::plural('result', count($tricks));}} for "{{{$term}}} "
22 |
23 |
24 | @include('partials.search',['term'=>$term])
25 |
26 |
27 |
28 | @include('tricks.grid', ['tricks' => $tricks, 'appends' => [ 'q' => $term ]])
29 |
30 | @else
31 |
32 |
33 |
{{ trans('search.please_provide_search_term') }}
34 |
35 |
36 | @include('partials.search')
37 |
38 |
39 | @endif
40 |
41 | @stop
42 |
--------------------------------------------------------------------------------
/app/Tricks/Services/Forms/RegistrationForm.php:
--------------------------------------------------------------------------------
1 | 'required|min:4|alpha_num|unique:users,username',
23 | 'email' => 'required|email|min:5|unique:users',
24 | 'password' => 'required|min:6|confirmed'
25 | ];
26 |
27 | /**
28 | * Array of custom validation messages.
29 | *
30 | * @var array
31 | */
32 | protected $messages = [
33 | 'not_in' => 'The selected username is reserved, please try a different username.'
34 | ];
35 |
36 | /**
37 | * Create a new RegistrationForm instance.
38 | *
39 | * @param \Illuminate\Config\Repository $config
40 | * @return void
41 | */
42 | public function __construct(Repository $config)
43 | {
44 | parent::__construct();
45 |
46 | $this->config = $config;
47 | }
48 |
49 | /**
50 | * Get the prepared validation rules.
51 | *
52 | * @return array
53 | */
54 | protected function getPreparedRules()
55 | {
56 | $forbidden = $this->config->get('config.forbidden_usernames');
57 | $forbidden = implode(',', $forbidden);
58 |
59 | $this->rules['username'] .= '|not_in:' . $forbidden;
60 |
61 | return $this->rules;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/config/social.php:
--------------------------------------------------------------------------------
1 | array(
19 | 'clientId' => '',
20 | 'clientSecret' => '',
21 | 'scopes' => array('user:email'),
22 | 'user_agent' => ''
23 | ),
24 |
25 | /*
26 | |--------------------------------------------------------------------------
27 | | These are config variables for Disqus commenting system
28 | |--------------------------------------------------------------------------
29 | | To use these you first have to create a new forum on Disqus: http://disqus.com/
30 | | Then copy and paste the PublicKey and the forum name found in the integrations.
31 | |
32 | */
33 | 'disqus' => array(
34 | 'publicKey' => '',
35 | 'forum' => '',
36 | 'requestUrl' => 'http://disqus.com/api/3.0/threads/set.json',
37 | 'threadFormat' => 'ident:',
38 | ),
39 | );
40 |
--------------------------------------------------------------------------------
/public/css/highlight/solarized_dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | background: #002b36; color: #839496;
10 | }
11 |
12 | pre .comment,
13 | pre .template_comment,
14 | pre .diff .header,
15 | pre .doctype,
16 | pre .pi,
17 | pre .lisp .string,
18 | pre .javadoc {
19 | color: #586e75;
20 | font-style: italic;
21 | }
22 |
23 | pre .keyword,
24 | pre .winutils,
25 | pre .method,
26 | pre .addition,
27 | pre .css .tag,
28 | pre .request,
29 | pre .status,
30 | pre .nginx .title {
31 | color: #859900;
32 | }
33 |
34 | pre .number,
35 | pre .command,
36 | pre .string,
37 | pre .tag .value,
38 | pre .rules .value,
39 | pre .phpdoc,
40 | pre .tex .formula,
41 | pre .regexp,
42 | pre .hexcolor {
43 | color: #2aa198;
44 | }
45 |
46 | pre .title,
47 | pre .localvars,
48 | pre .chunk,
49 | pre .decorator,
50 | pre .built_in,
51 | pre .identifier,
52 | pre .vhdl .literal,
53 | pre .id,
54 | pre .css .function {
55 | color: #268bd2;
56 | }
57 |
58 | pre .attribute,
59 | pre .variable,
60 | pre .lisp .body,
61 | pre .smalltalk .number,
62 | pre .constant,
63 | pre .class .title,
64 | pre .parent,
65 | pre .haskell .type {
66 | color: #b58900;
67 | }
68 |
69 | pre .preprocessor,
70 | pre .preprocessor .keyword,
71 | pre .shebang,
72 | pre .symbol,
73 | pre .symbol .string,
74 | pre .diff .change,
75 | pre .special,
76 | pre .attr_selector,
77 | pre .important,
78 | pre .subst,
79 | pre .cdata,
80 | pre .clojure .title,
81 | pre .css .pseudo {
82 | color: #cb4b16;
83 | }
84 |
85 | pre .deletion {
86 | color: #dc322f;
87 | }
88 |
89 | pre .tex .formula {
90 | background: #073642;
91 | }
92 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_11_13_222813_create_profiles_table.php:
--------------------------------------------------------------------------------
1 | engine = 'InnoDB';
12 |
13 | $table->increments('id')->unsigned();
14 | $table->string('uid');
15 | $table->integer('user_id')->unsigned();
16 | $table->string('username')->nullable()->default(NULL);
17 | $table->string('name')->nullable()->default(NULL);
18 | $table->string('email')->nullable()->default(NULL);
19 | $table->string('first_name')->nullable()->default(NULL);
20 | $table->string('last_name')->nullable()->default(NULL);
21 | $table->string('location')->nullable()->default(NULL);
22 | $table->string('description')->nullable()->default(NULL);
23 | $table->string('image_url')->nullable()->default(NULL);
24 | $table->string('access_token')->nullable()->default(NULL);
25 | $table->string('access_token_secret')->nullable()->default(NULL);
26 | $table->timestamps();
27 |
28 | $table->foreign('user_id')
29 | ->references('id')->on('users')
30 | ->onUpdate('cascade')
31 | ->onDelete('cascade');
32 | });
33 | }
34 |
35 | public function down()
36 | {
37 | Schema::table('profiles', function($table)
38 | {
39 | $table->dropForeign('profiles_user_id_foreign');
40 | });
41 |
42 | Schema::drop('profiles');
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/public/css/highlight/solarized_light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | background: #fdf6e3; color: #657b83;
10 | }
11 |
12 | pre .comment,
13 | pre .template_comment,
14 | pre .diff .header,
15 | pre .doctype,
16 | pre .pi,
17 | pre .lisp .string,
18 | pre .javadoc {
19 | color: #93a1a1;
20 | font-style: italic;
21 | }
22 |
23 | pre .keyword,
24 | pre .winutils,
25 | pre .method,
26 | pre .addition,
27 | pre .css .tag,
28 | pre .request,
29 | pre .status,
30 | pre .nginx .title {
31 | color: #859900;
32 | }
33 |
34 | pre .number,
35 | pre .command,
36 | pre .string,
37 | pre .tag .value,
38 | pre .rules .value,
39 | pre .phpdoc,
40 | pre .tex .formula,
41 | pre .regexp,
42 | pre .hexcolor {
43 | color: #2aa198;
44 | }
45 |
46 | pre .title,
47 | pre .localvars,
48 | pre .chunk,
49 | pre .decorator,
50 | pre .built_in,
51 | pre .identifier,
52 | pre .vhdl .literal,
53 | pre .id,
54 | pre .css .function {
55 | color: #268bd2;
56 | }
57 |
58 | pre .attribute,
59 | pre .variable,
60 | pre .lisp .body,
61 | pre .smalltalk .number,
62 | pre .constant,
63 | pre .class .title,
64 | pre .parent,
65 | pre .haskell .type {
66 | color: #b58900;
67 | }
68 |
69 | pre .preprocessor,
70 | pre .preprocessor .keyword,
71 | pre .shebang,
72 | pre .symbol,
73 | pre .symbol .string,
74 | pre .diff .change,
75 | pre .special,
76 | pre .attr_selector,
77 | pre .important,
78 | pre .subst,
79 | pre .cdata,
80 | pre .clojure .title,
81 | pre .css .pseudo {
82 | color: #cb4b16;
83 | }
84 |
85 | pre .deletion {
86 | color: #dc322f;
87 | }
88 |
89 | pre .tex .formula {
90 | background: #eee8d5;
91 | }
92 |
--------------------------------------------------------------------------------
/app/views/admin/categories/edit.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('admin.editing_category'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
10 |
11 | @if($errors->all())
12 |
13 |
{{ trans('admin.please_fix_errors') }}
14 | {{ HTML::ul($errors->all())}}
15 |
16 | @endif
17 |
18 | {{ Form::model($category,array('class'=>'form-horizontal'))}}
19 |
25 |
31 |
36 | {{ Form::close()}}
37 |
38 |
39 |
40 | @stop
--------------------------------------------------------------------------------
/public/css/highlight/tomorrow-night.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Theme */
2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
5 | .tomorrow-comment, pre .comment, pre .title {
6 | color: #969896;
7 | }
8 |
9 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
10 | color: #cc6666;
11 | }
12 |
13 | .tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
14 | color: #de935f;
15 | }
16 |
17 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
18 | color: #f0c674;
19 | }
20 |
21 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
22 | color: #b5bd68;
23 | }
24 |
25 | .tomorrow-aqua, pre .css .hexcolor {
26 | color: #8abeb7;
27 | }
28 |
29 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
30 | color: #81a2be;
31 | }
32 |
33 | .tomorrow-purple, pre .keyword, pre .javascript .function {
34 | color: #b294bb;
35 | }
36 |
37 | pre code {
38 | display: block;
39 | background: #1d1f21;
40 | color: #c5c8c6;
41 | padding: 0.5em;
42 | }
43 |
44 | pre .coffeescript .javascript,
45 | pre .javascript .xml,
46 | pre .tex .formula,
47 | pre .xml .javascript,
48 | pre .xml .vbscript,
49 | pre .xml .css,
50 | pre .xml .cdata {
51 | opacity: 0.5;
52 | }
53 |
--------------------------------------------------------------------------------
/app/Tricks/Repositories/UserRepositoryInterface.php:
--------------------------------------------------------------------------------
1 | null,
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Enable data collection, when Clockwork is disabled
24 | |--------------------------------------------------------------------------
25 | |
26 | | This setting controls, whether data about application requests will be
27 | | recorded even when Clockwork is disabled (useful for later analysis).
28 | | Default: true
29 | |
30 | */
31 |
32 | 'collect_data_always' => true,
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | Filter collected data
37 | |--------------------------------------------------------------------------
38 | |
39 | | You can filter collected data by specifying what you don't want to collect
40 | | here.
41 | |
42 | */
43 |
44 | 'filter' => array(
45 | 'routes', // It might be a good idea to not collect routes in every request as this might use a lot of disk space
46 | )
47 |
48 | );
49 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
7 | */
8 |
9 | /*
10 | |--------------------------------------------------------------------------
11 | | Register The Auto Loader
12 | |--------------------------------------------------------------------------
13 | |
14 | | Composer provides a convenient, automatically generated class loader
15 | | for our application. We just need to utilize it! We'll require it
16 | | into the script here so that we do not have to worry about the
17 | | loading of any our classes "manually". Feels great to relax.
18 | |
19 | */
20 |
21 | require __DIR__.'/../bootstrap/autoload.php';
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Turn On The Lights
26 | |--------------------------------------------------------------------------
27 | |
28 | | We need to illuminate PHP development, so let's turn on the lights.
29 | | This bootstraps the framework and gets it ready for use, then it
30 | | will load up this application so that we can run it and send
31 | | the responses back to the browser and delight these users.
32 | |
33 | */
34 |
35 | $app = require_once __DIR__.'/../bootstrap/start.php';
36 |
37 | /*
38 | |--------------------------------------------------------------------------
39 | | Run The Application
40 | |--------------------------------------------------------------------------
41 | |
42 | | Once we have the application, we can simply call the run method,
43 | | which will execute the request and send the response back to
44 | | the client's browser allowing them to enjoy the creative
45 | | and wonderful application we have whipped up for them.
46 | |
47 | */
48 |
49 | $app->run();
50 |
--------------------------------------------------------------------------------
/app/views/password/remind.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('password.reset_password'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
{{ trans('password.reset') }}
9 |
10 | @if(Session::has('success'))
11 |
12 | ×
13 | {{ trans('password.mail_has_been_sent') }}
14 |
15 | @endif
16 |
17 | {{ Form::open(['route' => 'auth.remind']) }}
18 |
19 | {{ Form::label('email', trans('password.email'), [ 'class' => 'control-label' ]) }}
20 | {{ Form::text('email', null, ['class'=>'form-control', 'placeholder' => trans('password.email_placeholder')])}}
21 |
22 |
23 | {{ trans('password.reset') }}
24 |
25 | {{ Form::close() }}
26 |
27 |
30 |
31 |
32 |
33 |
34 | @stop
35 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Providers/RepositoryServiceProviderTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
24 |
25 | $mock
26 | ->shouldReceive('bind')
27 | ->atLeast()->once()
28 | ->with(
29 | 'Tricks\Repositories\UserRepositoryInterface',
30 | 'Tricks\Repositories\Eloquent\UserRepository'
31 | );
32 |
33 | $mock
34 | ->shouldReceive('bind')
35 | ->atLeast()->once()
36 | ->with(
37 | 'Tricks\Repositories\ProfileRepositoryInterface',
38 | 'Tricks\Repositories\Eloquent\ProfileRepository'
39 | );
40 |
41 | $mock
42 | ->shouldReceive('bind')
43 | ->atLeast()->once()
44 | ->with(
45 | 'Tricks\Repositories\TrickRepositoryInterface',
46 | 'Tricks\Repositories\Eloquent\TrickRepository'
47 | );
48 |
49 | $mock
50 | ->shouldReceive('bind')
51 | ->atLeast()->once()
52 | ->with(
53 | 'Tricks\Repositories\TagRepositoryInterface',
54 | 'Tricks\Repositories\Eloquent\TagRepository'
55 | );
56 |
57 | $mock
58 | ->shouldReceive('bind')
59 | ->atLeast()->once()
60 | ->with(
61 | 'Tricks\Repositories\CategoryRepositoryInterface',
62 | 'Tricks\Repositories\Eloquent\CategoryRepository'
63 | );
64 |
65 | $provider = new RepositoryServiceProvider(
66 | $mock
67 | );
68 |
69 | App::register($provider, [], true);
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/app/tests/Tricks/TrickTest.php:
--------------------------------------------------------------------------------
1 | makePartial();
23 |
24 | $mock
25 | ->shouldReceive('belongsToMany')
26 | ->atLeast()->once()
27 | ->with('Tricks\User', 'votes')
28 | ->andReturn('mocked');
29 |
30 | $this->assertEquals('mocked', $mock->votes());
31 | }
32 |
33 | /**
34 | * @group tricks
35 | */
36 | public function testUser()
37 | {
38 | $mock = Mockery::mock('Tricks\Trick')
39 | ->makePartial();
40 |
41 | $mock
42 | ->shouldReceive('belongsTo')
43 | ->atLeast()->once()
44 | ->with('Tricks\User')
45 | ->andReturn('mocked');
46 |
47 | $this->assertEquals('mocked', $mock->user());
48 | }
49 |
50 | /**
51 | * @group tricks
52 | */
53 | public function testTags()
54 | {
55 | $mock = Mockery::mock('Tricks\Trick')
56 | ->makePartial();
57 |
58 | $mock
59 | ->shouldReceive('belongsToMany')
60 | ->atLeast()->once()
61 | ->with('Tricks\Tag')
62 | ->andReturn('mocked');
63 |
64 | $this->assertEquals('mocked', $mock->tags());
65 | }
66 |
67 | /**
68 | * @group tricks
69 | */
70 | public function testCategories()
71 | {
72 | $mock = Mockery::mock('Tricks\Trick')
73 | ->makePartial();
74 |
75 | $mock
76 | ->shouldReceive('belongsToMany')
77 | ->atLeast()->once()
78 | ->with('Tricks\Category')
79 | ->andReturn('mocked');
80 |
81 | $this->assertEquals('mocked', $mock->categories());
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/Tricks/Providers/SocialServiceProvider.php:
--------------------------------------------------------------------------------
1 | registerGithub();
21 | $this->registerDisqus();
22 | }
23 |
24 | /**
25 | * Register the Github services.
26 | *
27 | * @return void
28 | */
29 | protected function registerGithub()
30 | {
31 | $this->app['github.provider'] = $this->app->share(function ($app) {
32 | return new GithubProvider($app['config']->get('social.github'));
33 | });
34 |
35 | $this->app['github'] = $this->app->share(function ($app) {
36 | $provider = $app['github.provider'];
37 | $config = $app['config'];
38 | $users = $app['Tricks\Repositories\UserRepositoryInterface'];
39 | $profiles = $app['Tricks\Repositories\ProfileRepositoryInterface'];
40 |
41 | return new Github($provider, $config, $users, $profiles);
42 | });
43 | }
44 |
45 | /**
46 | * Register the Disqus service.
47 | *
48 | * @return void
49 | */
50 | protected function registerDisqus()
51 | {
52 | $this->app['disqus'] = $this->app->share(function ($app) {
53 | $config = $app['config'];
54 | $client = new GuzzleClient($config->get('social.disqus.requestUrl'));
55 |
56 | return new Disqus($client, $config);
57 | });
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/public/css/highlight/foundation.css:
--------------------------------------------------------------------------------
1 | /*
2 | Description: Foundation 4 docs style for highlight.js
3 | Author: Dan Allen
4 | Website: http://foundation.zurb.com/docs/
5 | Version: 1.0
6 | Date: 2013-04-02
7 | */
8 |
9 | pre code {
10 | display: block; padding: 0.5em;
11 | background: #eee;
12 | }
13 |
14 | pre .decorator,
15 | pre .annotation {
16 | color: #000077;
17 | }
18 |
19 | pre .attribute {
20 | color: #070;
21 | }
22 |
23 | pre .value,
24 | pre .string,
25 | pre .scss .value .string {
26 | color: #d14;
27 | }
28 |
29 | pre .comment {
30 | color: #998;
31 | font-style: italic;
32 | }
33 |
34 | pre .function .title {
35 | color: #900;
36 | }
37 |
38 | pre .class {
39 | color: #458;
40 | }
41 |
42 | pre .id,
43 | pre .pseudo,
44 | pre .constant,
45 | pre .hexcolor {
46 | color: teal;
47 | }
48 |
49 | pre .variable {
50 | color: #336699;
51 | }
52 |
53 | pre .javadoc {
54 | color: #997700;
55 | }
56 |
57 | pre .pi,
58 | pre .doctype {
59 | color: #3344bb;
60 | }
61 |
62 | pre .number {
63 | color: #099;
64 | }
65 |
66 | pre .important {
67 | color: #f00;
68 | }
69 |
70 | pre .label {
71 | color: #970;
72 | }
73 |
74 | pre .preprocessor {
75 | color: #579;
76 | }
77 |
78 | pre .reserved,
79 | pre .keyword,
80 | pre .scss .value {
81 | color: #000;
82 | }
83 |
84 | pre .regexp {
85 | background-color: #fff0ff;
86 | color: #880088;
87 | }
88 |
89 | pre .symbol {
90 | color: #990073;
91 | }
92 |
93 | pre .symbol .string {
94 | color: #a60;
95 | }
96 |
97 | pre .tag {
98 | color: #007700;
99 | }
100 |
101 | pre .at_rule,
102 | pre .at_rule .keyword {
103 | color: #088;
104 | }
105 |
106 | pre .at_rule .preprocessor {
107 | color: #808;
108 | }
109 |
110 | pre .scss .tag,
111 | pre .scss .attribute {
112 | color: #339;
113 | }
114 |
--------------------------------------------------------------------------------
/public/css/highlight/vs.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Visual Studio-like style based on original C# coloring by Jason Diamond
4 |
5 | */
6 | pre code {
7 | display: block; padding: 0.5em;
8 | background: white; color: black;
9 | }
10 |
11 | pre .comment,
12 | pre .annotation,
13 | pre .template_comment,
14 | pre .diff .header,
15 | pre .chunk,
16 | pre .apache .cbracket {
17 | color: rgb(0, 128, 0);
18 | }
19 |
20 | pre .keyword,
21 | pre .id,
22 | pre .built_in,
23 | pre .smalltalk .class,
24 | pre .winutils,
25 | pre .bash .variable,
26 | pre .tex .command,
27 | pre .request,
28 | pre .status,
29 | pre .nginx .title,
30 | pre .xml .tag,
31 | pre .xml .tag .value {
32 | color: rgb(0, 0, 255);
33 | }
34 |
35 | pre .string,
36 | pre .title,
37 | pre .parent,
38 | pre .tag .value,
39 | pre .rules .value,
40 | pre .rules .value .number,
41 | pre .ruby .symbol,
42 | pre .ruby .symbol .string,
43 | pre .aggregate,
44 | pre .template_tag,
45 | pre .django .variable,
46 | pre .addition,
47 | pre .flow,
48 | pre .stream,
49 | pre .apache .tag,
50 | pre .date,
51 | pre .tex .formula,
52 | pre .coffeescript .attribute {
53 | color: rgb(163, 21, 21);
54 | }
55 |
56 | pre .ruby .string,
57 | pre .decorator,
58 | pre .filter .argument,
59 | pre .localvars,
60 | pre .array,
61 | pre .attr_selector,
62 | pre .pseudo,
63 | pre .pi,
64 | pre .doctype,
65 | pre .deletion,
66 | pre .envvar,
67 | pre .shebang,
68 | pre .preprocessor,
69 | pre .userType,
70 | pre .apache .sqbracket,
71 | pre .nginx .built_in,
72 | pre .tex .special,
73 | pre .prompt {
74 | color: rgb(43, 145, 175);
75 | }
76 |
77 | pre .phpdoc,
78 | pre .javadoc,
79 | pre .xmlDocTag {
80 | color: rgb(128, 128, 128);
81 | }
82 |
83 | pre .vhdl .typename { font-weight: bold; }
84 | pre .vhdl .string { color: #666666; }
85 | pre .vhdl .literal { color: rgb(163, 21, 21); }
86 | pre .vhdl .attribute { color: #00B0E8; }
87 |
88 | pre .xml .attribute { color: rgb(255, 0, 0); }
89 |
--------------------------------------------------------------------------------
/app/tests/Tricks/Services/Forms/TrickEditFormTest.php:
--------------------------------------------------------------------------------
1 | assertEquals(
24 | 1,
25 | $this->getProtectedProperty($trickEditForm, 'id')
26 | );
27 | }
28 |
29 | /**
30 | * @group tricks/services
31 | */
32 | public function testGetPreparedRules()
33 | {
34 | $trickEditFormMock = Mockery::mock('Tricks\Services\Forms\TrickEditForm', [
35 | 1
36 | ])
37 | ->shouldAllowMockingProtectedMethods()
38 | ->makePartial();
39 |
40 | $before = $this->getProtectedProperty($trickEditFormMock, 'rules');
41 |
42 | $after = $before;
43 | $after["title"] .= ',1';
44 |
45 | $this->assertEquals(
46 | $after,
47 | $trickEditFormMock->getPreparedRules()
48 | );
49 | }
50 |
51 | /**
52 | * @group tricks/services
53 | */
54 | public function testGetInputData()
55 | {
56 | $before = [
57 | 'title' => 'foo',
58 | 'description' => 'bar',
59 | 'tags' => '1,2,3',
60 | 'categories' => '1,2,3',
61 | 'code' => 'baz',
62 | 'invalid' => 'YOU SHALL NOT PASS'
63 | ];
64 |
65 | $after = [
66 | 'title' => 'foo',
67 | 'description' => 'bar',
68 | 'tags' => '1,2,3',
69 | 'categories' => '1,2,3',
70 | 'code' => 'baz'
71 | ];
72 |
73 | $trickEditForm = new TrickEditForm(1);
74 |
75 | $this->setProtectedProperty($trickEditForm, 'inputData', $before);
76 |
77 | $this->assertEquals(
78 | array_keys($after),
79 | array_keys($trickEditForm->getInputData())
80 | );
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/bootstrap/paths.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/../app',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Public Path
21 | |--------------------------------------------------------------------------
22 | |
23 | | The public path contains the assets for your web application, such as
24 | | your JavaScript and CSS files, and also contains the primary entry
25 | | point for web requests into these applications from the outside.
26 | |
27 | */
28 |
29 | 'public' => __DIR__.'/../public',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Base Path
34 | |--------------------------------------------------------------------------
35 | |
36 | | The base path is the root of the Laravel installation. Most likely you
37 | | will not need to change this value. But, if for some wild reason it
38 | | is necessary you will do so here, just proceed with some caution.
39 | |
40 | */
41 |
42 | 'base' => __DIR__.'/..',
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Storage Path
47 | |--------------------------------------------------------------------------
48 | |
49 | | The storage path is used by Laravel to store cached Blade views, logs
50 | | and other pieces of information. You may modify the path here when
51 | | you want to change the location of this directory for your apps.
52 | |
53 | */
54 |
55 | 'storage' => __DIR__.'/../app/storage',
56 |
57 | );
58 |
--------------------------------------------------------------------------------
/app/views/home/about.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('home.about_tricks_website'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
{{ trans('home.about_title') }}
8 |
9 |
10 | {{ trans('home.about_what_is_this') }}
11 |
12 |
13 |
14 | {{ trans('home.about_who') }}
15 |
16 |
17 |
39 |
40 |
41 |
42 | @stop
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/public/css/highlight/ir_black.css:
--------------------------------------------------------------------------------
1 | /*
2 | IR_Black style (c) Vasily Mikhailitchenko
3 | */
4 |
5 | pre code {
6 | display: block; padding: 0.5em;
7 | background: #000; color: #f8f8f8;
8 | }
9 |
10 | pre .shebang,
11 | pre .comment,
12 | pre .template_comment,
13 | pre .javadoc {
14 | color: #7c7c7c;
15 | }
16 |
17 | pre .keyword,
18 | pre .tag,
19 | pre .tex .command,
20 | pre .request,
21 | pre .status,
22 | pre .clojure .attribute {
23 | color: #96CBFE;
24 | }
25 |
26 | pre .sub .keyword,
27 | pre .method,
28 | pre .list .title,
29 | pre .nginx .title {
30 | color: #FFFFB6;
31 | }
32 |
33 | pre .string,
34 | pre .tag .value,
35 | pre .cdata,
36 | pre .filter .argument,
37 | pre .attr_selector,
38 | pre .apache .cbracket,
39 | pre .date,
40 | pre .coffeescript .attribute {
41 | color: #A8FF60;
42 | }
43 |
44 | pre .subst {
45 | color: #DAEFA3;
46 | }
47 |
48 | pre .regexp {
49 | color: #E9C062;
50 | }
51 |
52 | pre .title,
53 | pre .sub .identifier,
54 | pre .pi,
55 | pre .decorator,
56 | pre .tex .special,
57 | pre .haskell .type,
58 | pre .constant,
59 | pre .smalltalk .class,
60 | pre .javadoctag,
61 | pre .yardoctag,
62 | pre .phpdoc,
63 | pre .nginx .built_in {
64 | color: #FFFFB6;
65 | }
66 |
67 | pre .symbol,
68 | pre .ruby .symbol .string,
69 | pre .number,
70 | pre .variable,
71 | pre .vbscript,
72 | pre .literal {
73 | color: #C6C5FE;
74 | }
75 |
76 | pre .css .tag {
77 | color: #96CBFE;
78 | }
79 |
80 | pre .css .rules .property,
81 | pre .css .id {
82 | color: #FFFFB6;
83 | }
84 |
85 | pre .css .class {
86 | color: #FFF;
87 | }
88 |
89 | pre .hexcolor {
90 | color: #C6C5FE;
91 | }
92 |
93 | pre .number {
94 | color:#FF73FD;
95 | }
96 |
97 | pre .coffeescript .javascript,
98 | pre .javascript .xml,
99 | pre .tex .formula,
100 | pre .xml .javascript,
101 | pre .xml .vbscript,
102 | pre .xml .css,
103 | pre .xml .cdata {
104 | opacity: 0.7;
105 | }
106 |
--------------------------------------------------------------------------------
/app/Tricks/Services/Forms/SettingsForm.php:
--------------------------------------------------------------------------------
1 | 'required|min:4',
31 | 'password' => 'confirmed|min:6'
32 | ];
33 |
34 | /**
35 | * Create a new SettingsForm instance.
36 | *
37 | * @param \Illuminate\Config\Repository $config
38 | * @param \Illuminate\Auth\AuthManager $auth
39 | * @return void
40 | */
41 | public function __construct(Repository $config, AuthManager $auth)
42 | {
43 | parent::__construct();
44 |
45 | $this->config = $config;
46 | $this->auth = $auth;
47 | }
48 |
49 | /**
50 | * Get the prepared validation rules.
51 | *
52 | * @return array
53 | */
54 | protected function getPreparedRules()
55 | {
56 | $forbidden = implode(',', $this->config->get('config.forbidden_usernames'));
57 | $userId = $this->auth->user()->id;
58 |
59 | $this->rules['username'] .= '|not_in:' . $forbidden;
60 | $this->rules['username'] .= '|unique:users,username,' . $userId;
61 |
62 | return $this->rules;
63 | }
64 |
65 | /**
66 | * Get the prepared input data.
67 | *
68 | * @return array
69 | */
70 | public function getInputData()
71 | {
72 | return array_only($this->inputData, [
73 | 'username', 'password', 'password_confirmation'
74 | ]);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/app/Tricks/Repositories/CategoryRepositoryInterface.php:
--------------------------------------------------------------------------------
1 | name) pairs of all categories.
9 | *
10 | * @return array
11 | */
12 | public function listAll();
13 |
14 | /**
15 | * Find all categories.
16 | *
17 | * @param string $orderColumn
18 | * @param string $orderDir
19 | * @return \Illuminate\Database\Eloquent\Collection|\Tricks\Category[]
20 | */
21 | public function findAll($orderColumn = 'created_at', $orderDir = 'desc');
22 |
23 | /**
24 | * Find all categories with the associated number of tricks.
25 | *
26 | * @return \Illuminate\Database\Eloquent\Collection|\Tricks\Category[]
27 | */
28 | public function findAllWithTrickCount();
29 |
30 | /**
31 | * Find a category by id.
32 | *
33 | * @param mixed $id
34 | * @return \Tricks\Category
35 | */
36 | public function findById($id);
37 |
38 | /**
39 | * Create a new category in the database.
40 | *
41 | * @param array $data
42 | * @return \Tricks\Category
43 | */
44 | public function create(array $data);
45 |
46 | /**
47 | * Update the specified category in the database.
48 | *
49 | * @param mixed $id
50 | * @param array $data
51 | * @return \Tricks\Category
52 | */
53 | public function update($id, array $data);
54 |
55 | /**
56 | * The the highest order number from the database.
57 | *
58 | * @return int
59 | */
60 | public function getMaxOrder();
61 |
62 | /**
63 | * Delete the specified category from the database.
64 | *
65 | * @param mixed $id
66 | * @return void
67 | */
68 | public function delete($id);
69 |
70 | /**
71 | * Re-arrange the categories in the database.
72 | *
73 | * @param array $data
74 | * @return void
75 | */
76 | public function arrange(array $data);
77 | }
78 |
--------------------------------------------------------------------------------
/public/js/vendor/jquery.spin.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2013 Felix Gnass
3 | * Licensed under the MIT license
4 | */
5 |
6 | /*
7 |
8 | Basic Usage:
9 | ============
10 |
11 | $('#el').spin(); // Creates a default Spinner using the text color of #el.
12 | $('#el').spin({ ... }); // Creates a Spinner using the provided options.
13 |
14 | $('#el').spin(false); // Stops and removes the spinner.
15 |
16 | Using Presets:
17 | ==============
18 |
19 | $('#el').spin('small'); // Creates a 'small' Spinner using the text color of #el.
20 | $('#el').spin('large', '#fff'); // Creates a 'large' white Spinner.
21 |
22 | Adding a custom preset:
23 | =======================
24 |
25 | $.fn.spin.presets.flower = {
26 | lines: 9
27 | length: 10
28 | width: 20
29 | radius: 0
30 | }
31 |
32 | $('#el').spin('flower', 'red');
33 |
34 | */
35 |
36 | (function(factory) {
37 |
38 | if (typeof exports == 'object') {
39 | // CommonJS
40 | factory(require('jquery'), require('spin'))
41 | }
42 | else if (typeof define == 'function' && define.amd) {
43 | // AMD, register as anonymous module
44 | define(['jquery', 'spin'], factory)
45 | }
46 | else {
47 | // Browser globals
48 | if (!window.Spinner) throw new Error('Spin.js not present')
49 | factory(window.jQuery, window.Spinner)
50 | }
51 |
52 | }(function($, Spinner) {
53 |
54 | $.fn.spin = function(opts, color) {
55 |
56 | return this.each(function() {
57 | var $this = $(this),
58 | data = $this.data();
59 |
60 | if (data.spinner) {
61 | data.spinner.stop();
62 | delete data.spinner;
63 | }
64 | if (opts !== false) {
65 | opts = $.extend(
66 | { color: color || $this.css('color') },
67 | $.fn.spin.presets[opts] || opts
68 | )
69 | data.spinner = new Spinner(opts).spin(this)
70 | }
71 | })
72 | }
73 |
74 | $.fn.spin.presets = {
75 | tiny: { lines: 8, length: 2, width: 2, radius: 3 },
76 | small: { lines: 8, length: 4, width: 3, radius: 5 },
77 | large: { lines: 10, length: 8, width: 4, radius: 8 }
78 | }
79 |
80 | }));
81 |
--------------------------------------------------------------------------------
/public/js/vendor/placeholder.min.js:
--------------------------------------------------------------------------------
1 | /*! http://mths.be/placeholder v2.0.7 by @mathias */
2 | ;(function(f,h,$){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=$.fn,c=$.valHooks,k,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){var l=this;l.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':b,'blur.placeholder':e}).data('placeholder-enabled',true).trigger('blur.placeholder');return l};j.input=a;j.textarea=d;k={get:function(m){var l=$(m);return l.data('placeholder-enabled')&&l.hasClass('placeholder')?'':m.value},set:function(m,n){var l=$(m);if(!l.data('placeholder-enabled')){return m.value=n}if(n==''){m.value=n;if(m!=h.activeElement){e.call(m)}}else{if(l.hasClass('placeholder')){b.call(m,true,n)||(m.value=n)}else{m.value=n}}return l}};a||(c.input=k);d||(c.textarea=k);$(function(){$(h).delegate('form','submit.placeholder',function(){var l=$('.placeholder',this).each(b);setTimeout(function(){l.each(e)},10)})});$(f).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value=''})})}function g(m){var l={},n=/^jQuery\d+$/;$.each(m.attributes,function(p,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(m,n){var l=this,o=$(l);if(l.value==o.attr('placeholder')&&o.hasClass('placeholder')){if(o.data('placeholder-password')){o=o.hide().next().show().attr('id',o.removeAttr('id').data('placeholder-id'));if(m===true){return o[0].value=n}o.focus()}else{l.value='';o.removeClass('placeholder');l==h.activeElement&&l.select()}}}function e(){var q,l=this,p=$(l),m=p,o=this.id;if(l.value==''){if(l.type=='password'){if(!p.data('placeholder-textinput')){try{q=p.clone().attr({type:'text'})}catch(n){q=$(' ').attr($.extend(g(this),{type:'text'}))}q.removeAttr('name').data({'placeholder-password':true,'placeholder-id':o}).bind('focus.placeholder',b);p.data({'placeholder-textinput':q,'placeholder-id':o}).before(q)}p=p.removeAttr('id').hide().prev().attr('id',o).show()}p.addClass('placeholder');p[0].value=p.attr('placeholder')}else{p.removeClass('placeholder')}}}(this,document,jQuery));
--------------------------------------------------------------------------------
/app/config/remote.php:
--------------------------------------------------------------------------------
1 | 'production',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Remote Server Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | These are the servers that will be accessible via the SSH task runner
24 | | facilities of Laravel. This feature radically simplifies executing
25 | | tasks on your servers, such as deploying out these applications.
26 | |
27 | */
28 |
29 | 'connections' => array(
30 |
31 | 'production' => array(
32 | 'host' => '',
33 | 'username' => '',
34 | 'password' => '',
35 | 'key' => '',
36 | 'root' => '/var/www',
37 | ),
38 |
39 | ),
40 |
41 | /*
42 | |--------------------------------------------------------------------------
43 | | Remote Server Groups
44 | |--------------------------------------------------------------------------
45 | |
46 | | Here you may list connections under a single group name, which allows
47 | | you to easily access all of the servers at once using a short name
48 | | that is extremely easy to remember, such as "web" or "database".
49 | |
50 | */
51 |
52 | 'groups' => array(
53 |
54 | 'web' => array('production')
55 |
56 | ),
57 |
58 | );
59 |
--------------------------------------------------------------------------------
/public/css/highlight/pojoaque.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Pojoaque Style by Jason Tate
4 | http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html
5 | Based on Solarized Style from http://ethanschoonover.com/solarized
6 |
7 | */
8 |
9 | pre code {
10 | display: block; padding: 0.5em;
11 | color: #DCCF8F;
12 | background: url(./pojoaque.jpg) repeat scroll left top #181914;
13 | }
14 |
15 | pre .comment,
16 | pre .template_comment,
17 | pre .diff .header,
18 | pre .doctype,
19 | pre .lisp .string,
20 | pre .javadoc {
21 | color: #586e75;
22 | font-style: italic;
23 | }
24 |
25 | pre .keyword,
26 | pre .css .rule .keyword,
27 | pre .winutils,
28 | pre .javascript .title,
29 | pre .method,
30 | pre .addition,
31 | pre .css .tag,
32 | pre .clojure .title,
33 | pre .nginx .title {
34 | color: #B64926;
35 | }
36 |
37 | pre .number,
38 | pre .command,
39 | pre .string,
40 | pre .tag .value,
41 | pre .phpdoc,
42 | pre .tex .formula,
43 | pre .regexp,
44 | pre .hexcolor {
45 | color: #468966;
46 | }
47 |
48 | pre .title,
49 | pre .localvars,
50 | pre .function .title,
51 | pre .chunk,
52 | pre .decorator,
53 | pre .built_in,
54 | pre .lisp .title,
55 | pre .clojure .built_in,
56 | pre .identifier,
57 | pre .id {
58 | color: #FFB03B;
59 | }
60 |
61 | pre .attribute,
62 | pre .variable,
63 | pre .lisp .body,
64 | pre .smalltalk .number,
65 | pre .constant,
66 | pre .class .title,
67 | pre .parent,
68 | pre .haskell .type {
69 | color: #b58900;
70 | }
71 |
72 | pre .css .attribute {
73 | color: #b89859;
74 | }
75 |
76 | pre .css .number,pre .css .hexcolor{
77 | color: #DCCF8F;
78 | }
79 |
80 | pre .css .class {
81 | color: #d3a60c;
82 | }
83 |
84 | pre .preprocessor,
85 | pre .pi,
86 | pre .shebang,
87 | pre .symbol,
88 | pre .symbol .string,
89 | pre .diff .change,
90 | pre .special,
91 | pre .attr_selector,
92 | pre .important,
93 | pre .subst,
94 | pre .cdata {
95 | color: #cb4b16;
96 | }
97 |
98 | pre .deletion {
99 | color: #dc322f;
100 | }
101 |
102 | pre .tex .formula {
103 | background: #073642;
104 | }
105 |
--------------------------------------------------------------------------------
/public/css/highlight/monokai_sublime.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
4 |
5 | */
6 |
7 | pre code {
8 | display: block;
9 | padding: 0.5em;
10 | background: #23241f;
11 | }
12 | pre .tag,
13 | pre code {
14 | color: #f8f8f2;
15 | }
16 | pre .keyword,
17 | pre .function,
18 | pre .literal,
19 | pre .change,
20 | pre .winutils,
21 | pre .flow,
22 | pre .lisp .title,
23 | pre .clojure .built_in,
24 | pre .nginx .title,
25 | pre .tex .special {
26 | color: #66d9ef;
27 | }
28 | pre .variable,
29 | pre .params {
30 | color: #fd9720;
31 | }
32 | pre .constant {
33 | color: #66d9ef;
34 | }
35 | pre .title,
36 | pre .class .title,
37 | pre .css .class {
38 | color: #a6e22e;
39 | }
40 | pre .attribute,
41 | pre .symbol,
42 | pre .symbol .string,
43 | pre .tag .title,
44 | pre .value,
45 | pre .css .tag {
46 | color: #f92672;
47 | }
48 | pre .number,
49 | pre .preprocessor,
50 | pre .regexp {
51 | color: #ae81ff;
52 | }
53 | pre .tag .value,
54 | pre .string,
55 | pre .css .id,
56 | pre .subst,
57 | pre .haskell .type,
58 | pre .ruby .class .parent,
59 | pre .built_in,
60 | pre .sql .aggregate,
61 | pre .django .template_tag,
62 | pre .django .variable,
63 | pre .smalltalk .class,
64 | pre .django .filter .argument,
65 | pre .smalltalk .localvars,
66 | pre .smalltalk .array,
67 | pre .attr_selector,
68 | pre .pseudo,
69 | pre .addition,
70 | pre .stream,
71 | pre .envvar,
72 | pre .apache .tag,
73 | pre .apache .cbracket,
74 | pre .tex .command,
75 | pre .prompt {
76 | color: #e6db74;
77 | }
78 | pre .comment,
79 | pre .javadoc,
80 | pre .java .annotation,
81 | pre .python .decorator,
82 | pre .template_comment,
83 | pre .pi,
84 | pre .doctype,
85 | pre .deletion,
86 | pre .shebang,
87 | pre .apache .sqbracket,
88 | pre .tex .formula {
89 | color: #75715e;
90 | }
91 | pre .coffeescript .javascript,
92 | pre .javascript .xml,
93 | pre .tex .formula {
94 | opacity: 0.5;
95 | }
96 | pre .xml .javascript,
97 | pre .xml .vbscript,
98 | pre .xml .css,
99 | pre .xml .cdata {
100 | opacity: 0.5;
101 | }
102 |
--------------------------------------------------------------------------------
/public/css/highlight/dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Dark style from softwaremaniacs.org (c) Ivan Sagalaev
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | background: #444;
10 | }
11 |
12 | pre .keyword,
13 | pre .literal,
14 | pre .change,
15 | pre .winutils,
16 | pre .flow,
17 | pre .lisp .title,
18 | pre .clojure .built_in,
19 | pre .nginx .title,
20 | pre .tex .special {
21 | color: white;
22 | }
23 |
24 | pre code,
25 | pre .subst {
26 | color: #DDD;
27 | }
28 |
29 | pre .string,
30 | pre .title,
31 | pre .haskell .type,
32 | pre .ini .title,
33 | pre .tag .value,
34 | pre .css .rules .value,
35 | pre .preprocessor,
36 | pre .ruby .symbol,
37 | pre .ruby .symbol .string,
38 | pre .ruby .class .parent,
39 | pre .built_in,
40 | pre .sql .aggregate,
41 | pre .django .template_tag,
42 | pre .django .variable,
43 | pre .smalltalk .class,
44 | pre .javadoc,
45 | pre .ruby .string,
46 | pre .django .filter .argument,
47 | pre .smalltalk .localvars,
48 | pre .smalltalk .array,
49 | pre .attr_selector,
50 | pre .pseudo,
51 | pre .addition,
52 | pre .stream,
53 | pre .envvar,
54 | pre .apache .tag,
55 | pre .apache .cbracket,
56 | pre .tex .command,
57 | pre .prompt,
58 | pre .coffeescript .attribute {
59 | color: #D88;
60 | }
61 |
62 | pre .comment,
63 | pre .java .annotation,
64 | pre .python .decorator,
65 | pre .template_comment,
66 | pre .pi,
67 | pre .doctype,
68 | pre .deletion,
69 | pre .shebang,
70 | pre .apache .sqbracket,
71 | pre .tex .formula {
72 | color: #777;
73 | }
74 |
75 | pre .keyword,
76 | pre .literal,
77 | pre .title,
78 | pre .css .id,
79 | pre .phpdoc,
80 | pre .haskell .type,
81 | pre .vbscript .built_in,
82 | pre .sql .aggregate,
83 | pre .rsl .built_in,
84 | pre .smalltalk .class,
85 | pre .diff .header,
86 | pre .chunk,
87 | pre .winutils,
88 | pre .bash .variable,
89 | pre .apache .tag,
90 | pre .tex .special,
91 | pre .request,
92 | pre .status {
93 | font-weight: bold;
94 | }
95 |
96 | pre .coffeescript .javascript,
97 | pre .javascript .xml,
98 | pre .tex .formula,
99 | pre .xml .javascript,
100 | pre .xml .vbscript,
101 | pre .xml .css,
102 | pre .xml .cdata {
103 | opacity: 0.5;
104 | }
105 |
--------------------------------------------------------------------------------
/app/Tricks/Events/ViewTrickHandler.php:
--------------------------------------------------------------------------------
1 | tricks = $tricks;
34 | $this->session = $session;
35 | }
36 |
37 | /**
38 | * Handle the view trick event.
39 | *
40 | * @param \Tricks\Trick $trick
41 | * @return void
42 | */
43 | public function handle($trick)
44 | {
45 | if (! $this->hasViewedTrick($trick)) {
46 | $trick = $this->tricks->incrementViews($trick);
47 |
48 | $this->storeViewedTrick($trick);
49 | }
50 | }
51 |
52 | /**
53 | * Determine whether the user has viewed the trick.
54 | *
55 | * @param \Tricks\Trick $trick
56 | * @return bool
57 | */
58 | protected function hasViewedTrick($trick)
59 | {
60 | return array_key_exists($trick->id, $this->getViewedTricks());
61 | }
62 |
63 | /**
64 | * Get the users viewed trick from the session.
65 | *
66 | * @return array
67 | */
68 | protected function getViewedTricks()
69 | {
70 | return $this->session->get('viewed_tricks', []);
71 | }
72 |
73 | /**
74 | * Append the newly viewed trick to the session.
75 | *
76 | * @param \Tricks\Trick $trick
77 | * @return void
78 | */
79 | protected function storeViewedTrick($trick)
80 | {
81 | $key = 'viewed_tricks.' . $trick->id;
82 |
83 | $this->session->put($key, time());
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/public/css/highlight/rainbow.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Style with support for rainbow parens
4 |
5 | */
6 |
7 | pre ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
8 | pre ::selection { background:#FF5E99; color:#fff; text-shadow: none; }
9 |
10 | pre code {
11 | display: block; padding: 0.5em;
12 | background: #474949; color: #D1D9E1;
13 | }
14 |
15 |
16 | pre .body,
17 | pre .collection {
18 | color: #D1D9E1;
19 | }
20 |
21 | pre .comment,
22 | pre .template_comment,
23 | pre .diff .header,
24 | pre .doctype,
25 | pre .lisp .string,
26 | pre .javadoc {
27 | color: #969896;
28 | font-style: italic;
29 | }
30 |
31 | pre .keyword,
32 | pre .clojure .attribute,
33 | pre .winutils,
34 | pre .javascript .title,
35 | pre .addition,
36 | pre .css .tag {
37 | color: #cc99cc;
38 | }
39 |
40 | pre .number { color: #f99157; }
41 |
42 | pre .command,
43 | pre .string,
44 | pre .tag .value,
45 | pre .phpdoc,
46 | pre .tex .formula,
47 | pre .regexp,
48 | pre .hexcolor {
49 | color: #8abeb7;
50 | }
51 |
52 | pre .title,
53 | pre .localvars,
54 | pre .function .title,
55 | pre .chunk,
56 | pre .decorator,
57 | pre .built_in,
58 | pre .lisp .title,
59 | pre .identifier
60 | {
61 | color: #b5bd68;
62 | }
63 |
64 | pre .class .keyword
65 | {
66 | color: #f2777a;
67 | }
68 |
69 | pre .variable,
70 | pre .lisp .body,
71 | pre .smalltalk .number,
72 | pre .constant,
73 | pre .class .title,
74 | pre .parent,
75 | pre .haskell .label,
76 | pre .id,
77 | pre .lisp .title,
78 | pre .clojure .title .built_in {
79 | color: #ffcc66;
80 | }
81 |
82 | pre .tag .title,
83 | pre .rules .property,
84 | pre .django .tag .keyword,
85 | pre .clojure .title .built_in {
86 | font-weight: bold;
87 | }
88 |
89 | pre .attribute,
90 | pre .clojure .title {
91 | color: #81a2be;
92 | }
93 |
94 | pre .preprocessor,
95 | pre .pi,
96 | pre .shebang,
97 | pre .symbol,
98 | pre .symbol .string,
99 | pre .diff .change,
100 | pre .special,
101 | pre .attr_selector,
102 | pre .important,
103 | pre .subst,
104 | pre .cdata {
105 | color: #f99157;
106 | }
107 |
108 | pre .deletion {
109 | color: #dc322f;
110 | }
111 |
112 | pre .tex .formula {
113 | background: #eee8d5;
114 | }
115 |
--------------------------------------------------------------------------------
/public/css/highlight/brown_paper.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Brown Paper style from goldblog.com.ua (c) Zaripov Yura
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | background:#b7a68e url(./brown_papersq.png);
10 | }
11 |
12 | pre .keyword,
13 | pre .literal,
14 | pre .change,
15 | pre .winutils,
16 | pre .flow,
17 | pre .lisp .title,
18 | pre .clojure .built_in,
19 | pre .nginx .title,
20 | pre .tex .special,
21 | pre .request,
22 | pre .status {
23 | color:#005599;
24 | font-weight:bold;
25 | }
26 |
27 | pre code,
28 | pre .subst,
29 | pre .tag .keyword {
30 | color: #363C69;
31 | }
32 |
33 | pre .string,
34 | pre .title,
35 | pre .haskell .type,
36 | pre .tag .value,
37 | pre .css .rules .value,
38 | pre .preprocessor,
39 | pre .ruby .symbol,
40 | pre .ruby .symbol .string,
41 | pre .ruby .class .parent,
42 | pre .built_in,
43 | pre .sql .aggregate,
44 | pre .django .template_tag,
45 | pre .django .variable,
46 | pre .smalltalk .class,
47 | pre .javadoc,
48 | pre .ruby .string,
49 | pre .django .filter .argument,
50 | pre .smalltalk .localvars,
51 | pre .smalltalk .array,
52 | pre .attr_selector,
53 | pre .pseudo,
54 | pre .addition,
55 | pre .stream,
56 | pre .envvar,
57 | pre .apache .tag,
58 | pre .apache .cbracket,
59 | pre .tex .number {
60 | color: #2C009F;
61 | }
62 |
63 | pre .comment,
64 | pre .java .annotation,
65 | pre .python .decorator,
66 | pre .template_comment,
67 | pre .pi,
68 | pre .doctype,
69 | pre .deletion,
70 | pre .shebang,
71 | pre .apache .sqbracket,
72 | pre .nginx .built_in,
73 | pre .tex .formula {
74 | color: #802022;
75 | }
76 |
77 | pre .keyword,
78 | pre .literal,
79 | pre .css .id,
80 | pre .phpdoc,
81 | pre .title,
82 | pre .haskell .type,
83 | pre .vbscript .built_in,
84 | pre .sql .aggregate,
85 | pre .rsl .built_in,
86 | pre .smalltalk .class,
87 | pre .diff .header,
88 | pre .chunk,
89 | pre .winutils,
90 | pre .bash .variable,
91 | pre .apache .tag,
92 | pre .tex .command {
93 | font-weight: bold;
94 | }
95 |
96 | pre .coffeescript .javascript,
97 | pre .javascript .xml,
98 | pre .tex .formula,
99 | pre .xml .javascript,
100 | pre .xml .vbscript,
101 | pre .xml .css,
102 | pre .xml .cdata {
103 | opacity: 0.8;
104 | }
105 |
--------------------------------------------------------------------------------
/public/css/highlight/idea.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Intellij Idea-like styling (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | color: #000;
10 | background: #fff;
11 | }
12 |
13 | pre .subst,
14 | pre .title {
15 | font-weight: normal;
16 | color: #000;
17 | }
18 |
19 | pre .comment,
20 | pre .template_comment,
21 | pre .javadoc,
22 | pre .diff .header {
23 | color: #808080;
24 | font-style: italic;
25 | }
26 |
27 | pre .annotation,
28 | pre .decorator,
29 | pre .preprocessor,
30 | pre .doctype,
31 | pre .pi,
32 | pre .chunk,
33 | pre .shebang,
34 | pre .apache .cbracket,
35 | pre .prompt,
36 | pre .http .title {
37 | color: #808000;
38 | }
39 |
40 | pre .tag,
41 | pre .pi {
42 | background: #efefef;
43 | }
44 |
45 | pre .tag .title,
46 | pre .id,
47 | pre .attr_selector,
48 | pre .pseudo,
49 | pre .literal,
50 | pre .keyword,
51 | pre .hexcolor,
52 | pre .css .function,
53 | pre .ini .title,
54 | pre .css .class,
55 | pre .list .title,
56 | pre .clojure .title,
57 | pre .nginx .title,
58 | pre .tex .command,
59 | pre .request,
60 | pre .status {
61 | font-weight: bold;
62 | color: #000080;
63 | }
64 |
65 | pre .attribute,
66 | pre .rules .keyword,
67 | pre .number,
68 | pre .date,
69 | pre .regexp,
70 | pre .tex .special {
71 | font-weight: bold;
72 | color: #0000ff;
73 | }
74 |
75 | pre .number,
76 | pre .regexp {
77 | font-weight: normal;
78 | }
79 |
80 | pre .string,
81 | pre .value,
82 | pre .filter .argument,
83 | pre .css .function .params,
84 | pre .apache .tag {
85 | color: #008000;
86 | font-weight: bold;
87 | }
88 |
89 | pre .symbol,
90 | pre .ruby .symbol .string,
91 | pre .char,
92 | pre .tex .formula {
93 | color: #000;
94 | background: #d0eded;
95 | font-style: italic;
96 | }
97 |
98 | pre .phpdoc,
99 | pre .yardoctag,
100 | pre .javadoctag {
101 | text-decoration: underline;
102 | }
103 |
104 | pre .variable,
105 | pre .envvar,
106 | pre .apache .sqbracket,
107 | pre .nginx .built_in {
108 | color: #660e7a;
109 | }
110 |
111 | pre .addition {
112 | background: #baeeba;
113 | }
114 |
115 | pre .deletion {
116 | background: #ffc8bd;
117 | }
118 |
119 | pre .diff .change {
120 | background: #bccff9;
121 | }
122 |
--------------------------------------------------------------------------------
/app/Controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | beforeFilter('csrf', [ 'on' => 'post' ]);
26 | }
27 |
28 | /**
29 | * Setup the layout used by the controller.
30 | *
31 | * @return void
32 | */
33 | protected function setupLayout()
34 | {
35 | if (! is_null($this->layout)) {
36 | $this->layout = View::make($this->layout);
37 | }
38 | }
39 |
40 | /**
41 | * Set the specified view as content on the layout.
42 | *
43 | * @param string $path
44 | * @param array $data
45 | * @return void
46 | */
47 | protected function view($path, $data = [])
48 | {
49 | $this->layout->content = View::make($path, $data);
50 | }
51 |
52 | /**
53 | * Redirect to the specified named route.
54 | *
55 | * @param string $route
56 | * @param array $params
57 | * @param array $data
58 | * @return \Illuminate\Http\RedirectResponse
59 | */
60 | protected function redirectRoute($route, $params = [], $data = [])
61 | {
62 | return Redirect::route($route, $params)->with($data);
63 | }
64 |
65 | /**
66 | * Redirect back with old input and the specified data.
67 | *
68 | * @param array $data
69 | * @return \Illuminate\Http\RedirectResponse
70 | */
71 | protected function redirectBack($data = [])
72 | {
73 | return Redirect::back()->withInput()->with($data);
74 | }
75 |
76 | /**
77 | * Redirect a logged in user to the previously intended url.
78 | *
79 | * @param mixed $default
80 | * @return \Illuminate\Http\RedirectResponse
81 | */
82 | protected function redirectIntended($default = null)
83 | {
84 | return Redirect::intended($default);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/public/css/highlight/github.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | github.com style (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | color: #333;
10 | background: #f8f8ff
11 | }
12 |
13 | pre .comment,
14 | pre .template_comment,
15 | pre .diff .header,
16 | pre .javadoc {
17 | color: #998;
18 | font-style: italic
19 | }
20 |
21 | pre .keyword,
22 | pre .css .rule .keyword,
23 | pre .winutils,
24 | pre .javascript .title,
25 | pre .nginx .title,
26 | pre .subst,
27 | pre .request,
28 | pre .status {
29 | color: #333;
30 | font-weight: bold
31 | }
32 |
33 | pre .number,
34 | pre .hexcolor,
35 | pre .ruby .constant {
36 | color: #099;
37 | }
38 |
39 | pre .string,
40 | pre .tag .value,
41 | pre .phpdoc,
42 | pre .tex .formula {
43 | color: #d14
44 | }
45 |
46 | pre .title,
47 | pre .id,
48 | pre .coffeescript .params,
49 | pre .scss .preprocessor {
50 | color: #900;
51 | font-weight: bold
52 | }
53 |
54 | pre .javascript .title,
55 | pre .lisp .title,
56 | pre .clojure .title,
57 | pre .subst {
58 | font-weight: normal
59 | }
60 |
61 | pre .class .title,
62 | pre .haskell .type,
63 | pre .vhdl .literal,
64 | pre .tex .command {
65 | color: #458;
66 | font-weight: bold
67 | }
68 |
69 | pre .tag,
70 | pre .tag .title,
71 | pre .rules .property,
72 | pre .django .tag .keyword {
73 | color: #000080;
74 | font-weight: normal
75 | }
76 |
77 | pre .attribute,
78 | pre .variable,
79 | pre .lisp .body {
80 | color: #008080
81 | }
82 |
83 | pre .regexp {
84 | color: #009926
85 | }
86 |
87 | pre .class {
88 | color: #458;
89 | font-weight: bold
90 | }
91 |
92 | pre .symbol,
93 | pre .ruby .symbol .string,
94 | pre .lisp .keyword,
95 | pre .tex .special,
96 | pre .prompt {
97 | color: #990073
98 | }
99 |
100 | pre .built_in,
101 | pre .lisp .title,
102 | pre .clojure .built_in {
103 | color: #0086b3
104 | }
105 |
106 | pre .preprocessor,
107 | pre .pi,
108 | pre .doctype,
109 | pre .shebang,
110 | pre .cdata {
111 | color: #999;
112 | font-weight: bold
113 | }
114 |
115 | pre .deletion {
116 | background: #fdd
117 | }
118 |
119 | pre .addition {
120 | background: #dfd
121 | }
122 |
123 | pre .diff .change {
124 | background: #0086b3
125 | }
126 |
127 | pre .chunk {
128 | color: #aaa
129 | }
130 |
--------------------------------------------------------------------------------
/app/views/password/reset.blade.php:
--------------------------------------------------------------------------------
1 | @section('title', trans('password.resetting_password'))
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
{{ trans('password.resetting_password') }}
9 |
10 | @if(Session::has('error'))
11 |
12 | ×
13 | {{ trans('password.invalid_password_or_mail') }}
14 |
15 | @endif
16 |
17 | {{ Form::open(['route' => 'auth.reset']) }}
18 | {{ Form::hidden('token', $token) }}
19 |
20 |
21 | {{ Form::label('email', trans('password.email'), [ 'class' => 'control-label' ]) }}
22 | {{ Form::text('email', null, ['class'=>'form-control', 'placeholder' => trans('password.email_reset_placeholder')])}}
23 |
24 |
25 |
26 | {{ Form::password('password', array('class'=>'form-control middle','placeholder'=>trans('password.new_password')))}}
27 |
28 |
29 | {{ Form::password('password_confirmation', array('class'=>'form-control bottom','placeholder'=>trans('password.confirm_password')))}}
30 |
31 |
32 | {{ trans('password.reset') }}
33 |
34 | {{ Form::close() }}
35 |
36 |
39 |
40 |
41 |
42 |
43 | @stop
44 |
--------------------------------------------------------------------------------
/app/Tricks/Repositories/Eloquent/ProfileRepository.php:
--------------------------------------------------------------------------------
1 | model = $profile;
21 | }
22 |
23 | /**
24 | * Find a profile by it's UID.
25 | *
26 | * @param string $uid
27 | * @return \Tricks\Profile
28 | */
29 | public function findByUid($uid)
30 | {
31 | return $this->model->whereUid($uid)->first();
32 | }
33 |
34 | /**
35 | * Create a new profile from Github data.
36 | *
37 | * @param \League\OAuth2\Client\Provider\User $userDetails
38 | * @param \Tricks\User $user
39 | * @param string $token
40 | * @return \Tricks\Profile
41 | */
42 | public function createFromGithubData(OAuthUser $details, User $user, $token)
43 | {
44 | $profile = $this->getNew();
45 |
46 | $profile->uid = $details->uid;
47 | $profile->username = $details->nickname;
48 | $profile->name = $details->name;
49 | $profile->email = $details->email;
50 | $profile->first_name = $details->first_name;
51 | $profile->last_name = $details->last_name;
52 | $profile->location = $details->location;
53 | $profile->description = $details->description;
54 | $profile->image_url = $details->imageUrl;
55 | $profile->access_token = $token;
56 | $profile->user_id = $user->id;
57 |
58 | $profile->save();
59 |
60 | return $profile;
61 | }
62 |
63 | /**
64 | * Update the access token on the profile.
65 | *
66 | * @param \Tricks\Profile $profile
67 | * @param string $token
68 | * @return \Tricks\Profile
69 | */
70 | public function updateToken(Profile $profile, $token)
71 | {
72 | $profile->access_token = $token;
73 | $profile->save();
74 |
75 | return $profile;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/public/css/highlight/far.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | FAR Style (c) MajestiC
4 |
5 | */
6 |
7 | pre code {
8 | display: block; padding: 0.5em;
9 | background: #000080;
10 | }
11 |
12 | pre code,
13 | pre .subst {
14 | color: #0FF;
15 | }
16 |
17 | pre .string,
18 | pre .ruby .string,
19 | pre .haskell .type,
20 | pre .tag .value,
21 | pre .css .rules .value,
22 | pre .css .rules .value .number,
23 | pre .preprocessor,
24 | pre .ruby .symbol,
25 | pre .ruby .symbol .string,
26 | pre .built_in,
27 | pre .sql .aggregate,
28 | pre .django .template_tag,
29 | pre .django .variable,
30 | pre .smalltalk .class,
31 | pre .addition,
32 | pre .apache .tag,
33 | pre .apache .cbracket,
34 | pre .tex .command,
35 | pre .clojure .title,
36 | pre .coffeescript .attribute {
37 | color: #FF0;
38 | }
39 |
40 | pre .keyword,
41 | pre .css .id,
42 | pre .title,
43 | pre .haskell .type,
44 | pre .vbscript .built_in,
45 | pre .sql .aggregate,
46 | pre .rsl .built_in,
47 | pre .smalltalk .class,
48 | pre .xml .tag .title,
49 | pre .winutils,
50 | pre .flow,
51 | pre .change,
52 | pre .envvar,
53 | pre .bash .variable,
54 | pre .tex .special,
55 | pre .clojure .built_in {
56 | color: #FFF;
57 | }
58 |
59 | pre .comment,
60 | pre .phpdoc,
61 | pre .javadoc,
62 | pre .java .annotation,
63 | pre .template_comment,
64 | pre .deletion,
65 | pre .apache .sqbracket,
66 | pre .tex .formula {
67 | color: #888;
68 | }
69 |
70 | pre .number,
71 | pre .date,
72 | pre .regexp,
73 | pre .literal,
74 | pre .smalltalk .symbol,
75 | pre .smalltalk .char,
76 | pre .clojure .attribute {
77 | color: #0F0;
78 | }
79 |
80 | pre .python .decorator,
81 | pre .django .filter .argument,
82 | pre .smalltalk .localvars,
83 | pre .smalltalk .array,
84 | pre .attr_selector,
85 | pre .pseudo,
86 | pre .xml .pi,
87 | pre .diff .header,
88 | pre .chunk,
89 | pre .shebang,
90 | pre .nginx .built_in,
91 | pre .prompt {
92 | color: #008080;
93 | }
94 |
95 | pre .keyword,
96 | pre .css .id,
97 | pre .title,
98 | pre .haskell .type,
99 | pre .vbscript .built_in,
100 | pre .sql .aggregate,
101 | pre .rsl .built_in,
102 | pre .smalltalk .class,
103 | pre .winutils,
104 | pre .flow,
105 | pre .apache .tag,
106 | pre .nginx .built_in,
107 | pre .tex .command,
108 | pre .tex .special,
109 | pre .request,
110 | pre .status {
111 | font-weight: bold;
112 | }
113 |
--------------------------------------------------------------------------------
/app/config/auth.php:
--------------------------------------------------------------------------------
1 | 'eloquent',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Authentication Model
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "Eloquent" authentication driver, we need to know which
26 | | Eloquent model should be used to retrieve your users. Of course, it
27 | | is often just the "User" model but you may use whatever you like.
28 | |
29 | */
30 |
31 | 'model' => 'Tricks\User',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Authentication Table
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "Database" authentication driver, we need to know which
39 | | table should be used to retrieve your users. We have chosen a basic
40 | | default value but you may easily change it to any table you like.
41 | |
42 | */
43 |
44 | 'table' => 'users',
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Password Reminder Settings
49 | |--------------------------------------------------------------------------
50 | |
51 | | Here you may set the settings for password reminders, including a view
52 | | that should be used as your password reminder e-mail. You will also
53 | | be able to set the name of the table that holds the reset tokens.
54 | |
55 | | The "expire" time is the number of minutes that the reminder should be
56 | | considered valid. This security feature keeps tokens short-lived so
57 | | they have less time to be guessed. You may change this as needed.
58 | |
59 | */
60 |
61 | 'reminder' => array(
62 |
63 | 'email' => 'emails.auth.reminder',
64 |
65 | 'table' => 'password_reminders',
66 |
67 | 'expire' => 60,
68 |
69 | ),
70 |
71 | );
72 |
--------------------------------------------------------------------------------
/public/css/highlight/zenburn.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov
4 | based on dark.css by Ivan Sagalaev
5 |
6 | */
7 |
8 | pre code {
9 | display: block; padding: 0.5em;
10 | background: #3F3F3F;
11 | color: #DCDCDC;
12 | }
13 |
14 | pre .keyword,
15 | pre .tag,
16 | pre .css .class,
17 | pre .css .id,
18 | pre .lisp .title,
19 | pre .nginx .title,
20 | pre .request,
21 | pre .status,
22 | pre .clojure .attribute {
23 | color: #E3CEAB;
24 | }
25 |
26 | pre .django .template_tag,
27 | pre .django .variable,
28 | pre .django .filter .argument {
29 | color: #DCDCDC;
30 | }
31 |
32 | pre .number,
33 | pre .date {
34 | color: #8CD0D3;
35 | }
36 |
37 | pre .dos .envvar,
38 | pre .dos .stream,
39 | pre .variable,
40 | pre .apache .sqbracket {
41 | color: #EFDCBC;
42 | }
43 |
44 | pre .dos .flow,
45 | pre .diff .change,
46 | pre .python .exception,
47 | pre .python .built_in,
48 | pre .literal,
49 | pre .tex .special {
50 | color: #EFEFAF;
51 | }
52 |
53 | pre .diff .chunk,
54 | pre .subst {
55 | color: #8F8F8F;
56 | }
57 |
58 | pre .dos .keyword,
59 | pre .python .decorator,
60 | pre .title,
61 | pre .haskell .type,
62 | pre .diff .header,
63 | pre .ruby .class .parent,
64 | pre .apache .tag,
65 | pre .nginx .built_in,
66 | pre .tex .command,
67 | pre .prompt {
68 | color: #efef8f;
69 | }
70 |
71 | pre .dos .winutils,
72 | pre .ruby .symbol,
73 | pre .ruby .symbol .string,
74 | pre .ruby .string {
75 | color: #DCA3A3;
76 | }
77 |
78 | pre .diff .deletion,
79 | pre .string,
80 | pre .tag .value,
81 | pre .preprocessor,
82 | pre .built_in,
83 | pre .sql .aggregate,
84 | pre .javadoc,
85 | pre .smalltalk .class,
86 | pre .smalltalk .localvars,
87 | pre .smalltalk .array,
88 | pre .css .rules .value,
89 | pre .attr_selector,
90 | pre .pseudo,
91 | pre .apache .cbracket,
92 | pre .tex .formula,
93 | pre .coffeescript .attribute {
94 | color: #CC9393;
95 | }
96 |
97 | pre .shebang,
98 | pre .diff .addition,
99 | pre .comment,
100 | pre .java .annotation,
101 | pre .template_comment,
102 | pre .pi,
103 | pre .doctype {
104 | color: #7F9F7F;
105 | }
106 |
107 | pre .coffeescript .javascript,
108 | pre .javascript .xml,
109 | pre .tex .formula,
110 | pre .xml .javascript,
111 | pre .xml .vbscript,
112 | pre .xml .css,
113 | pre .xml .cdata {
114 | opacity: 0.5;
115 | }
116 |
117 |
--------------------------------------------------------------------------------
/public/css/highlight/docco.css:
--------------------------------------------------------------------------------
1 | /*
2 | Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars)
3 | */
4 |
5 | pre code {
6 | display: block; padding: 0.5em;
7 | color: #000;
8 | background: #f8f8ff
9 | }
10 |
11 | pre .comment,
12 | pre .template_comment,
13 | pre .diff .header,
14 | pre .javadoc {
15 | color: #408080;
16 | font-style: italic
17 | }
18 |
19 | pre .keyword,
20 | pre .assignment,
21 | pre .literal,
22 | pre .css .rule .keyword,
23 | pre .winutils,
24 | pre .javascript .title,
25 | pre .lisp .title,
26 | pre .subst {
27 | color: #954121;
28 | }
29 |
30 | pre .number,
31 | pre .hexcolor {
32 | color: #40a070
33 | }
34 |
35 | pre .string,
36 | pre .tag .value,
37 | pre .phpdoc,
38 | pre .tex .formula {
39 | color: #219161;
40 | }
41 |
42 | pre .title,
43 | pre .id {
44 | color: #19469D;
45 | }
46 | pre .params {
47 | color: #00F;
48 | }
49 |
50 | pre .javascript .title,
51 | pre .lisp .title,
52 | pre .subst {
53 | font-weight: normal
54 | }
55 |
56 | pre .class .title,
57 | pre .haskell .label,
58 | pre .tex .command {
59 | color: #458;
60 | font-weight: bold
61 | }
62 |
63 | pre .tag,
64 | pre .tag .title,
65 | pre .rules .property,
66 | pre .django .tag .keyword {
67 | color: #000080;
68 | font-weight: normal
69 | }
70 |
71 | pre .attribute,
72 | pre .variable,
73 | pre .instancevar,
74 | pre .lisp .body {
75 | color: #008080
76 | }
77 |
78 | pre .regexp {
79 | color: #B68
80 | }
81 |
82 | pre .class {
83 | color: #458;
84 | font-weight: bold
85 | }
86 |
87 | pre .symbol,
88 | pre .ruby .symbol .string,
89 | pre .ruby .symbol .keyword,
90 | pre .ruby .symbol .keymethods,
91 | pre .lisp .keyword,
92 | pre .tex .special,
93 | pre .input_number {
94 | color: #990073
95 | }
96 |
97 | pre .builtin,
98 | pre .constructor,
99 | pre .built_in,
100 | pre .lisp .title {
101 | color: #0086b3
102 | }
103 |
104 | pre .preprocessor,
105 | pre .pi,
106 | pre .doctype,
107 | pre .shebang,
108 | pre .cdata {
109 | color: #999;
110 | font-weight: bold
111 | }
112 |
113 | pre .deletion {
114 | background: #fdd
115 | }
116 |
117 | pre .addition {
118 | background: #dfd
119 | }
120 |
121 | pre .diff .change {
122 | background: #0086b3
123 | }
124 |
125 | pre .chunk {
126 | color: #aaa
127 | }
128 |
129 | pre .tex .formula {
130 | opacity: 0.5;
131 | }
132 |
--------------------------------------------------------------------------------
/app/start/global.php:
--------------------------------------------------------------------------------
1 | getMessage();
35 |
36 | return Response::view('home.error', compact('error'), 404);
37 | });
38 |
39 | /*
40 | |--------------------------------------------------------------------------
41 | | Maintenance Mode Handler
42 | |--------------------------------------------------------------------------
43 | |
44 | | The "down" Artisan command gives you the ability to put an application
45 | | into maintenance mode. Here, you will define what is displayed back
46 | | to the user if maintenace mode is in effect for this application.
47 | |
48 | */
49 |
50 | App::down(function() {
51 | return Response::make("Be right back!", 503);
52 | });
53 |
54 | /*
55 | |--------------------------------------------------------------------------
56 | | Require The Filters File
57 | |--------------------------------------------------------------------------
58 | |
59 | | Next we will load the filters file for the application. This gives us
60 | | a nice separate location to store our route and application filter
61 | | definitions instead of putting them all in the main routes file.
62 | |
63 | */
64 |
65 | require app_path().'/filters.php';
66 |
--------------------------------------------------------------------------------
/app/Tricks/Services/Forms/AbstractForm.php:
--------------------------------------------------------------------------------
1 | inputData = App::make('request')->all();
46 | }
47 |
48 | /**
49 | * Get the prepared input data.
50 | *
51 | * @return array
52 | */
53 | public function getInputData()
54 | {
55 | return $this->inputData;
56 | }
57 |
58 | /**
59 | * Returns whether the input data is valid.
60 | *
61 | * @return bool
62 | */
63 | public function isValid()
64 | {
65 | $this->validator = Validator::make(
66 | $this->getInputData(),
67 | $this->getPreparedRules(),
68 | $this->getMessages()
69 | );
70 |
71 | return $this->validator->passes();
72 | }
73 |
74 | /**
75 | * Get the validation errors off of the Validator instance.
76 | *
77 | * @return \Illuminate\Support\MessageBag
78 | */
79 | public function getErrors()
80 | {
81 | return $this->validator->errors();
82 | }
83 |
84 | /**
85 | * Get the prepared validation rules.
86 | *
87 | * @return array
88 | */
89 | protected function getPreparedRules()
90 | {
91 | return $this->rules;
92 | }
93 |
94 | /**
95 | * Get the custom validation messages.
96 | *
97 | * @return array
98 | */
99 | protected function getMessages()
100 | {
101 | return $this->messages;
102 | }
103 | }
104 |
--------------------------------------------------------------------------------