id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mojotech/pioneer:src/widgets/Widget.List.coffee:1:raw_corpus | raw_corpus | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@find().then (el... | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/src/widgets/Widget.List.coffee | 1 | 26 | ||
mojotech/pioneer:src/widgets/Widget.List.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -... | this.Widget.List = (function() {
class List extends this.Widget {
at(index) {
return this.items().then(function(items) {
return items[index];
});
}
map(iter) {
return this.items().then(function(items) {
return $.map(items, iter);
});
}
filter(iter) {
... | CoffeeScript | JavaScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/src/widgets/Widget.List.coffee | 1 | 26 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.Widget.List = (function() {
class List extends this.Widget {
at(index) {
return this.items().then(function(items) {
return items[index];
});
}
map(iter) {
return this.items().then(function(items) {
return $.map(... | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@find().then (el... | JavaScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/src/widgets/Widget.List.coffee | 1 | 26 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:completion | completion | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) -> | @items().then (items) -> $.filter(items, iter)
items: ->
@find().then (el) =>
el.findElements(Driver.By.css(@itemSelector))
.then (elms) =>
_.map elms, (el) =>
new @itemClass({
el: el
})
findWhere: (iter) ->
@filter(iter).then (items) -> items[0] if items | CoffeeScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/src/widgets/Widget.List.coffee | 1 | 26 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:raw_corpus | raw_corpus | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@findAll(@itemSe... | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/src/widgets/Widget.List.coffee | 1 | 23 | ||
mojotech/pioneer:src/widgets/Widget.List.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -... | this.Widget.List = (function() {
class List extends this.Widget {
at(index) {
return this.items().then(function(items) {
return items[index];
});
}
map(iter) {
return this.items().then(function(items) {
return $.map(items, iter);
});
}
filter(iter) {
... | CoffeeScript | JavaScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/src/widgets/Widget.List.coffee | 1 | 23 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.Widget.List = (function() {
class List extends this.Widget {
at(index) {
return this.items().then(function(items) {
return items[index];
});
}
map(iter) {
return this.items().then(function(items) {
return $.map(... | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@findAll(@itemSe... | JavaScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/src/widgets/Widget.List.coffee | 1 | 23 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:completion | completion | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter) | filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@findAll(@itemSelector).then (items) =>
_.map items, (item, i) =>
sel = "#{@root} #{@itemSelector}:nth-child(#{i + 1})"
new @itemClass(root: sel)
findWhere: (iter) ->
@filter(iter).then (items) -> items[0]... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/src/widgets/Widget.List.coffee | 1 | 23 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:raw_corpus | raw_corpus | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@findAll(@itemSe... | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.List.coffee | 1 | 20 | ||
mojotech/pioneer:src/widgets/Widget.List.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -... | this.Widget.List = (function() {
class List extends this.Widget {
at(index) {
return this.items().then(function(items) {
return items[index];
});
}
map(iter) {
return this.items().then(function(items) {
return $.map(items, iter);
});
}
filter(iter) {
... | CoffeeScript | JavaScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.List.coffee | 1 | 20 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.Widget.List = (function() {
class List extends this.Widget {
at(index) {
return this.items().then(function(items) {
return items[index];
});
}
map(iter) {
return this.items().then(function(items) {
return $.map(... | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) ->
@items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@findAll(@itemSe... | JavaScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.List.coffee | 1 | 20 |
mojotech/pioneer:src/widgets/Widget.List.coffee:1:completion | completion | class @Widget.List extends @Widget
itemSelector: 'li'
itemClass: World.Widget
at: (index) ->
@items().then (items) ->
items[index]
map: (iter) -> | @items().then (items) -> $.map(items, iter)
filter: (iter) ->
@items().then (items) -> $.filter(items, iter)
items: ->
@findAll(@itemSelector).then (items) =>
_.map items, (item, i) =>
sel = "#{@root} #{@itemSelector}:nth-child(#{i + 1})"
new @itemClass(root: sel) | CoffeeScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.List.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.List.coffee | 1 | 20 |
jianliaoim/talk-os:talk-web/client/app/search-suggest.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'search-suggest'
mixins: [PureRenderMixin]
propTypes:
_teamId: T.string.isRequired
cursor: T.number.isRequired
contacts: T.instanceOf(Immutable.List)
stories: T.instanceOf(Immutable.List)
rooms: T.i... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/search-suggest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/search-suggest.coffee | 30 | 79 | ||
jianliaoim/talk-os:talk-web/client/app/search-suggest.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'search-suggest'
mixins: [PureRenderMixin]
propTypes:
_teamId: T.string.isRequired
cursor: T.number.isRequired
contacts: T.instanceOf(Immutable.List)
stories: T.instanceOf(Immutable.List)
rooms: T.i... | triggerIndex: (index) ->
@props.onIndexClick index
# events
onSearchAllClick: ->
@triggerIndex 0
onSearchStoryClick: ->
@triggerIndex 1
handleScroll: ->
unless @refs.scroll?
return
each = 34
scrollEl = @refs.scroll
totalHeight = scrollEl.clientHeight
top = scrollEl.scr... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/search-suggest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/search-suggest.coffee | 30 | 79 |
jianliaoim/talk-os:talk-web/client/app/search-suggest.coffee:2:raw_corpus | raw_corpus | y = startY - totalHeight / 2
dom.smoothScrollTo scrollEl, 0, y
# renderers
renderRooms: ->
spec = if @props.searchMode then 2 else 0
@props.rooms.map (room, index) =>
cursor = index + spec + @props.contacts.size
onClick = =>
@triggerIndex cursor
TopicName
key: room... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/search-suggest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/search-suggest.coffee | 80 | 129 | ||
jianliaoim/talk-os:talk-web/client/app/search-suggest.coffee:2:completion | completion | y = startY - totalHeight / 2
dom.smoothScrollTo scrollEl, 0, y
# renderers
renderRooms: ->
spec = if @props.searchMode then 2 else 0
@props.rooms.map (room, index) =>
cursor = index + spec + @props.contacts.size
onClick = =>
@triggerIndex cursor
TopicName
key: room... | cursor = index + spec
onClick = =>
@triggerIndex cursor
ContactName
key: contact.get('_id')
contact: contact
_teamId: @props._teamId
hover: cursor is @props.cursor
showUnread: false
showEmail: false
onClick: onClick
isQuit: contact.get... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/search-suggest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/search-suggest.coffee | 80 | 129 |
jianliaoim/talk-os:talk-web/client/app/search-suggest.coffee:3:raw_corpus | raw_corpus | @triggerIndex cursor
div className: cxStoryName, key: story.get('_id'), onClick: onClick,
span className: cxAvatar, style: thumnailStyle
span className: 'name short', story.get('title')
render: ->
classAll = cx 'builtin', 'is-active': (@props.cursor is 0)
classStory = cx 'builtin', 'is... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/search-suggest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/search-suggest.coffee | 130 | 171 | ||
jianliaoim/talk-os:talk-web/client/app/search-suggest.coffee:3:completion | completion | @triggerIndex cursor
div className: cxStoryName, key: story.get('_id'), onClick: onClick,
span className: cxAvatar, style: thumnailStyle
span className: 'name short', story.get('title')
render: ->
classAll = cx 'builtin', 'is-active': (@props.cursor is 0)
classStory = cx 'builtin', 'is... | span className: 'text muted', searchStory
#contact
if @props.contacts.size > 0
div className: 'group',
if @props.searchMode
div className: 'slim-bar', l('member')
@renderContacts()
#room
if @props.rooms.size > 0
div className: 'group',
if... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/search-suggest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/search-suggest.coffee | 130 | 171 |
linemanjs/lineman:config/plugins/copy.coffee:1:raw_corpus | raw_corpus | module.exports = (lineman) ->
config:
copy:
dev:
files: [
expand: true
cwd: "vendor/static"
src: "**"
dest: 'generated'
,
expand: true
cwd: "app/static"
src: "**"
dest: 'generated'
]
... | CoffeeScript | linemanjs/lineman | config/plugins/copy.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/config/plugins/copy.coffee | 1 | 28 | ||
linemanjs/lineman:config/plugins/copy.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (lineman) ->
config:
copy:
dev:
files: [
expand: true
cwd: "vendor/static"
src: "**"
dest: 'generated'
,
expand: true
cwd: "app/static"
... | module.exports = function(lineman) {
return {
config: {
copy: {
dev: {
files: [
{
expand: true,
cwd: "vendor/static",
src: "**",
dest: 'generated'
},
{
expand: true,
cwd:... | CoffeeScript | JavaScript | linemanjs/lineman | config/plugins/copy.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/config/plugins/copy.coffee | 1 | 28 |
linemanjs/lineman:config/plugins/copy.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(lineman) {
return {
config: {
copy: {
dev: {
files: [
{
expand: true,
cwd: "vendor/static",
src: "**",
dest: 'generated'
},
... | module.exports = (lineman) ->
config:
copy:
dev:
files: [
expand: true
cwd: "vendor/static"
src: "**"
dest: 'generated'
,
expand: true
cwd: "app/static"
src: "**"
dest: 'generated'
]
... | JavaScript | CoffeeScript | linemanjs/lineman | config/plugins/copy.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/config/plugins/copy.coffee | 1 | 28 |
linemanjs/lineman:config/plugins/copy.coffee:1:raw_corpus | raw_corpus | module.exports = (lineman) ->
config:
copy:
dev:
files: [
expand: true
cwd: "app/static"
src: "**"
dest: 'generated'
]
dist:
files: [
expand: true
cwd: "app/static"
src: "**"
dest: 'dist'
] | CoffeeScript | linemanjs/lineman | config/plugins/copy.coffee | MIT | 92b48faa29da6ae7508696ce33301c4e04b4df1b | 1,168 | https://github.com/linemanjs/lineman/blob/92b48faa29da6ae7508696ce33301c4e04b4df1b/config/plugins/copy.coffee | 1 | 18 | ||
linemanjs/lineman:config/plugins/copy.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (lineman) ->
config:
copy:
dev:
files: [
expand: true
cwd: "app/static"
src: "**"
dest: 'generated'
]
dist:
files: [
expand: true
cwd: "app/sta... | module.exports = function(lineman) {
return {
config: {
copy: {
dev: {
files: [
{
expand: true,
cwd: "app/static",
src: "**",
dest: 'generated'
}
]
},
dist: {
files: [
... | CoffeeScript | JavaScript | linemanjs/lineman | config/plugins/copy.coffee | MIT | 92b48faa29da6ae7508696ce33301c4e04b4df1b | 1,168 | https://github.com/linemanjs/lineman/blob/92b48faa29da6ae7508696ce33301c4e04b4df1b/config/plugins/copy.coffee | 1 | 18 |
linemanjs/lineman:config/plugins/copy.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(lineman) {
return {
config: {
copy: {
dev: {
files: [
{
expand: true,
cwd: "app/static",
src: "**",
dest: 'generated'
}
... | module.exports = (lineman) ->
config:
copy:
dev:
files: [
expand: true
cwd: "app/static"
src: "**"
dest: 'generated'
]
dist:
files: [
expand: true
cwd: "app/static"
src: "**"
dest: 'dist'
] | JavaScript | CoffeeScript | linemanjs/lineman | config/plugins/copy.coffee | MIT | 92b48faa29da6ae7508696ce33301c4e04b4df1b | 1,168 | https://github.com/linemanjs/lineman/blob/92b48faa29da6ae7508696ce33301c4e04b4df1b/config/plugins/copy.coffee | 1 | 18 |
jianliaoim/talk-os:talk-api2x/server/util/crypto.coffee:1:raw_corpus | raw_corpus | crypto = require 'crypto'
uuid = require 'uuid'
module.exports = _crypto =
md5: (str) ->
crypto.createHash('md5').update(str).digest('hex')
sha1: (str) ->
crypto.createHash('sha1').update(str).digest('hex')
# @param `raw_password` user input
# @param `enc_password` password store in the database
chec... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/util/crypto.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/crypto.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-api2x/server/util/crypto.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
crypto = require 'crypto'
uuid = require 'uuid'
module.exports = _crypto =
md5: (str) ->
crypto.createHash('md5').update(str).digest('hex')
sha1: (str) ->
crypto.createHash('sha1').update(str).digest('hex')
# @param `raw_password` user input
# @p... | var _crypto, crypto, uuid,
indexOf = [].indexOf;
crypto = require('crypto');
uuid = require('uuid');
module.exports = _crypto = {
md5: function(str) {
return crypto.createHash('md5').update(str).digest('hex');
},
sha1: function(str) {
return crypto.createHash('sha1').update(str).digest('hex');
},
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/util/crypto.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/crypto.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/util/crypto.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _crypto, crypto, uuid,
indexOf = [].indexOf;
crypto = require('crypto');
uuid = require('uuid');
module.exports = _crypto = {
md5: function(str) {
return crypto.createHash('md5').update(str).digest('hex');
},
sha1: function(str) {
return cryp... | crypto = require 'crypto'
uuid = require 'uuid'
module.exports = _crypto =
md5: (str) ->
crypto.createHash('md5').update(str).digest('hex')
sha1: (str) ->
crypto.createHash('sha1').update(str).digest('hex')
# @param `raw_password` user input
# @param `enc_password` password store in the database
chec... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/util/crypto.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/crypto.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/util/crypto.coffee:1:completion | completion | crypto = require 'crypto'
uuid = require 'uuid'
module.exports = _crypto =
md5: (str) ->
crypto.createHash('md5').update(str).digest('hex')
sha1: (str) ->
crypto.createHash('sha1').update(str).digest('hex')
# @param `raw_password` user input
# @param `enc_password` password store in the database
chec... | return [type, mix, encode].join('$')
encrypt: (str, secret) ->
m = crypto.createHash('md5')
m.update(secret)
key = m.digest('hex')
m = crypto.createHash('md5')
m.update(secret + key)
iv = m.digest('hex')
data = new Buffer(str, 'utf8').toString('binary')
cipher = crypto.createCipher... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/util/crypto.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/crypto.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/util/crypto.coffee:2:raw_corpus | raw_corpus | key = m.digest('hex')
m = crypto.createHash('md5')
m.update(secret + key)
iv = m.digest('hex')
decipher = crypto.createDecipheriv('aes-256-cbc', key, iv.slice(0, 16))
decrypted = decipher.update(edata, 'hex', 'utf8') + decipher.final('utf8')
plaintext = new Buffer(decrypted, 'binar... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/util/crypto.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/crypto.coffee | 51 | 74 | ||
jianliaoim/talk-os:talk-api2x/server/util/crypto.coffee:2:completion | completion | key = m.digest('hex')
m = crypto.createHash('md5')
m.update(secret + key)
iv = m.digest('hex')
decipher = crypto.createDecipheriv('aes-256-cbc', key, iv.slice(0, 16))
decrypted = decipher.update(edata, 'hex', 'utf8') + decipher.final('utf8')
plaintext = new Buffer(decrypted, 'binar... | encryptToken: (str, secret) ->
_crypto.encrypt.apply this, arguments
decryptToken: (str, secret) ->
plaintext = _crypto.decrypt str, secret
return null unless plaintext
[userId, timestamp] = plaintext.split('$')
data =
userId: userId
timestamp: timestamp
return data | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/util/crypto.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/crypto.coffee | 51 | 74 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
{OptionParser} = require 'coffee-script/lib/optparse'
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process.argv[0]... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 48465b1b7b993a2ea53e4dc8b2f7ca9d2f956c51 | 1,245 | https://github.com/mauricemach/coffeekup/blob/48465b1b7b993a2ea53e4dc8b2f7ca9d2f956c51/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
{OptionParser} = require 'coffee-script/lib/optparse'
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process.argv[0]... | unless exists then fs.mkdirSync dir, 0777
output_path = path.join dir, filename
html = ' ' if html.length <= 0
fs.writeFile output_path, html, (err) ->
throw err if err
puts html if options.print
puts "Compiled #{input_path}" if options.watch
usage = '''
Usage:
coffeekup [options] ... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 48465b1b7b993a2ea53e4dc8b2f7ca9d2f956c51 | 1,245 | https://github.com/mauricemach/coffeekup/blob/48465b1b7b993a2ea53e4dc8b2f7ca9d2f956c51/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 773b21fac28b3cee523ea3acbbf0c00341c33afb | 1,245 | https://github.com/mauricemach/coffeekup/blob/773b21fac28b3cee523ea3acbbf0c00341c33afb/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | unless exists then fs.mkdirSync dir, 0777
output_path = path.join dir, filename
html = ' ' if html.length <= 0
fs.writeFile output_path, html, (err) ->
throw err if err
puts html if options.print
puts "Compiled #{input_path}" if options.watch
usage = '''
Usage:
coffeekup [options] ... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 773b21fac28b3cee523ea3acbbf0c00341c33afb | 1,245 | https://github.com/mauricemach/coffeekup/blob/773b21fac28b3cee523ea3acbbf0c00341c33afb/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 1f416e8d0a7bf87f989de2ed9534b7c706a3e692 | 1,245 | https://github.com/mauricemach/coffeekup/blob/1f416e8d0a7bf87f989de2ed9534b7c706a3e692/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | unless exists then fs.mkdirSync dir, 0777
output_path = path.join dir, filename
html = ' ' if html.length <= 0
fs.writeFile output_path, html, (err) ->
throw err if err
puts html if options.print
puts "Compiled #{input_path}" if options.watch
usage = '''
Usage:
coffeekup [OPTIONS] ... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 1f416e8d0a7bf87f989de2ed9534b7c706a3e692 | 1,245 | https://github.com/mauricemach/coffeekup/blob/1f416e8d0a7bf87f989de2ed9534b7c706a3e692/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv l... | //!/usr/bin/env coffee
var OptionParser, args, argv, coffeekup, fs, options, parser, path, puts, render, switches, usage, write;
coffeekup = require('coffeekup');
fs = require('fs');
path = require('path');
puts = console.log;
OptionParser = require('coffee-script/optparse').OptionParser;
// On coffee-script@0.9.... | CoffeeScript | JavaScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var OptionParser, args, argv, coffeekup, fs, options, parser, path, puts, render, switches, usage, write;
coffeekup = require('coffeekup');
fs = require('fs');
path = require('path');
puts = console.log;
OptionParser = require('coffee-sc... | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | JavaScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process... | html = ' ' if html.length <= 0
fs.writeFile output_path, html, (err) ->
puts html if options.print
puts "Compiled #{input_path}" if options.watch
usage = '''
Usage:
coffeekup [OPTIONS] path/to/template.coffee
'''
switches = [
['-w', '--watch', 'Keeps watching the file and recompiling it when it chan... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:raw_corpus | raw_corpus | puts coffeekup.version if options.version
if options.utils
options.locals ?= {}
options.locals.render = (file) ->
contents = fs.readFileSync file
coffeekup.render String(contents), options
if args.length > 0
file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (cur... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 51 | 65 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
puts coffeekup.version if options.version
if options.utils
options.locals ?= {}
options.locals.render = (file) ->
contents = fs.readFileSync file
coffeekup.render String(contents), options
if args.length > 0
file = args[0]
if options.watch
f... | var file;
if (options.version) {
puts(coffeekup.version);
}
if (options.utils) {
if (options.locals == null) {
options.locals = {};
}
options.locals.render = function(file) {
var contents;
contents = fs.readFileSync(file);
return coffeekup.render(String(contents), options);
};
}
if (args.le... | CoffeeScript | JavaScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 51 | 65 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var file;
if (options.version) {
puts(coffeekup.version);
}
if (options.utils) {
if (options.locals == null) {
options.locals = {};
}
options.locals.render = function(file) {
var contents;
contents = fs.readFileSync(file);
return coffeekup... | puts coffeekup.version if options.version
if options.utils
options.locals ?= {}
options.locals.render = (file) ->
contents = fs.readFileSync file
coffeekup.render String(contents), options
if args.length > 0
file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (cur... | JavaScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 51 | 65 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:completion | completion | puts coffeekup.version if options.version
if options.utils
options.locals ?= {}
options.locals.render = (file) ->
contents = fs.readFileSync file
coffeekup.render String(contents), options | if args.length > 0
file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | b260befd8f617463f263364134328ebd6ff72b20 | 1,245 | https://github.com/mauricemach/coffeekup/blob/b260befd8f617463f263364134328ebd6ff72b20/bin/coffeekup.coffee | 51 | 65 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), option... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if... | //!/usr/bin/env coffee
var OptionParser, args, coffeekup, fs, options, parser, path, puts, render, switches, usage, write;
coffeekup = require('coffeekup');
fs = require('fs');
path = require('path');
puts = console.log;
OptionParser = require('coffee-script/optparse').OptionParser;
render = function(input_path) ... | CoffeeScript | JavaScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var OptionParser, args, coffeekup, fs, options, parser, path, puts, render, switches, usage, write;
coffeekup = require('coffeekup');
fs = require('fs');
path = require('path');
puts = console.log;
OptionParser = require('coffee-script/o... | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), option... | JavaScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), option... | Usage:
coffeekup [OPTIONS] path/to/template.coffee
'''
switches = [
['-w', '--watch', 'Keeps watching the file and recompiling it when it changes']
['-p', '--print', 'Prints the compiled html to stdout']
['-f', '--format', 'Applies line breaks to html output']
['-u', '--utils', 'Adds helper locals (current... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:raw_corpus | raw_corpus | if args.length > 0
file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 51 | 58 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if args.length > 0
file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file
``` | var file;
if (args.length > 0) {
file = args[0];
if (options.watch) {
fs.watchFile(file, {
persistent: true,
interval: 500
}, function(curr, prev) {
if (curr.size === prev.size && curr.mtime.getTime() === prev.mtime.getTime()) {
return;
}
return render(file);
});
... | CoffeeScript | JavaScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 51 | 58 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var file;
if (args.length > 0) {
file = args[0];
if (options.watch) {
fs.watchFile(file, {
persistent: true,
interval: 500
}, function(curr, prev) {
if (curr.size === prev.size && curr.mtime.getTime() === prev.mtime.getTime()) {
... | if args.length > 0
file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file | JavaScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 51 | 58 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:completion | completion | if args.length > 0
file = args[0]
if options.watch | fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 5430f78bf58067b40a538379e91c1b31c5ed92ad | 1,245 | https://github.com/mauricemach/coffeekup/blob/5430f78bf58067b40a538379e91c1b31c5ed92ad/bin/coffeekup.coffee | 51 | 58 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), options
write input_p... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | e6b3b4963465109efd1f1a52af7627eb77920c5d | 1,245 | https://github.com/mauricemach/coffeekup/blob/e6b3b4963465109efd1f1a52af7627eb77920c5d/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), options
write input_p... | '''
switches = [
['-w', '--watch', 'Keeps watching the file and recompiling it when it changes']
['-p', '--print', 'Prints the compiled html to stdout']
['-f', '--format', 'Applies line breaks to html output']
['-u', '--utils', 'Adds helper locals (currently only "render")']
['-h', '--help', 'Prints this hel... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | e6b3b4963465109efd1f1a52af7627eb77920c5d | 1,245 | https://github.com/mauricemach/coffeekup/blob/e6b3b4963465109efd1f1a52af7627eb77920c5d/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:2:raw_corpus | raw_corpus | file = args[0]
if options.watch
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | e6b3b4963465109efd1f1a52af7627eb77920c5d | 1,245 | https://github.com/mauricemach/coffeekup/blob/e6b3b4963465109efd1f1a52af7627eb77920c5d/bin/coffeekup.coffee | 51 | 57 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:2:completion | completion | file = args[0]
if options.watch | fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
render file
else render file | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | e6b3b4963465109efd1f1a52af7627eb77920c5d | 1,245 | https://github.com/mauricemach/coffeekup/blob/e6b3b4963465109efd1f1a52af7627eb77920c5d/bin/coffeekup.coffee | 51 | 57 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), options
write input_p... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a | 1,245 | https://github.com/mauricemach/coffeekup/blob/61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a/bin/coffeekup.coffee | 1 | 50 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = cof... | //!/usr/bin/env coffee
var OptionParser, args, coffeekup, file, fs, options, parser, path, render, switches, usage, write;
coffeekup = require('coffeekup');
fs = require('fs');
path = require('path');
OptionParser = require('coffee-script/optparse').OptionParser;
render = function(input_path) {
return fs.readFil... | CoffeeScript | JavaScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a | 1,245 | https://github.com/mauricemach/coffeekup/blob/61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var OptionParser, args, coffeekup, file, fs, options, parser, path, render, switches, usage, write;
coffeekup = require('coffeekup');
fs = require('fs');
path = require('path');
OptionParser = require('coffee-script/optparse').OptionParse... | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), options
write input_p... | JavaScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a | 1,245 | https://github.com/mauricemach/coffeekup/blob/61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
path = require 'path'
OptionParser = require('coffee-script/optparse').OptionParser
render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
html = coffeekup.render String(contents), options
write input_p... | '''
switches = [
['-h', '--help', 'Prints this help message']
['-v', '--version', 'Shows CoffeeKup version']
['-f', '--format', 'Applies line breaks to HTML output']
['-w', '--watch', 'Keeps watching the file and recompiling it when it changes']
['-p', '--print', 'Prints the compiled html to stdout']
]
pars... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a | 1,245 | https://github.com/mauricemach/coffeekup/blob/61cf3d4ce6acbb01880a6ca39d1261f7e1e1793a/bin/coffeekup.coffee | 1 | 50 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
usage = '''
Usage:
coffeekup INPUT_FILE
Options:
-v, --version
-h, --help
'''
args = process.argv
if args.length is 0
puts usage
else
input = args[0]
if input in ['-v', '--version']
puts coffeekup.version
else if in... | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f | 1,245 | https://github.com/mauricemach/coffeekup/blob/75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f/bin/coffeekup.coffee | 1 | 27 | ||
mauricemach/coffeekup:bin/coffeekup.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
usage = '''
Usage:
coffeekup INPUT_FILE
Options:
-v, --version
-h, --help
'''
args = process.argv
if args.length is 0
puts usage
else
input = args[0]
if input in ['... | //!/usr/bin/env coffee
var args, code, coffeekup, fs, input, usage;
coffeekup = require('coffeekup');
fs = require('fs');
usage = `Usage:
coffeekup INPUT_FILE
Options:
-v, --version
-h, --help`;
args = process.argv;
if (args.length === 0) {
puts(usage);
} else {
input = args[0];
if (input === '-v' || ... | CoffeeScript | JavaScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f | 1,245 | https://github.com/mauricemach/coffeekup/blob/75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f/bin/coffeekup.coffee | 1 | 27 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var args, code, coffeekup, fs, input, usage;
coffeekup = require('coffeekup');
fs = require('fs');
usage = `Usage:
coffeekup INPUT_FILE
Options:
-v, --version
-h, --help`;
args = process.argv;
if (args.length === 0) {
puts(usage... | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
usage = '''
Usage:
coffeekup INPUT_FILE
Options:
-v, --version
-h, --help
'''
args = process.argv
if args.length is 0
puts usage
else
input = args[0]
if input in ['-v', '--version']
puts coffeekup.version
else if in... | JavaScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f | 1,245 | https://github.com/mauricemach/coffeekup/blob/75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f/bin/coffeekup.coffee | 1 | 27 |
mauricemach/coffeekup:bin/coffeekup.coffee:1:completion | completion | #!/usr/bin/env coffee
coffeekup = require 'coffeekup'
fs = require 'fs'
usage = '''
Usage:
coffeekup INPUT_FILE
Options:
-v, --version
-h, --help
''' | args = process.argv
if args.length is 0
puts usage
else
input = args[0]
if input in ['-v', '--version']
puts coffeekup.version
else if input in ['-h', '--help']
puts usage
else
code = fs.readFileSync input, 'utf8'
puts coffeekup.render(code) | CoffeeScript | CoffeeScript | mauricemach/coffeekup | bin/coffeekup.coffee | MIT | 75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f | 1,245 | https://github.com/mauricemach/coffeekup/blob/75ee63ad23c68dd2866dfa1dfa70f09cb3e02f8f/bin/coffeekup.coffee | 1 | 27 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_break.coffee:1:raw_corpus | raw_corpus | # Test with break at the top level.
array: [1,2,3]
call_with_lambda: (l) -> null
for i in array
result: call_with_lambda(->)
if i == 2
puts "i = 2"
else
break
ok result is null
# Test with break *not* at the top level.
some_func: (input) ->
takes_lambda: (l) -> null
for i in [1,2]
result: takes... | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_break.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_break.coffee | 1 | 27 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_break.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Test with break at the top level.
array: [1,2,3]
call_with_lambda: (l) -> null
for i in array
result: call_with_lambda(->)
if i == 2
puts "i = 2"
else
break
ok result is null
# Test with break *not* at the top level.
some_func: (input) ->
tak... | // Test with break at the top level.
var i, j, len;
({
array: [1, 2, 3],
call_with_lambda: function(l) {
return null;
}
});
for (j = 0, len = array.length; j < len; j++) {
i = array[j];
({
result: call_with_lambda(function() {})
});
if (i === 2) {
puts("i = 2");
} else {
break;
}
}
... | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_break.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_break.coffee | 1 | 27 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_break.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Test with break at the top level.
var i, j, len;
({
array: [1, 2, 3],
call_with_lambda: function(l) {
return null;
}
});
for (j = 0, len = array.length; j < len; j++) {
i = array[j];
({
result: call_with_lambda(function() {})
});
if (i ==... | # Test with break at the top level.
array: [1,2,3]
call_with_lambda: (l) -> null
for i in array
result: call_with_lambda(->)
if i == 2
puts "i = 2"
else
break
ok result is null
# Test with break *not* at the top level.
some_func: (input) ->
takes_lambda: (l) -> null
for i in [1,2]
result: takes... | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_break.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_break.coffee | 1 | 27 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_break.coffee:1:completion | completion | # Test with break at the top level.
array: [1,2,3]
call_with_lambda: (l) -> null
for i in array
result: call_with_lambda(->)
if i == 2
puts "i = 2"
else
break
ok result is null | # Test with break *not* at the top level.
some_func: (input) ->
takes_lambda: (l) -> null
for i in [1,2]
result: takes_lambda(->)
if input == 1
return 1
else
break
return 2
ok some_func(1) is 1
ok some_func(2) is 2 | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_break.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_break.coffee | 1 | 27 |
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:1:raw_corpus | raw_corpus | module.exports = roomController = app.controller 'guest/room', ->
@ensure 'guestToken', only: 'readOne join'
@ensure 'prefs', only: 'updatePrefs'
@after 'attachRoomDetail', only: 'join'
@after 'afterJoin', only: 'join', parallel: true
@after 'afterLeave', only: 'leave', parallel: true
userFields = ['_id'... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 17 | 66 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:1:completion | completion | module.exports = roomController = app.controller 'guest/room', ->
@ensure 'guestToken', only: 'readOne join'
@ensure 'prefs', only: 'updatePrefs'
@after 'attachRoomDetail', only: 'join'
@after 'afterJoin', only: 'join', parallel: true
@after 'afterLeave', only: 'leave', parallel: true
userFields = ['_id'... | _teamId: room._teamId
_roomId: room._id
body: '{{__info-leave-room}}'
isSystem: true
icon: 'leave-room'
message.save()
@action 'readOne', (req, res, callback) ->
{guestToken} = req.get()
RoomModel
.findOne guestToken: guestToken
.populate 'team'
.exec (err, room) ->
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 17 | 66 |
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:2:raw_corpus | raw_corpus | return callback(new Err('OBJECT_MISSING', "room #{guestToken}")) unless room
req.set 'room', room
MemberModel.findOne
room: room._id
user: _sessionUserId
isQuit: false
, next
(member, next) ->
room = req.get 'room'
if member
room.jo... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 67 | 116 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:2:completion | completion | return callback(new Err('OBJECT_MISSING', "room #{guestToken}")) unless room
req.set 'room', room
MemberModel.findOne
room: room._id
user: _sessionUserId
isQuit: false
, next
(member, next) ->
room = req.get 'room'
if member
room.jo... | @action 'attachRoomDetail', (req, res, room, callback) ->
{_sessionUserId} = req.get()
async.auto
attachMembers: (callback) ->
room.attachMembers (err, room) ->
return callback(err, room) unless room?.members
room.members = room.members.map (user) ->
if "#{user._id}... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 67 | 116 |
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:3:raw_corpus | raw_corpus | NotificationModel.findOne
user: _sessionUserId
type: 'room'
target: room._id
team: room._teamId
, '_latestReadMessageId unreadNum'
, (err, notification) ->
room._latestReadMessageId = notification?._latestReadMessageId
room.unread = notificatio... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 117 | 159 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
NotificationModel.findOne
user: _sessionUserId
type: 'room'
target: room._id
team: room._teamId
, '_latestReadMessageId unreadNum'
, (err, notification) ->
room._latestReadMessageId = notification?... | NotificationModel.findOne({
user: _sessionUserId,
type: 'room',
target: room._id,
team: room._teamId
}, '_latestReadMessageId unreadNum', function(err, notification) {
room._latestReadMessageId = notification != null ? notification._latestReadMessageId : void 0;
room.unread = (notification != null ? notific... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 117 | 159 |
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
NotificationModel.findOne({
user: _sessionUserId,
type: 'room',
target: room._id,
team: room._teamId
}, '_latestReadMessageId unreadNum', function(err, notification) {
room._latestReadMessageId = notification != null ? notification._latestReadMessageId : ... | NotificationModel.findOne
user: _sessionUserId
type: 'room'
target: room._id
team: room._teamId
, '_latestReadMessageId unreadNum'
, (err, notification) ->
room._latestReadMessageId = notification?._latestReadMessageId
room.unread = notificatio... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 117 | 159 |
jianliaoim/talk-os:talk-api2x/server/controllers/guest/room.coffee:3:completion | completion | NotificationModel.findOne
user: _sessionUserId
type: 'room'
target: room._id
team: room._teamId
, '_latestReadMessageId unreadNum'
, (err, notification) ->
room._latestReadMessageId = notification?._latestReadMessageId
room.unread = notificatio... | me._teamId = room._teamId
return true
return false
res.broadcast "team:#{room._teamId}", "room:join", me
_createJoinMessage _sessionUserId, room
###*
* Send message history to the left guest
* Send leave message to other room members
* @param {[type]} req [description]
* @... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/guest/room.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/guest/room.coffee | 117 | 159 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0... | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 1 | 50 | ||
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
pr... | var _, _str, descendantPluginCollector, fs, grunt, isLinemanPlugin, knownPluginFinder, packageDependencies, path, pluginObjectBuilder, plugins, resolvesQuietly, semver;
_ = require("lodash");
_str = require("underscore.string");
resolvesQuietly = require('./../lib/resolves-quietly');
semver = require('semver');
fs... | CoffeeScript | JavaScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, _str, descendantPluginCollector, fs, grunt, isLinemanPlugin, knownPluginFinder, packageDependencies, path, pluginObjectBuilder, plugins, resolvesQuietly, semver;
_ = require("lodash");
_str = require("underscore.string");
resolvesQuietly = require('./../l... | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0... | JavaScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:completion | completion | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0... | isLinemanPlugin = (name) -> _str.startsWith(name, "lineman-")
pluginObjectBuilder = (basedir, depth) ->
(name) ->
if dir = resolvesQuietly.resolve(name, basedir: basedir)
version = require(path.join(dir, "package")).version
{name, version, dir, depth}
else
grunt.warn """
Co... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:raw_corpus | raw_corpus | prune = (plugins) ->
_(plugins)
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins)
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
tidyUnion = ... | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 51 | 70 | ||
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
prune = (plugins) ->
_(plugins)
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins)
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version... | var prune, shallowestDepthAndHighestVersion, tidyUnion;
prune = function(plugins) {
return _(plugins).groupBy("name").map(shallowestDepthAndHighestVersion).value();
};
shallowestDepthAndHighestVersion = function(plugins) {
return _(plugins).selectMin("depth").reduce(function(highest, plugin) {
if (semver.gt(p... | CoffeeScript | JavaScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 51 | 70 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var prune, shallowestDepthAndHighestVersion, tidyUnion;
prune = function(plugins) {
return _(plugins).groupBy("name").map(shallowestDepthAndHighestVersion).value();
};
shallowestDepthAndHighestVersion = function(plugins) {
return _(plugins).selectMin("depth")... | prune = (plugins) ->
_(plugins)
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins)
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
tidyUnion = ... | JavaScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 51 | 70 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:completion | completion | prune = (plugins) ->
_(plugins)
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins)
.selectMin("depth") | .reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
tidyUnion = (array, moreArrays...) ->
_(array).union(moreArrays...).compact().value()
_.mixin
selectMin: (items, property) ->
min = _(items).map(property).min((val) -> val)
_.filter items, (item) -> i... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/finds-plugin-modules.coffee | 51 | 70 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0... | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 1 | 50 | ||
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
pr... | var _, _str, descendantPluginCollector, fs, grunt, isLinemanPlugin, knownPluginFinder, packageDependencies, path, pluginObjectBuilder, plugins, resolvesQuietly, semver;
_ = require("lodash");
_str = require("underscore.string");
resolvesQuietly = require('./../lib/resolves-quietly');
semver = require('semver');
fs... | CoffeeScript | JavaScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, _str, descendantPluginCollector, fs, grunt, isLinemanPlugin, knownPluginFinder, packageDependencies, path, pluginObjectBuilder, plugins, resolvesQuietly, semver;
_ = require("lodash");
_str = require("underscore.string");
resolvesQuietly = require('./../l... | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0... | JavaScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:completion | completion | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
path = require('path')
grunt = require('./requires-grunt').require()
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0... | isLinemanPlugin = (name) -> _str.startsWith(name, "lineman-")
pluginObjectBuilder = (basedir, depth) ->
(name) ->
if dir = resolvesQuietly.resolve(name, basedir: basedir)
version = require(path.join(dir, "package")).version
{name, version, dir, depth}
else
grunt.warn """
Co... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:raw_corpus | raw_corpus | (plugin) -> plugin.name == dep.name && plugin.depth <= depth
prune = (plugins) ->
_(plugins)
.chain()
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins).chain()
.selectMin("depth")
.reduce (highest, plugin) ->
i... | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 51 | 73 | ||
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
(plugin) -> plugin.name == dep.name && plugin.depth <= depth
prune = (plugins) ->
_(plugins)
.chain()
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins).chain()
.se... | var prune, shallowestDepthAndHighestVersion, tidyUnion;
(function(plugin) {
return plugin.name === dep.name && plugin.depth <= depth;
});
prune = function(plugins) {
return _(plugins).chain().groupBy("name").map(shallowestDepthAndHighestVersion).value();
};
shallowestDepthAndHighestVersion = function(plugins) {
... | CoffeeScript | JavaScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 51 | 73 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var prune, shallowestDepthAndHighestVersion, tidyUnion;
(function(plugin) {
return plugin.name === dep.name && plugin.depth <= depth;
});
prune = function(plugins) {
return _(plugins).chain().groupBy("name").map(shallowestDepthAndHighestVersion).value();
};
... | (plugin) -> plugin.name == dep.name && plugin.depth <= depth
prune = (plugins) ->
_(plugins)
.chain()
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins).chain()
.selectMin("depth")
.reduce (highest, plugin) ->
i... | JavaScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 51 | 73 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:completion | completion | (plugin) -> plugin.name == dep.name && plugin.depth <= depth
prune = (plugins) ->
_(plugins)
.chain()
.groupBy("name")
.map(shallowestDepthAndHighestVersion)
.value()
shallowestDepthAndHighestVersion = (plugins) ->
_(plugins).chain() | .selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
.value()
tidyUnion = (array, moreArrays...) ->
_(array).chain().union(moreArrays...).compact().value()
_.mixin
selectMin: (items, property) ->
min = _(items).chain().pluck(prop... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | d36620374412596c8c7c519c51e433979f2b5a2d | 1,168 | https://github.com/linemanjs/lineman/blob/d36620374412596c8c7c519c51e433979f2b5a2d/lib/finds-plugin-modules.coffee | 51 | 73 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0, knownPlugins = []) ->
return [] unless fs.existsSync(dir)
modul... | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 1 | 50 | ||
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0, knownPlugi... | var _, _str, descendantPluginCollector, fs, isLinemanPlugin, knownPluginFinder, packageDependencies, pluginObjectBuilder, plugins, prune, resolvesQuietly, semver, shallowestDepthAndHighestVersion;
_ = require("lodash");
_str = require("underscore.string");
resolvesQuietly = require('./../lib/resolves-quietly');
sem... | CoffeeScript | JavaScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, _str, descendantPluginCollector, fs, isLinemanPlugin, knownPluginFinder, packageDependencies, pluginObjectBuilder, plugins, prune, resolvesQuietly, semver, shallowestDepthAndHighestVersion;
_ = require("lodash");
_str = require("underscore.string");
resol... | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0, knownPlugins = []) ->
return [] unless fs.existsSync(dir)
modul... | JavaScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:1:completion | completion | _ = require("lodash")
_str = require("underscore.string")
resolvesQuietly = require('./../lib/resolves-quietly')
semver = require('semver')
fs = require('fs')
module.exports =
find: ->
prune(plugins())
plugins = (dir = process.cwd(), depth = 0, knownPlugins = []) ->
return [] unless fs.existsSync(dir)
modul... | pluginObjectBuilder = (dir, depth) ->
(name) ->
dir = resolvesQuietly.resolve(name, basedir: dir)
version = require("#{dir}/package").version
{name, version, dir, depth}
descendantPluginCollector = (depth, knownPlugins) ->
(deps, dep) ->
allDeps = knownPlugins.concat(deps)
known = _(allDeps).an... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 1 | 50 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:raw_corpus | raw_corpus | _(plugins).chain()
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
.value()
tidyUnion = (array, moreArrays...) ->
_(array).chain().union(moreArrays...).compact().value()
_.mixin
selectMin: (items, property) ->
min = _(it... | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 51 | 63 | ||
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_(plugins).chain()
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
.value()
tidyUnion = (array, moreArrays...) ->
_(array).chain().union(moreArrays...).compact().value()
... | var tidyUnion;
_(plugins).chain().selectMin("depth").reduce(function(highest, plugin) {
if (semver.gt(plugin.version, highest.version)) {
return plugin;
} else {
return highest;
}
}).value();
tidyUnion = function(array, ...moreArrays) {
return _(array).chain().union(...moreArrays).compact().value();
}... | CoffeeScript | JavaScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 51 | 63 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var tidyUnion;
_(plugins).chain().selectMin("depth").reduce(function(highest, plugin) {
if (semver.gt(plugin.version, highest.version)) {
return plugin;
} else {
return highest;
}
}).value();
tidyUnion = function(array, ...moreArrays) {
return _(a... | _(plugins).chain()
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
.value()
tidyUnion = (array, moreArrays...) ->
_(array).chain().union(moreArrays...).compact().value()
_.mixin
selectMin: (items, property) ->
min = _(it... | JavaScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 51 | 63 |
linemanjs/lineman:lib/finds-plugin-modules.coffee:2:completion | completion | _(plugins).chain()
.selectMin("depth")
.reduce (highest, plugin) ->
if semver.gt(plugin.version, highest.version) then plugin else highest
.value() | tidyUnion = (array, moreArrays...) ->
_(array).chain().union(moreArrays...).compact().value()
_.mixin
selectMin: (items, property) ->
min = _(items).chain().pluck(property).min((val) -> val).value()
_(items).select (item) -> item[property] == min | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/finds-plugin-modules.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/finds-plugin-modules.coffee | 51 | 63 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.