ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Evercode​Lab Sublime Snippets

by EvercodeLab ST2/ST3

Collection of SublimeText 2/3 snippets for Symfony 2, Ruby on Rails and JavaScript

Labels snippets

Details

  • 2014.11.25.09.21.39
  • github.​com
  • github.​com
  • 3 years ago
  • 2 hours ago
  • 4 years ago

Installs

  • Total 1K
  • Win 530
  • OS X 355
  • Linux 262
Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31
Windows 0 0 0 1 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 2 0 0 0 0 1 0 1 0 0 0 0 2 1 0 1 0 0 1 1 0 0 0 0 0
OS X 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Eversnippets Collection

Just some peace of code that helps us in work.

Setup

  1. Install Package Controll
  2. In Sublime Text 2/3 press ⌘+shift+p (or ctrl+shift+p) and enter Install Package
  3. In this palet enter EvercodeLab Sublime Snippets and press enter
  4. Profit!

Manual install

For osX:

ST2

git clone git@github.com:EvercodeLab/evercodelab-sublime-snippets.git \
    ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/EvercodeSnippetPack

ST3

git clone git@github.com:EvercodeLab/evercodelab-sublime-snippets.git \
    ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/EvercodeSnippetPack

For Linux:

git clone git@github.com:EvercodeLab/evercodelab-sublime-snippets.git \ 
    ~/.config/sublime-text-2/Packages/EvercodeSnippetPack

HTML (Rails)

  • <%: <% %>
  • erb: <%= %> seems wierd at first, but is easy to type with just left hand
  • if: if-end
  • ife: if-else-end
  • case: case-when-when-end
  • when: when
  • each: object-each-do-end
  • tap: object-tap-do-end
  • try: object-try-do-end
  • formfor: form-for
  • fi: form input
  • imgtag: image-tag
  • linkto: link-to
  • optforsel: options for select
  • optfrom: options from collection for select
  • render: render partial
  • selecttag: select tag
  • simplefields: simple fields for form
  • simpleform: simple form with fields

RSpec

  • itsrt: it-should-respond-to
  • itsbt: it-should-belong-to
  • itshm: it-should-have-many
  • itshabtm: it-should-have-and-belong-to-many
  • its: its-property-should

Ruby on Rails

  • match: match-path-action
  • get: get-path
  • post: post-path
  • res: resources
  • ro: resources-only
  • re: resources-except

JavaScript

  • docready: jQuery document ready function
  • console: console.log() function — help debug JavaScript
  • anonymous-function: anonymous function
  • on: jQuery onfunction, 'click' by default

Symfony 2 snippets

Controller

  • sf-crud-controller: generate whole CRUD controller
  • sf-controller-with-annotation: controller with annotations
  • sf-action-with-annotation: action annotated with @Route and @Template
  • sf-em: getting Entity Manager in Controller
  • sf-get-repository: getting repository with Entity manager
  • sf-get-user-from-security-context: get User information from security.context
  • sf-redirect: redirect
  • sf-flash: flash message
  • sf-403: throwing 403 exception
  • sf-404: throwing 404 exception

Doctrine

  • sf-entity-class: generates entity class
  • sf-orm-column: generates ORM column defenition
  • sf-orm-column-with-set-and-get: generates ORM column defenition with setter and getter
  • sf-repository-class: generates entity repository class
  • sf-query-builder: generate query builder
  • sf-setter-and-getter: setter and getter methods
  • sf-setter: settere
  • sf-getter: getter

Form

  • sf-form-type: creates form type class
  • sf-cnoice-list-class: creates choice list class

Twig

For basic Twig functions use PHP Twig. It provide next snippets:

  • }}: {{ }}
  • %%: {% %}
  • block: {% block name %}{% endblock %}
  • blockb: block with blank line
  • extends: {% extends 'template' %}
  • filter: {% filter name %}{% endfilter %}
  • filterb: filter with blank line
  • for: {% for item in seq %}
  • fore: for with else
  • if: {% if condition %}{% endif %}
  • ifb: same as if but with blank line
  • ife: same as if but with else statement
  • else: {% else %}
  • set: {% set var = value %}
  • setb: same as set but in other syntax

And here some more Twig snippets:

  • twig-path: path function
  • twig-include: include other template
  • twig-render: render other template
  • twig-spaceless: render peace of templte without spaces

SonataAdmin

  • sf-sonata-admin-class: creates SonataAdmin class

Config

  • sf-service: yml service defenition
  • sf-service-admin: yml admin service defenition

PHP

  • class: just PHP class
  • php: PHP open tag
  • pubfun: public function
  • privfun: private function
  • protfun: protected function

Other

  • snippet: just for generation of other snippets

More to come. Stay tuned.