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 511
  • OS X 349
  • Linux 260
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 1 2 0 2 0 0 2 1 0 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1
Linux 1 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 0 0 0 0 1 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.