Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized for autocomplete+ snippets #4

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ad3e9c6
model.cson added
imanghafoori1 Feb 21, 2015
2e3eb66
view.cson added
imanghafoori1 Feb 21, 2015
764adf6
route.cson added
imanghafoori1 Feb 21, 2015
6e0fa20
logger.cson added
imanghafoori1 Feb 21, 2015
61d7254
es6.cson added
imanghafoori1 Feb 21, 2015
a799831
controller.cson added
imanghafoori1 Feb 21, 2015
9e6d7a1
Update and rename snippets to snippets/computed.cson
imanghafoori1 Feb 21, 2015
926d56a
adapters.cson added
imanghafoori1 Feb 21, 2015
ebc8899
store.cson added
imanghafoori1 Feb 21, 2015
1527d3b
custom import added
imanghafoori1 Feb 22, 2015
77a39a9
.assert added
imanghafoori1 Feb 22, 2015
41139ce
verbose modes added
imanghafoori1 Feb 22, 2015
3b78d58
nested resources
imanghafoori1 Feb 22, 2015
cd29fbe
added features and a bug fix
imanghafoori1 Feb 22, 2015
23294ec
changing convention from . to _
imanghafoori1 Feb 22, 2015
b27d3f6
convention changed to _
imanghafoori1 Feb 22, 2015
07f09b9
custom import added
imanghafoori1 Feb 22, 2015
d791524
Update controller.cson
imanghafoori1 Feb 22, 2015
53ee063
match and alias added
imanghafoori1 Feb 22, 2015
13d52c7
Update adapters.cson
imanghafoori1 Feb 22, 2015
399b942
Update logger.cson
imanghafoori1 Feb 22, 2015
8ade0ab
Update model.cson
imanghafoori1 Feb 22, 2015
ac5b268
Update view.cson
imanghafoori1 Feb 22, 2015
08691ed
Update router.cson
imanghafoori1 Feb 22, 2015
61bbeea
Update router.cson
imanghafoori1 Feb 22, 2015
e9d1bb1
em_ prefix changed to ds_
imanghafoori1 Feb 22, 2015
8ceccea
Update store.cson
imanghafoori1 Feb 22, 2015
4a11a66
changed to _ mode
imanghafoori1 Feb 23, 2015
f2a7de1
em_ removed
imanghafoori1 Feb 23, 2015
454143f
em_ removed
imanghafoori1 Feb 23, 2015
1c3f093
em_ removed
imanghafoori1 Feb 23, 2015
2ac0628
em_ removed
imanghafoori1 Feb 23, 2015
5499a60
em_ removed
imanghafoori1 Feb 23, 2015
ddc5ef3
em_ removed
imanghafoori1 Feb 23, 2015
2aa2768
em_ removed
imanghafoori1 Feb 23, 2015
83476bb
em_ removed
imanghafoori1 Feb 23, 2015
5111f76
remove es6_
imanghafoori1 Feb 23, 2015
1606657
em_ removed
imanghafoori1 Feb 23, 2015
aa655dc
Update controller.cson
imanghafoori1 Feb 23, 2015
c31672b
model_ removed
imanghafoori1 Feb 23, 2015
2afced0
bug fix
imanghafoori1 Feb 23, 2015
4bc6828
Update model.cson
imanghafoori1 Feb 23, 2015
89f184d
prefixes added,
imanghafoori1 Feb 23, 2015
59b47a2
bug fix
imanghafoori1 Feb 23, 2015
3ae81bf
organized
imanghafoori1 Feb 23, 2015
d0ed384
Update router.cson
imanghafoori1 Feb 23, 2015
52672dd
@ removed
imanghafoori1 Feb 23, 2015
bc09835
Update route.cson
imanghafoori1 Feb 23, 2015
57a6456
Update model.cson
imanghafoori1 Feb 23, 2015
2ad1d30
Ember.run added
imanghafoori1 Feb 24, 2015
f1858ac
hints provided in titles.
imanghafoori1 Feb 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions snippets/adapters.cson
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
'.source.coffee':

'Ember FixtureAdapter':
'prefix': 'adapter_fixture'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixture_adapter

'body':
"""
_export = DS.FixtureAdapter.extend()
"""


'Ember RESTAdapter':
'prefix': 'adapter_rest'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest_adapter

'body':
"""
_export = DS.RESTAdapter.extend(
${1:#body}
)


_export.reopenClass FIXTURES: [
{
id: 1
${1}: "${2}"
}
{
id: 2
${3}: "${4}"
}
]
"""


'Ember ActiveModelAdapter':
'prefix': 'adapter_activeModel'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

activemodel_adapter

'body':
"""
_export = DS.ActiveModelAdapter.extend(
${1:#body}
)
"""





'FixtureAdapter':
'prefix': 'fixture_adapter'
'body':
"""
_export = DS.FixtureAdapter.extend()
"""


'RESTAdapter':
'prefix': 'rest_adapter'
'body':
"""
_export = DS.RESTAdapter.extend(
${1:#body}
)


_export.reopenClass FIXTURES: [
{
id: 1
${1}: "${2}"
}
{
id: 2
${3}: "${4}"
}
]
"""


'ActiveModelAdapter':
'prefix': 'activemodel_adapter'
'body':
"""
_export = DS.ActiveModelAdapter.extend(
${1:#body}
)
"""
101 changes: 101 additions & 0 deletions snippets/computed.cson
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
'.source.coffee':


'Ember.computed.gt(...':
'prefix': 'computed_gt'
'body': "Ember.computed.gt( '${1:property}' , ${2:0} ) ${3:# (returns a boolean)}"




'Ember.computed.lt(...':
'prefix': 'computed_lt'
'body': "Ember.computed.lt( '${1:property}' , ${2:0} ) ${3:# (returns a boolean)}"




'Ember.computed.or(...':
'prefix': 'computed_or'
'body': "Ember.computed.or( '${1:property_1}' , '${2:property_2}' ) ${3:# (returns a boolean)}"




'Ember.computed.and(...':
'prefix': 'computed_and'
'body': "Ember.computed.and( '${1:property_1}' , '${2:property_2}' ) ${3:# (returns a boolean)}"




'Ember.computed.max(...':
'prefix': 'computed_max'
'body': "Ember.computed.max( '${1:array_property}' ) ${2:# (returns the max as a number)}"




'Ember.computed.min(...':
'prefix': 'computed_min'
'body': "Ember.computed.min( '${1:array_property}' ) ${2:# (returns the min as a number)}"




'Ember.computed.map(...':
'prefix': 'computed_map'
'body': """ Ember.computed.map( '${1:array_property}', (item, index) ->
${2:#example logic
altered_item = item + "some_string"
return altered_item }

${3:# outputs a new array}
"""




'Ember.computed.mapBy(...':
'prefix': 'computed_mapBy'
'body': "Ember.computed.mapBy( '${1:array_of_objs}','${2:obj_key}' ) ${3:# outputs a simple array[] of items} "




'Ember.computed.filter(...':
'prefix': 'computed_filter'
'body':
"""
Ember.computed.filter( '${1:array_property}', ( item, index, array ) ->
${2:#logic.. (should return a boolean)}
"""




'Ember.computed.filterBy(...':
'prefix': 'computed_filterBy'
'body': "Ember.computed.filterBy( '${1:array_of_objs}','${2:obj_key}', ${3:value} ) ${4:#returns filtered array[]}"




'Ember.computed.empty(...':
'prefix': 'computed_empty'
'body': "Ember.computed.empty( '${1:propery}' ) ${2:#returns boolean}"





'Ember.computed.match(...':
'prefix': 'computed_match'
'body': "Ember.computed.match( '${1:statement}' , /^${2:regex}$/ ) (# returns a boolean)"




'Ember.computed.alias(...':
'prefix': 'computed_alias'
'body': "Ember.computed.alias( '${1:statement}' ) (# returns a boolean)"
75 changes: 75 additions & 0 deletions snippets/controller.cson
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
'.source.coffee':


'Ember.ObjectController.extend(...':
'prefix': 'objectController'
'body':
"""
_export = Ember.ObjectController.extend(
actions:
${2:name}: ->
${3:#logic...}
)
"""




'Ember.ArrayController.extend(...':
'prefix': 'arrayController'
'body':
"""
_export = Ember.ArrayController.extend(
actions:
${2:name}: ->
${3:#logic...}

)
"""



'Ember.controller.extend(...':
'prefix': 'controller'
'body':
"""
_export = Ember.controller.extend(
actions:
${2:name}: ->
${3:#logic...}
)
"""



'itemController : ...':
'prefix': 'arrayController_itemController'
'body': "itemController : '${1:an_objController}'}"


'sortProperties : ...':
'prefix': 'arrayController_sortProperties'
'body': "sortProperties : ['${1:property}']}"


'sortAscending : ...':
'prefix': 'arrayController_sortAscending'
'body': "sortAscending : ['${1:false}']}"





'itemController: ...':
'prefix': 'itemController'
'body': "itemController : '${1:an_objController}'}"


'sortProperties: ...':
'prefix': 'sortProperties'
'body': "sortProperties : ['${1:property}']}"


'sortAscending: ...':
'prefix': 'sortAscending'
'body': "sortAscending : ['${1:false}']}"
99 changes: 99 additions & 0 deletions snippets/es6.cson
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
'.source.coffee':


'import Ember from':
'prefix': 'es6_import_ember'
'body':
"""
`import Ember from "ember";`
${1}
"""

'import Ember from...':
'prefix': 'import_ember'
'body':
"""
`import Ember from "ember";`
${1}
"""




'import DS from':
'prefix': 'es6_import_ds'
'body':
"""
`import DS from 'ember-data';`
${1}
"""

'import DS from...':
'prefix': 'import_ds'
'body':
"""
`import DS from 'ember-data';`
${1}
"""


'import custom from':
'prefix': 'es6_import_custom'
'body':
"""
`import ${1:var} from './${2}';`
${3}
"""


'import custom from...':
'prefix': 'import_custom'
'body':
"""
`import ${1:var} from './${2}';`
${3}
"""

'export Default':
'prefix': 'es6_export_default'
'body':
"""

${2}


`export default ${1:_export};`
"""



'export Default...':
'prefix': 'export_default'
'body':
"""

${2}


`export default ${1:_export};`
"""




'both imports and export...':
'prefix': 'es6_fullset'
'body':
"""
${1:`import Ember from 'ember';`}
${2:`import DS from 'ember-data';`}



${3}



`export default _export;`

"""
Loading