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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jianliaoim/talk-os:talk-api2x/server/schemas/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var methods, overwrites, schemas;
methods = {
$save: function() {
var model;
model = this;
return new Promise(function(resolve, reject) {
return model.save(function(err, model) {
if (err) {
return reject(err);
}
... | methods =
$save: ->
model = this
new Promise (resolve, reject) ->
model.save (err, model) ->
return reject(err) if err
resolve model
$remove: ->
model = this
new Promise (resolve, reject) ->
model.remove (err, model) ->
return reject(err) if err
resolve mo... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/index.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/index.coffee | 77 | 126 |
jianliaoim/talk-os:talk-api2x/server/schemas/index.coffee:1:completion | completion | methods =
$save: ->
model = this
new Promise (resolve, reject) ->
model.save (err, model) ->
return reject(err) if err
resolve model
$remove: ->
model = this
new Promise (resolve, reject) ->
model.remove (err, model) ->
return reject(err) if err
resolve mo... | Integration: require './integration'
Invitation: require './invitation'
DeviceToken: require './devicetoken'
Favorite: require './favorite'
Tag: require './tag'
Voip: require './voip'
Story: require './story'
Notification: require './notification'
Mark: require './mark'
Group: require './group'
Usag... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/index.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/index.coffee | 77 | 126 |
jianliaoim/talk-os:talk-account/server/mailers/base.coffee:1:raw_corpus | raw_corpus | class BaseMailer
from: '简聊 <notification@mail.jianliao.com>'
delay: 0
action: 'delay'
constructor: ->
@_getTemplate()
preview: (email = {}, callback = ->) ->
self = this
templateFile = path.join __dirname, "templates/#{@template}.html"
template = fs.readFileSync templateFile, encoding: '... | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/base.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/base.coffee | 12 | 61 | ||
jianliaoim/talk-os:talk-account/server/mailers/base.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class BaseMailer
from: '简聊 <notification@mail.jianliao.com>'
delay: 0
action: 'delay'
constructor: ->
@_getTemplate()
preview: (email = {}, callback = ->) ->
self = this
templateFile = path.join __dirname, "templates/#{@template}.html"... | var BaseMailer;
BaseMailer = (function() {
class BaseMailer {
constructor() {
this._getTemplate();
}
preview(email = {}, callback = function() {}) {
var err, filename, html, juiceOptions, juiceTemplate, options, self, template, templateFile;
self = this;
templateFile = path.join(... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/mailers/base.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/base.coffee | 12 | 61 |
jianliaoim/talk-os:talk-account/server/mailers/base.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var BaseMailer;
BaseMailer = (function() {
class BaseMailer {
constructor() {
this._getTemplate();
}
preview(email = {}, callback = function() {}) {
var err, filename, html, juiceOptions, juiceTemplate, options, self, template, templateF... | class BaseMailer
from: '简聊 <notification@mail.jianliao.com>'
delay: 0
action: 'delay'
constructor: ->
@_getTemplate()
preview: (email = {}, callback = ->) ->
self = this
templateFile = path.join __dirname, "templates/#{@template}.html"
template = fs.readFileSync templateFile, encoding: '... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/base.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/base.coffee | 12 | 61 |
jianliaoim/talk-os:talk-account/server/mailers/base.coffee:1:completion | completion | class BaseMailer
from: '简聊 <notification@mail.jianliao.com>'
delay: 0
action: 'delay'
constructor: ->
@_getTemplate()
preview: (email = {}, callback = ->) ->
self = this
templateFile = path.join __dirname, "templates/#{@template}.html"
template = fs.readFileSync templateFile, encoding: '... | options =
cache: false
filename: filename
delimiter: '?'
try
html = ejs.render juiceTemplate, email, options
catch err
return callback err
callback null, html
_sendByRender: (email) ->
self = this
if email.html
return self._send email
@_render(email).the... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/base.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/base.coffee | 12 | 61 |
jianliaoim/talk-os:talk-account/server/mailers/base.coffee:2:raw_corpus | raw_corpus | return email
_email =
from: @from
to: email.to
subject: email.subject
html: email.html
action: @action
delay: @delay
id: email.id
return if process.env.DEBUG
mailguy.send _email
_render: (email) ->
options =
cache: true
filename: path.join __dirn... | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/base.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/base.coffee | 62 | 104 | ||
jianliaoim/talk-os:talk-account/server/mailers/base.coffee:2:completion | completion | return email
_email =
from: @from
to: email.to
subject: email.subject
html: email.html
action: @action
delay: @delay
id: email.id
return if process.env.DEBUG
mailguy.send _email
_render: (email) ->
options =
cache: true
filename: path.join __dirn... | Promise.resolve().then ->
email.html = ejs.render template, email, options
email
_cancel: (id) ->
# @osv
return id
mailguy.send action: 'cancel', id: id
_getTemplate: ->
unless @_template
templateFile = path.join __dirname, "templates/#{@template}.html"
template = fs.readFi... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/base.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/base.coffee | 62 | 104 |
alekseykulikov/backbone-offline:spec/lib/index_spec.coffee:1:raw_corpus | raw_corpus | describe 'Offline.Index', ->
beforeEach ->
localStorage.setItem('dreams', '2,3')
@dreams = new Dreams()
@storage = @dreams.storage
@records = new Offline.Index('dreams', @storage)
describe 'constructor', ->
it 'sets @name', -> expect(@records.name).toEqual('dreams')
it 'sets @values', -> ex... | CoffeeScript | alekseykulikov/backbone-offline | spec/lib/index_spec.coffee | MIT | 2db4d38dcbafe42fc8431e21a5838513feaad7a0 | 717 | https://github.com/alekseykulikov/backbone-offline/blob/2db4d38dcbafe42fc8431e21a5838513feaad7a0/spec/lib/index_spec.coffee | 1 | 24 | ||
alekseykulikov/backbone-offline:spec/lib/index_spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'Offline.Index', ->
beforeEach ->
localStorage.setItem('dreams', '2,3')
@dreams = new Dreams()
@storage = @dreams.storage
@records = new Offline.Index('dreams', @storage)
describe 'constructor', ->
it 'sets @name', -> expect(@rec... | describe('Offline.Index', function() {
beforeEach(function() {
localStorage.setItem('dreams', '2,3');
this.dreams = new Dreams();
this.storage = this.dreams.storage;
return this.records = new Offline.Index('dreams', this.storage);
});
describe('constructor', function() {
it('sets @name', funct... | CoffeeScript | JavaScript | alekseykulikov/backbone-offline | spec/lib/index_spec.coffee | MIT | 2db4d38dcbafe42fc8431e21a5838513feaad7a0 | 717 | https://github.com/alekseykulikov/backbone-offline/blob/2db4d38dcbafe42fc8431e21a5838513feaad7a0/spec/lib/index_spec.coffee | 1 | 24 |
alekseykulikov/backbone-offline:spec/lib/index_spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('Offline.Index', function() {
beforeEach(function() {
localStorage.setItem('dreams', '2,3');
this.dreams = new Dreams();
this.storage = this.dreams.storage;
return this.records = new Offline.Index('dreams', this.storage);
});
describe... | describe 'Offline.Index', ->
beforeEach ->
localStorage.setItem('dreams', '2,3')
@dreams = new Dreams()
@storage = @dreams.storage
@records = new Offline.Index('dreams', @storage)
describe 'constructor', ->
it 'sets @name', -> expect(@records.name).toEqual('dreams')
it 'sets @values', -> ex... | JavaScript | CoffeeScript | alekseykulikov/backbone-offline | spec/lib/index_spec.coffee | MIT | 2db4d38dcbafe42fc8431e21a5838513feaad7a0 | 717 | https://github.com/alekseykulikov/backbone-offline/blob/2db4d38dcbafe42fc8431e21a5838513feaad7a0/spec/lib/index_spec.coffee | 1 | 24 |
alekseykulikov/backbone-offline:spec/lib/index_spec.coffee:1:completion | completion | describe 'Offline.Index', ->
beforeEach ->
localStorage.setItem('dreams', '2,3')
@dreams = new Dreams()
@storage = @dreams.storage
@records = new Offline.Index('dreams', @storage)
describe 'constructor', ->
it 'sets @name', -> expect(@records.name).toEqual('dreams')
it 'sets @values', -> ex... | beforeEach -> @records.add('5')
it 'should add value in to the end of array', -> expect(@records.values).toEqual(['2', '3', '5'])
it "should rewrite localStorage's item", -> expect(localStorage.getItem 'dreams').toEqual('2,3,5')
it 'does not duplicate values', ->
@records.add('5')
expect(@recor... | CoffeeScript | CoffeeScript | alekseykulikov/backbone-offline | spec/lib/index_spec.coffee | MIT | 2db4d38dcbafe42fc8431e21a5838513feaad7a0 | 717 | https://github.com/alekseykulikov/backbone-offline/blob/2db4d38dcbafe42fc8431e21a5838513feaad7a0/spec/lib/index_spec.coffee | 1 | 24 |
jianliaoim/talk-os:talk-web/test/spec/actions/contact-prefs.spec.coffee:1:raw_corpus | raw_corpus | xdescribe 'Actions: contact-prefs', ->
beforeEach ->
@action = require 'actions/contact-prefs'
@api = require 'network/api'
describe 'Method: updateInTeam', ->
it 'should call api', ->
spyOn(@api.teams.prefs, 'put').and.callThrough()
teamId = 1
userId = 2
data = {}
confi... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/contact-prefs.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/contact-prefs.spec.coffee | 1 | 20 | ||
jianliaoim/talk-os:talk-web/test/spec/actions/contact-prefs.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
xdescribe 'Actions: contact-prefs', ->
beforeEach ->
@action = require 'actions/contact-prefs'
@api = require 'network/api'
describe 'Method: updateInTeam', ->
it 'should call api', ->
spyOn(@api.teams.prefs, 'put').and.callThrough()
... | xdescribe('Actions: contact-prefs', function() {
beforeEach(function() {
this.action = require('actions/contact-prefs');
return this.api = require('network/api');
});
return describe('Method: updateInTeam', function() {
return it('should call api', function() {
var config, data, teamId, userId;
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/test/spec/actions/contact-prefs.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/contact-prefs.spec.coffee | 1 | 20 |
jianliaoim/talk-os:talk-web/test/spec/actions/contact-prefs.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
xdescribe('Actions: contact-prefs', function() {
beforeEach(function() {
this.action = require('actions/contact-prefs');
return this.api = require('network/api');
});
return describe('Method: updateInTeam', function() {
return it('should call api'... | xdescribe 'Actions: contact-prefs', ->
beforeEach ->
@action = require 'actions/contact-prefs'
@api = require 'network/api'
describe 'Method: updateInTeam', ->
it 'should call api', ->
spyOn(@api.teams.prefs, 'put').and.callThrough()
teamId = 1
userId = 2
data = {}
confi... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/contact-prefs.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/contact-prefs.spec.coffee | 1 | 20 |
jianliaoim/talk-os:talk-web/test/spec/actions/contact-prefs.spec.coffee:1:completion | completion | xdescribe 'Actions: contact-prefs', ->
beforeEach ->
@action = require 'actions/contact-prefs'
@api = require 'network/api'
describe 'Method: updateInTeam', ->
it 'should call api', ->
spyOn(@api.teams.prefs, 'put').and.callThrough() | teamId = 1
userId = 2
data = {}
config =
pathParams:
id: teamId
data: data
@action.updateInTeam(teamId, userId, data)
expect(@api.teams.prefs.put).toHaveBeenCalledWith config | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/contact-prefs.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/contact-prefs.spec.coffee | 1 | 20 |
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:raw_corpus | raw_corpus | module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null
@controllerParticularElement = null
@attributesToChange = []
@hoveredAttribute = null | CoffeeScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Manager/HoverManager.coffee | 1 | 6 | ||
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null
@controllerParticularElement = null
@attributesToChange = []
@hoveredAttribute = null
``` | var HoverManager;
module.exports = HoverManager = class HoverManager {
constructor() {
this.hoveredParticularElement = null;
this.controllerParticularElement = null;
this.attributesToChange = [];
this.hoveredAttribute = null;
}
}; | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Manager/HoverManager.coffee | 1 | 6 |
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var HoverManager;
module.exports = HoverManager = class HoverManager {
constructor() {
this.hoveredParticularElement = null;
this.controllerParticularElement = null;
this.attributesToChange = [];
this.hoveredAttribute = null;
}
};
``` | module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null
@controllerParticularElement = null
@attributesToChange = []
@hoveredAttribute = null | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Manager/HoverManager.coffee | 1 | 6 |
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:completion | completion | module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null | @controllerParticularElement = null
@attributesToChange = []
@hoveredAttribute = null | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Manager/HoverManager.coffee | 1 | 6 |
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:raw_corpus | raw_corpus | module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null
@controllerParticularElement = null
@hoveredAttribute = null | CoffeeScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 96afaf946dfb297fe3b63c5395ffe416ae47b0aa | 1,052 | https://github.com/cdglabs/apparatus/blob/96afaf946dfb297fe3b63c5395ffe416ae47b0aa/src/View/Manager/HoverManager.coffee | 1 | 5 | ||
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null
@controllerParticularElement = null
@hoveredAttribute = null
``` | var HoverManager;
module.exports = HoverManager = class HoverManager {
constructor() {
this.hoveredParticularElement = null;
this.controllerParticularElement = null;
this.hoveredAttribute = null;
}
}; | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 96afaf946dfb297fe3b63c5395ffe416ae47b0aa | 1,052 | https://github.com/cdglabs/apparatus/blob/96afaf946dfb297fe3b63c5395ffe416ae47b0aa/src/View/Manager/HoverManager.coffee | 1 | 5 |
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var HoverManager;
module.exports = HoverManager = class HoverManager {
constructor() {
this.hoveredParticularElement = null;
this.controllerParticularElement = null;
this.hoveredAttribute = null;
}
};
``` | module.exports = class HoverManager
constructor: ->
@hoveredParticularElement = null
@controllerParticularElement = null
@hoveredAttribute = null | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 96afaf946dfb297fe3b63c5395ffe416ae47b0aa | 1,052 | https://github.com/cdglabs/apparatus/blob/96afaf946dfb297fe3b63c5395ffe416ae47b0aa/src/View/Manager/HoverManager.coffee | 1 | 5 |
cdglabs/apparatus:src/View/Manager/HoverManager.coffee:1:completion | completion | module.exports = class HoverManager
constructor: -> | @hoveredParticularElement = null
@controllerParticularElement = null
@hoveredAttribute = null | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Manager/HoverManager.coffee | MIT | 96afaf946dfb297fe3b63c5395ffe416ae47b0aa | 1,052 | https://github.com/cdglabs/apparatus/blob/96afaf946dfb297fe3b63c5395ffe416ae47b0aa/src/View/Manager/HoverManager.coffee | 1 | 5 |
jianliaoim/talk-os:talk-web/client/updater/contact-prefs.coffee:1:raw_corpus | raw_corpus | exports.push = (store, actionData) ->
_teamId = actionData.get('_teamId')
_contactId = actionData.get('_userId')
prefsData = actionData
.delete '_teamId'
.delete '_userId'
store.update 'contactPrefs', (cursor) ->
if cursor.getIn([_teamId, _contactId])?
cursor.updateIn [_teamId, _contactId], (pre... | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/contact-prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/contact-prefs.coffee | 1 | 25 | ||
jianliaoim/talk-os:talk-web/client/updater/contact-prefs.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.push = (store, actionData) ->
_teamId = actionData.get('_teamId')
_contactId = actionData.get('_userId')
prefsData = actionData
.delete '_teamId'
.delete '_userId'
store.update 'contactPrefs', (cursor) ->
if cursor.getIn([_teamId, _conta... | exports.push = function(store, actionData) {
var _contactId, _teamId, prefsData;
_teamId = actionData.get('_teamId');
_contactId = actionData.get('_userId');
prefsData = actionData.delete('_teamId').delete('_userId');
return store.update('contactPrefs', function(cursor) {
if (cursor.getIn([_teamId, _conta... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/contact-prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/contact-prefs.coffee | 1 | 25 |
jianliaoim/talk-os:talk-web/client/updater/contact-prefs.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.push = function(store, actionData) {
var _contactId, _teamId, prefsData;
_teamId = actionData.get('_teamId');
_contactId = actionData.get('_userId');
prefsData = actionData.delete('_teamId').delete('_userId');
return store.update('contactPrefs', f... | exports.push = (store, actionData) ->
_teamId = actionData.get('_teamId')
_contactId = actionData.get('_userId')
prefsData = actionData
.delete '_teamId'
.delete '_userId'
store.update 'contactPrefs', (cursor) ->
if cursor.getIn([_teamId, _contactId])?
cursor.updateIn [_teamId, _contactId], (pre... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/contact-prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/contact-prefs.coffee | 1 | 25 |
jianliaoim/talk-os:talk-web/client/updater/contact-prefs.coffee:1:completion | completion | exports.push = (store, actionData) ->
_teamId = actionData.get('_teamId')
_contactId = actionData.get('_userId')
prefsData = actionData
.delete '_teamId'
.delete '_userId'
store.update 'contactPrefs', (cursor) ->
if cursor.getIn([_teamId, _contactId])?
cursor.updateIn [_teamId, _contactId], (pre... | else cursor
# API is under namespace `team`, gets team object
exports.update = (store, actionData) ->
prefsData = actionData.get('resp').get('prefs')
_teamId = actionData.get('resp').get('_id')
_contactId = actionData.get('_userId')
store.update 'contactPrefs', (cursor) ->
if cursor.getIn([_teamId, _conta... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/contact-prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/contact-prefs.coffee | 1 | 25 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | class Directive
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | df2ae65cf72b2e625fb5eae80cbde4d76f047616 | 672 | https://github.com/CaryLandholt/AngularFun/blob/df2ae65cf72b2e625fb5eae80cbde4d76f047616/src/scripts/directives/tab.coffee | 1 | 20 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Directive
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'... | var Directive;
Directive = class Directive {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
replace: true,
require: '^appTabs',... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | df2ae65cf72b2e625fb5eae80cbde4d76f047616 | 672 | https://github.com/CaryLandholt/AngularFun/blob/df2ae65cf72b2e625fb5eae80cbde4d76f047616/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Directive;
Directive = class Directive {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
... | class Directive
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | df2ae65cf72b2e625fb5eae80cbde4d76f047616 | 672 | https://github.com/CaryLandholt/AngularFun/blob/df2ae65cf72b2e625fb5eae80cbde4d76f047616/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | class Directive
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true | require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
}
angular.module('app').directive 'appTab', ['$log', Directive] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | df2ae65cf72b2e625fb5eae80cbde4d76f047616 | 672 | https://github.com/CaryLandholt/AngularFun/blob/df2ae65cf72b2e625fb5eae80cbde4d76f047616/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | class Directive
constructor: (@$log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/ta... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 80aa978a56ae78b5eae38b5ba3211240f5379748 | 672 | https://github.com/CaryLandholt/AngularFun/blob/80aa978a56ae78b5eae38b5ba3211240f5379748/src/scripts/directives/tab.coffee | 1 | 20 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Directive
constructor: (@$log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@... | var Directive;
Directive = class Directive {
constructor($log) {
var link;
this.$log = $log;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
replace: true,
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 80aa978a56ae78b5eae38b5ba3211240f5379748 | 672 | https://github.com/CaryLandholt/AngularFun/blob/80aa978a56ae78b5eae38b5ba3211240f5379748/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Directive;
Directive = class Directive {
constructor($log) {
var link;
this.$log = $log;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
... | class Directive
constructor: (@$log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/ta... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 80aa978a56ae78b5eae38b5ba3211240f5379748 | 672 | https://github.com/CaryLandholt/AngularFun/blob/80aa978a56ae78b5eae38b5ba3211240f5379748/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | class Directive
constructor: (@$log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true | require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
}
angular.module('app').directive 'appTab', ['$log', Directive] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 80aa978a56ae78b5eae38b5ba3211240f5379748 | 672 | https://github.com/CaryLandholt/AngularFun/blob/80aa978a56ae78b5eae38b5ba3211240f5379748/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab.html'... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | cb59040b164996bca974f6142cab43e4482afc31 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cb59040b164996bca974f6142cab43e4482afc31/src/scripts/directives/tab.coffee | 1 | 20 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
s... | var Tab;
Tab = class Tab {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
replace: true,
require: '^appTabs',
restrict: '... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | cb59040b164996bca974f6142cab43e4482afc31 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cb59040b164996bca974f6142cab43e4482afc31/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Tab;
Tab = class Tab {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
repl... | class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab.html'... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | cb59040b164996bca974f6142cab43e4482afc31 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cb59040b164996bca974f6142cab43e4482afc31/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true | require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
selected: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
}
angular.module('app').directive 'appTab', ['$log', Tab] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | cb59040b164996bca974f6142cab43e4482afc31 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cb59040b164996bca974f6142cab43e4482afc31/src/scripts/directives/tab.coffee | 1 | 20 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: tr... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 8706e0902a4ed56a9ae0ca908e4b9a95e47954e9 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8706e0902a4ed56a9ae0ca908e4b9a95e47954e9/src/scripts/directives/tab.coffee | 1 | 19 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
te... | var Tab;
Tab = class Tab {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
replace: true,
require: '^appTabs',
restrict: '... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 8706e0902a4ed56a9ae0ca908e4b9a95e47954e9 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8706e0902a4ed56a9ae0ca908e4b9a95e47954e9/src/scripts/directives/tab.coffee | 1 | 19 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Tab;
Tab = class Tab {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
repl... | class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: tr... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 8706e0902a4ed56a9ae0ca908e4b9a95e47954e9 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8706e0902a4ed56a9ae0ca908e4b9a95e47954e9/src/scripts/directives/tab.coffee | 1 | 19 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@' | replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
}
angular.module('app').directive 'appTab', ['$log', Tab] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 8706e0902a4ed56a9ae0ca908e4b9a95e47954e9 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8706e0902a4ed56a9ae0ca908e4b9a95e47954e9/src/scripts/directives/tab.coffee | 1 | 19 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | c8848363eb83958fd323cfdf2442c0831d53d985 | 672 | https://github.com/CaryLandholt/AngularFun/blob/c8848363eb83958fd323cfdf2442c0831d53d985/src/scripts/directives/tab.coffee | 1 | 22 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
rest... | (function(angular) {
'use strict';
var Tab;
Tab = class Tab {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
locals: {
transcluded: '@'
},
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | c8848363eb83958fd323cfdf2442c0831d53d985 | 672 | https://github.com/CaryLandholt/AngularFun/blob/c8848363eb83958fd323cfdf2442c0831d53d985/src/scripts/directives/tab.coffee | 1 | 22 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function(angular) {
'use strict';
var Tab;
Tab = class Tab {
constructor($log) {
var link;
link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link,
... | do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | c8848363eb83958fd323cfdf2442c0831d53d985 | 672 | https://github.com/CaryLandholt/AngularFun/blob/c8848363eb83958fd323cfdf2442c0831d53d985/src/scripts/directives/tab.coffee | 1 | 22 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link
locals: | transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
}
angular.module('app').directive 'appTab', ['$log', Tab] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | c8848363eb83958fd323cfdf2442c0831d53d985 | 672 | https://github.com/CaryLandholt/AngularFun/blob/c8848363eb83958fd323cfdf2442c0831d53d985/src/scripts/directives/tab.coffee | 1 | 22 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
Tab::link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link: Tab::link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 84cd4633279ad391623504698a20ed4b5560dc77 | 672 | https://github.com/CaryLandholt/AngularFun/blob/84cd4633279ad391623504698a20ed4b5560dc77/src/scripts/directives/tab.coffee | 1 | 22 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
Tab::link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link: Tab::link
locals:
transcluded: '@'
replace: true
require: '^a... | (function(angular) {
'use strict';
var Tab;
Tab = class Tab {
constructor($log) {
Tab.prototype.link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link: Tab.prototype.link,
locals: {
transcluded: '@... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 84cd4633279ad391623504698a20ed4b5560dc77 | 672 | https://github.com/CaryLandholt/AngularFun/blob/84cd4633279ad391623504698a20ed4b5560dc77/src/scripts/directives/tab.coffee | 1 | 22 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function(angular) {
'use strict';
var Tab;
Tab = class Tab {
constructor($log) {
Tab.prototype.link = function(scope, element, attrs, controller) {
return controller.addTab(scope, attrs.tabId);
};
return {
link: Tab.prot... | do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
Tab::link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link: Tab::link
locals:
transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 84cd4633279ad391623504698a20ed4b5560dc77 | 672 | https://github.com/CaryLandholt/AngularFun/blob/84cd4633279ad391623504698a20ed4b5560dc77/src/scripts/directives/tab.coffee | 1 | 22 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | do (angular) ->
'use strict'
class Tab
constructor: ($log) ->
Tab::link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
return {
link: Tab::link
locals: | transcluded: '@'
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
}
angular.module('app').directive 'appTab', ['$log', Tab] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 84cd4633279ad391623504698a20ed4b5560dc77 | 672 | https://github.com/CaryLandholt/AngularFun/blob/84cd4633279ad391623504698a20ed4b5560dc77/src/scripts/directives/tab.coffee | 1 | 22 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | angular.module('app').directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
] | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a | 672 | https://github.com/CaryLandholt/AngularFun/blob/11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a/src/scripts/directives/tab.coffee | 1 | 13 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
angular.module('app').directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directi... | angular.module('app').directive('appTab', [
'$log',
function($log) {
var link;
link = function(scope,
element,
attrs,
controller) {
return controller.addTab(scope,
attrs.tabId);
};
return {
link: link,
replace: true,
require: '^appTabs',
restrict: 'E',
sco... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a | 672 | https://github.com/CaryLandholt/AngularFun/blob/11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a/src/scripts/directives/tab.coffee | 1 | 13 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
angular.module('app').directive('appTab', [
'$log',
function($log) {
var link;
link = function(scope,
element,
attrs,
controller) {
return controller.addTab(scope,
attrs.tabId);
};
return {
link: link,
replace: true,
... | angular.module('app').directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
] | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a | 672 | https://github.com/CaryLandholt/AngularFun/blob/11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a/src/scripts/directives/tab.coffee | 1 | 13 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | angular.module('app').directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true | require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
templateUrl: '/views/directives/tab.html'
transclude: true
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a | 672 | https://github.com/CaryLandholt/AngularFun/blob/11f7ec9a2dd166a2f8c3cd0a3fdbd8787e549c6a/src/scripts/directives/tab.coffee | 1 | 13 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 6d23f0be02cb2e938565aca7cb881fd70beefb35 | 672 | https://github.com/CaryLandholt/AngularFun/blob/6d23f0be02cb2e938565aca7cb881fd70beefb35/src/scripts/directives/tab.coffee | 1 | 18 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
con... | /*global define*/
define(['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], function(directives, template) {
'use strict';
return directives.directive('appTab', [
'$log',
function($log) {
var link;
link = function(scope,
element,
attrs,
controlle... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 6d23f0be02cb2e938565aca7cb881fd70beefb35 | 672 | https://github.com/CaryLandholt/AngularFun/blob/6d23f0be02cb2e938565aca7cb881fd70beefb35/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], function(directives, template) {
'use strict';
return directives.directive('appTab', [
'$log',
function($log) {
var link;
link ... | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 6d23f0be02cb2e938565aca7cb881fd70beefb35 | 672 | https://github.com/CaryLandholt/AngularFun/blob/6d23f0be02cb2e938565aca7cb881fd70beefb35/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', ['$log', ($log) ->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId | link: link
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
template: template
transclude: true
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 6d23f0be02cb2e938565aca7cb881fd70beefb35 | 672 | https://github.com/CaryLandholt/AngularFun/blob/6d23f0be02cb2e938565aca7cb881fd70beefb35/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', [->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
requir... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 61809b666e1417494a191ce9e486c510a393c08c | 672 | https://github.com/CaryLandholt/AngularFun/blob/61809b666e1417494a191ce9e486c510a393c08c/src/scripts/directives/tab.coffee | 1 | 18 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', [->
link = (scope, element, attrs, controller) ->
controller.addTab ... | /*global define*/
define(['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], function(directives, template) {
'use strict';
return directives.directive('appTab', [
function() {
var link;
link = function(scope,
element,
attrs,
controller) {
ret... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 61809b666e1417494a191ce9e486c510a393c08c | 672 | https://github.com/CaryLandholt/AngularFun/blob/61809b666e1417494a191ce9e486c510a393c08c/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], function(directives, template) {
'use strict';
return directives.directive('appTab', [
function() {
var link;
link = function(scope... | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', [->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
requir... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 61809b666e1417494a191ce9e486c510a393c08c | 672 | https://github.com/CaryLandholt/AngularFun/blob/61809b666e1417494a191ce9e486c510a393c08c/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'appTab', [->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId | link: link
replace: true
require: '^appTabs'
restrict: 'E'
scope:
caption: '@'
template: template
transclude: true
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 61809b666e1417494a191ce9e486c510a393c08c | 672 | https://github.com/CaryLandholt/AngularFun/blob/61809b666e1417494a191ce9e486c510a393c08c/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'tab', [->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
require: ... | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 40af64763cd5cebc9510a380437d7fef9ccc1c66 | 672 | https://github.com/CaryLandholt/AngularFun/blob/40af64763cd5cebc9510a380437d7fef9ccc1c66/src/scripts/directives/tab.coffee | 1 | 18 | ||
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'tab', [->
link = (scope, element, attrs, controller) ->
controller.addTab sco... | /*global define*/
define(['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], function(directives, template) {
'use strict';
return directives.directive('tab', [
function() {
var link;
link = function(scope,
element,
attrs,
controller) {
return... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 40af64763cd5cebc9510a380437d7fef9ccc1c66 | 672 | https://github.com/CaryLandholt/AngularFun/blob/40af64763cd5cebc9510a380437d7fef9ccc1c66/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], function(directives, template) {
'use strict';
return directives.directive('tab', [
function() {
var link;
link = function(scope,
... | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'tab', [->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId
link: link
replace: true
require: ... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 40af64763cd5cebc9510a380437d7fef9ccc1c66 | 672 | https://github.com/CaryLandholt/AngularFun/blob/40af64763cd5cebc9510a380437d7fef9ccc1c66/src/scripts/directives/tab.coffee | 1 | 18 |
CaryLandholt/AngularFun:src/scripts/directives/tab.coffee:1:completion | completion | ###global define###
define ['directives/directives', 'libs/text!directives/templates/tab.html', 'directives/tabs'], (directives, template) ->
'use strict'
directives.directive 'tab', [->
link = (scope, element, attrs, controller) ->
controller.addTab scope, attrs.tabId | link: link
replace: true
require: '^tabs'
restrict: 'E'
scope:
caption: '@'
template: template
transclude: true
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | src/scripts/directives/tab.coffee | MIT | 40af64763cd5cebc9510a380437d7fef9ccc1c66 | 672 | https://github.com/CaryLandholt/AngularFun/blob/40af64763cd5cebc9510a380437d7fef9ccc1c66/src/scripts/directives/tab.coffee | 1 | 18 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
path = require 'path'
gulp = require 'gulp'
gutil = require 'gulp-util'
config = require 'config'
webpack = require 'webpack'
sequence = require 'run-sequence'
WebpackDevServer = require 'webpack-dev-server'
env = process.env.NODE_ENV
gulp.task 'html', (cb) ->
template = require './entry/template'... | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 1 | 44 | ||
jianliaoim/talk-os:talk-web/gulpfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
path = require 'path'
gulp = require 'gulp'
gutil = require 'gulp-util'
config = require 'config'
webpack = require 'webpack'
sequence = require 'run-sequence'
WebpackDevServer = require 'webpack-dev-server'
env = process.env.NODE_ENV
gulp.tas... | var WebpackDevServer, config, env, fs, gulp, gutil, path, sequence, webpack;
fs = require('fs');
path = require('path');
gulp = require('gulp');
gutil = require('gulp-util');
config = require('config');
webpack = require('webpack');
sequence = require('run-sequence');
WebpackDevServer = require('webpack-dev-ser... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 1 | 44 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var WebpackDevServer, config, env, fs, gulp, gutil, path, sequence, webpack;
fs = require('fs');
path = require('path');
gulp = require('gulp');
gutil = require('gulp-util');
config = require('config');
webpack = require('webpack');
sequence = require('run-s... | fs = require 'fs'
path = require 'path'
gulp = require 'gulp'
gutil = require 'gulp-util'
config = require 'config'
webpack = require 'webpack'
sequence = require 'run-sequence'
WebpackDevServer = require 'webpack-dev-server'
env = process.env.NODE_ENV
gulp.task 'html', (cb) ->
template = require './entry/template'... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 1 | 44 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:1:completion | completion | fs = require 'fs'
path = require 'path'
gulp = require 'gulp'
gutil = require 'gulp-util'
config = require 'config'
webpack = require 'webpack'
sequence = require 'run-sequence'
WebpackDevServer = require 'webpack-dev-server'
env = process.env.NODE_ENV
gulp.task 'html', (cb) ->
template = require './entry/template'... | # Webpack tasks
gulp.task 'webpack-dev', (cb) ->
webpackDev = require './packing/webpack-dev'
webpackServer =
publicPath: '/'
hot: true
stats:
colors: true
info =
__dirname: __dirname
env: env
compiler = webpack (webpackDev info)
server = new WebpackDevServer compiler, webpackServe... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 1 | 44 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:2:raw_corpus | raw_corpus | gulp.task 'webpack-build', (cb) ->
webpackBuild = require './packing/webpack-build'
info =
__dirname: __dirname
isMinified: config.isMinified
isProduction: config.isProduction
useCDN: config.useCDN
cdn: config.cdn
env: env
webpack (webpackBuild info), (err, stats) ->
if err
throw... | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 46 | 86 | ||
jianliaoim/talk-os:talk-web/gulpfile.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
gulp.task 'webpack-build', (cb) ->
webpackBuild = require './packing/webpack-build'
info =
__dirname: __dirname
isMinified: config.isMinified
isProduction: config.isProduction
useCDN: config.useCDN
cdn: config.cdn
env: env
webpack (w... | gulp.task('webpack-build', function(cb) {
var info, webpackBuild;
webpackBuild = require('./packing/webpack-build');
info = {
__dirname: __dirname,
isMinified: config.isMinified,
isProduction: config.isProduction,
useCDN: config.useCDN,
cdn: config.cdn,
env: env
};
return webpack(webpa... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 46 | 86 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
gulp.task('webpack-build', function(cb) {
var info, webpackBuild;
webpackBuild = require('./packing/webpack-build');
info = {
__dirname: __dirname,
isMinified: config.isMinified,
isProduction: config.isProduction,
useCDN: config.useCDN,
cd... | gulp.task 'webpack-build', (cb) ->
webpackBuild = require './packing/webpack-build'
info =
__dirname: __dirname
isMinified: config.isMinified
isProduction: config.isProduction
useCDN: config.useCDN
cdn: config.cdn
env: env
webpack (webpackBuild info), (err, stats) ->
if err
throw... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 46 | 86 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:2:completion | completion | gulp.task 'webpack-build', (cb) ->
webpackBuild = require './packing/webpack-build'
info =
__dirname: __dirname
isMinified: config.isMinified
isProduction: config.isProduction
useCDN: config.useCDN
cdn: config.cdn
env: env
webpack (webpackBuild info), (err, stats) ->
if err
throw... | publicPath: '/'
hot: true
stats:
colors: true
compiler = webpack config
server = new WebpackDevServer compiler, webpackServer
server.listen 9000, 'localhost', (err) ->
if err?
throw new gutil.PluginError("webpack-dev-server", err)
gutil.log "[webpack-dev-server] is listening"
cb()... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 46 | 86 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:3:raw_corpus | raw_corpus | # CDN
gulp.task 'cdn', (cb) ->
filelog = require 'gulp-filelog'
upyunDest = require('gulp-upyun').upyunDest
configFile = path.join __dirname, 'upyun-config.coffee'
unless fs.existsSync(configFile)
gutil.log gutil.colors.red("Error: Need upyun config file!")
process.exit(1)
options = require './upyun... | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 88 | 123 | ||
jianliaoim/talk-os:talk-web/gulpfile.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# CDN
gulp.task 'cdn', (cb) ->
filelog = require 'gulp-filelog'
upyunDest = require('gulp-upyun').upyunDest
configFile = path.join __dirname, 'upyun-config.coffee'
unless fs.existsSync(configFile)
gutil.log gutil.colors.red("Error: Need upyun config... | // CDN
gulp.task('cdn', function(cb) {
var configFile, filelog, options, upyunDest;
filelog = require('gulp-filelog');
upyunDest = require('gulp-upyun').upyunDest;
configFile = path.join(__dirname, 'upyun-config.coffee');
if (!fs.existsSync(configFile)) {
gutil.log(gutil.colors.red("Error: Need upyun conf... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 88 | 123 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// CDN
gulp.task('cdn', function(cb) {
var configFile, filelog, options, upyunDest;
filelog = require('gulp-filelog');
upyunDest = require('gulp-upyun').upyunDest;
configFile = path.join(__dirname, 'upyun-config.coffee');
if (!fs.existsSync(configFile)) {... | # CDN
gulp.task 'cdn', (cb) ->
filelog = require 'gulp-filelog'
upyunDest = require('gulp-upyun').upyunDest
configFile = path.join __dirname, 'upyun-config.coffee'
unless fs.existsSync(configFile)
gutil.log gutil.colors.red("Error: Need upyun config file!")
process.exit(1)
options = require './upyun... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 88 | 123 |
jianliaoim/talk-os:talk-web/gulpfile.coffee:3:completion | completion | # CDN
gulp.task 'cdn', (cb) ->
filelog = require 'gulp-filelog'
upyunDest = require('gulp-upyun').upyunDest
configFile = path.join __dirname, 'upyun-config.coffee'
unless fs.existsSync(configFile)
gutil.log gutil.colors.red("Error: Need upyun config file!")
process.exit(1)
options = require './upyun... | gulp.task 'lint', ->
coffeelint = require 'gulp-coffeelint'
gulpFilter = require 'gulp-filter'
filter = gulpFilter ['**', '!**/en.coffee', '!**/zh.coffee', '!**/zh-tw.coffee',
"!**/module/icons.coffee"
]
gulp.src('./client/**/*.coffee')
.pipe filter
.pipe coffeelint
max_line_length: {value: 160}... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/gulpfile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/gulpfile.coffee | 88 | 123 |
soulwire/Coffee-Physics:source/behaviour/EdgeBounce.coffee:1:raw_corpus | raw_corpus | ### Edge Bounce Behaviour ###
class EdgeBounce extends Behaviour
constructor: (@min = new Vector(), @max = new Vector()) ->
super
apply: (p, dt, index) ->
#super p, dt, index
if p.pos.x - p.radius < @min.x
p.pos.x = @min.x + p.radius
else if p.pos.x + p.radius > @max.x
p.pos.x = @max.x - p.radi... | CoffeeScript | soulwire/Coffee-Physics | source/behaviour/EdgeBounce.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/behaviour/EdgeBounce.coffee | 1 | 27 | ||
soulwire/Coffee-Physics:source/behaviour/EdgeBounce.coffee:1:completion | completion | ### Edge Bounce Behaviour ###
class EdgeBounce extends Behaviour
constructor: (@min = new Vector(), @max = new Vector()) ->
super
apply: (p, dt, index) ->
#super p, dt, index
if p.pos.x - p.radius < @min.x | p.pos.x = @min.x + p.radius
else if p.pos.x + p.radius > @max.x
p.pos.x = @max.x - p.radius
if p.pos.y - p.radius < @min.y
p.pos.y = @min.y + p.radius
else if p.pos.y + p.radius > @max.y
p.pos.y = @max.y - p.radius | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/behaviour/EdgeBounce.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/behaviour/EdgeBounce.coffee | 1 | 27 |
buttercoin/buttercoin:lib/disruptor/ring_buffer.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
module.exports = class RingBuffer
###
# Create a RingBuffer which pre-allocates a storage array with a given capacity
#
# @param {number} @capacity - the size of the ring buffer to allocate. MUST BE A POWER OF 2!!!
# @return {object} a new RingBuffer instance
###
constructor: (@... | CoffeeScript | buttercoin/buttercoin | lib/disruptor/ring_buffer.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/ring_buffer.coffee | 1 | 50 | ||
buttercoin/buttercoin:lib/disruptor/ring_buffer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
module.exports = class RingBuffer
###
# Create a RingBuffer which pre-allocates a storage array with a given capacity
#
# @param {number} @capacity - the size of the ring buffer to allocate. MUST BE A POWER OF 2!!!
# @return {... | var RingBuffer, assert;
assert = require('assert');
module.exports = RingBuffer = class RingBuffer {
/*
* Create a RingBuffer which pre-allocates a storage array with a given capacity
*
* @param {number} @capacity - the size of the ring buffer to allocate. MUST BE A POWER OF 2!!!
* @return {object} a ne... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/disruptor/ring_buffer.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/ring_buffer.coffee | 1 | 50 |
buttercoin/buttercoin:lib/disruptor/ring_buffer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var RingBuffer, assert;
assert = require('assert');
module.exports = RingBuffer = class RingBuffer {
/*
* Create a RingBuffer which pre-allocates a storage array with a given capacity
*
* @param {number} @capacity - the size of the ring buffer to alloc... | assert = require 'assert'
module.exports = class RingBuffer
###
# Create a RingBuffer which pre-allocates a storage array with a given capacity
#
# @param {number} @capacity - the size of the ring buffer to allocate. MUST BE A POWER OF 2!!!
# @return {object} a new RingBuffer instance
###
constructor: (@... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/disruptor/ring_buffer.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/ring_buffer.coffee | 1 | 50 |
buttercoin/buttercoin:lib/disruptor/ring_buffer.coffee:1:completion | completion | assert = require 'assert'
module.exports = class RingBuffer
###
# Create a RingBuffer which pre-allocates a storage array with a given capacity
#
# @param {number} @capacity - the size of the ring buffer to allocate. MUST BE A POWER OF 2!!!
# @return {object} a new RingBuffer instance
###
constructor: (@... | # the sequence counter of the ring buffer.
###
claim: ->
# TODO - take a callback and block the producer if the buffer is full?
idx = @next & @capacityMask # bitmask modulo
nxt = @next # copy for lambda capture
@next += 1
(value) => # TODO - support multiple producer... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/disruptor/ring_buffer.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/ring_buffer.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/updater/group.coffee:1:raw_corpus | raw_corpus | exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
groups = actionData.get('groups')
if store.hasIn ['groups', _teamId]
store.mergeIn ['groups', _teamId], groups
else
store.setIn ['groups', _teamId], groups
exports.create = (store, actionData) ->
_teamId = actionData.get('_tea... | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/group.coffee | 1 | 37 | ||
jianliaoim/talk-os:talk-web/client/updater/group.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
groups = actionData.get('groups')
if store.hasIn ['groups', _teamId]
store.mergeIn ['groups', _teamId], groups
else
store.setIn ['groups', _teamId], groups
exports.create ... | exports.read = function(store, actionData) {
var _teamId, groups;
_teamId = actionData.get('_teamId');
groups = actionData.get('groups');
if (store.hasIn(['groups', _teamId])) {
return store.mergeIn(['groups', _teamId], groups);
} else {
return store.setIn(['groups', _teamId], groups);
}
};
exports... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/group.coffee | 1 | 37 |
jianliaoim/talk-os:talk-web/client/updater/group.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.read = function(store, actionData) {
var _teamId, groups;
_teamId = actionData.get('_teamId');
groups = actionData.get('groups');
if (store.hasIn(['groups', _teamId])) {
return store.mergeIn(['groups', _teamId], groups);
} else {
return st... | exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
groups = actionData.get('groups')
if store.hasIn ['groups', _teamId]
store.mergeIn ['groups', _teamId], groups
else
store.setIn ['groups', _teamId], groups
exports.create = (store, actionData) ->
_teamId = actionData.get('_tea... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/group.coffee | 1 | 37 |
jianliaoim/talk-os:talk-web/client/updater/group.coffee:1:completion | completion | exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
groups = actionData.get('groups')
if store.hasIn ['groups', _teamId]
store.mergeIn ['groups', _teamId], groups
else
store.setIn ['groups', _teamId], groups
exports.create = (store, actionData) ->
_teamId = actionData.get('_tea... | _teamId = actionData.get('_teamId')
_groupId = actionData.get('_id')
store
.updateIn ['groups', _teamId], (groups) ->
groups.map (group) ->
if group.get('_id') is _groupId
group.merge actionData
else
group
exports.remove = (store, actionData) ->
_teamId = actionData.get('_teamI... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/group.coffee | 1 | 37 |
jianliaoim/talk-os:talk-account/client/util/detect.coffee:1:raw_corpus | raw_corpus | # Refer: http://emailregex.com/
emailRegExp = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i
mobileRegExp = /^[\+]?[\(]?\d*[\)]?[-. ]?\d*[-. ]?\d*[-. ]?\d*$/
exports.isEmail = (str) ->
emailRegExp.test str
exports.isMobile = (str) ->
mobileRegExp.test(str)
exports.isValidPassword = (str) ->
str.length >=... | CoffeeScript | jianliaoim/talk-os | talk-account/client/util/detect.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/detect.coffee | 1 | 31 | ||
jianliaoim/talk-os:talk-account/client/util/detect.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Refer: http://emailregex.com/
emailRegExp = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i
mobileRegExp = /^[\+]?[\(]?\d*[\)]?[-. ]?\d*[-. ]?\d*[-. ]?\d*$/
exports.isEmail = (str) ->
emailRegExp.test str
exports.isMobile = (str) ->
mobileRegExp.test... | // Refer: http://emailregex.com/
var emailRegExp, mobileRegExp, qqEmailRegExp;
emailRegExp = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i;
mobileRegExp = /^[\+]?[\(]?\d*[\)]?[-. ]?\d*[-. ]?\d*[-. ]?\d*$/;
exports.isEmail = function(str) {
return emailRegExp.test(str);
};
exports.isMobile = function(str) {
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/util/detect.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/detect.coffee | 1 | 31 |
jianliaoim/talk-os:talk-account/client/util/detect.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Refer: http://emailregex.com/
var emailRegExp, mobileRegExp, qqEmailRegExp;
emailRegExp = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i;
mobileRegExp = /^[\+]?[\(]?\d*[\)]?[-. ]?\d*[-. ]?\d*[-. ]?\d*$/;
exports.isEmail = function(str) {
return emailRe... | # Refer: http://emailregex.com/
emailRegExp = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i
mobileRegExp = /^[\+]?[\(]?\d*[\)]?[-. ]?\d*[-. ]?\d*[-. ]?\d*$/
exports.isEmail = (str) ->
emailRegExp.test str
exports.isMobile = (str) ->
mobileRegExp.test(str)
exports.isValidPassword = (str) ->
str.length >=... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/util/detect.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/detect.coffee | 1 | 31 |
jianliaoim/talk-os:talk-account/client/util/detect.coffee:1:completion | completion | # Refer: http://emailregex.com/
emailRegExp = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i
mobileRegExp = /^[\+]?[\(]?\d*[\)]?[-. ]?\d*[-. ]?\d*[-. ]?\d*$/
exports.isEmail = (str) ->
emailRegExp.test str
exports.isMobile = (str) ->
mobileRegExp.test(str)
exports.isValidPassword = (str) ->
str.length >=... | reg =
switch country
when 'cn' then /^\d{3}[-. ]?\d{4}[-. ]?\d{4}$/g
when 'hk' then /^\d{4}[-. ]?\d{4}$/g
when 'tw' then /^\d{3,4}[-. ]?\d{3}[-. ]?\d{3}$/g
when 'jp' then /^\d{3,4}[-. ]?\d{4}[-. ]?\d{4}$/g
when 'usa' then /^[\(]?\d{3}[\)]?[-. ]?\d{3}[-. ]?\d{4}$/g
else /^[\+]?[\(... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/util/detect.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/detect.coffee | 1 | 31 |
AriaMinaei/pretty-error:test/pretty-error.spec.coffee:3:raw_corpus | raw_corpus | console.log p.render e4, no
e5 =
message: "Error with custom stack"
stack: ['line one', 'line two']
wrapper: 'UnhandledRejection'
console.log p.render e5, no
e6 = error -> PrettyError.someNonExistingFuncion()
console.log p.render e6, no
describe "start()", ->
prepareStackTrace = null
b... | CoffeeScript | AriaMinaei/pretty-error | test/pretty-error.spec.coffee | MIT | 30203aadf8768f0803d170bf21e0fa78671b23f8 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/30203aadf8768f0803d170bf21e0fa78671b23f8/test/pretty-error.spec.coffee | 60 | 100 | ||
AriaMinaei/pretty-error:test/pretty-error.spec.coffee:3:completion | completion | console.log p.render e4, no
e5 =
message: "Error with custom stack"
stack: ['line one', 'line two']
wrapper: 'UnhandledRejection'
console.log p.render e5, no
e6 = error -> PrettyError.someNonExistingFuncion()
console.log p.render e6, no
describe "start()", ->
prepareStackTrace = null
b... | Error.prepareStackTrace = prepareStackTrace
it "throws unformatted error when not started", ->
try
throw new Error "foo bar"
catch exc
isFormatted(exc).should.be.eql false
it "throws formatted the error", ->
PrettyError.start()
try
throw new Error "foo bar"
catch exc
isFormatted(ex... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | test/pretty-error.spec.coffee | MIT | 30203aadf8768f0803d170bf21e0fa78671b23f8 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/30203aadf8768f0803d170bf21e0fa78671b23f8/test/pretty-error.spec.coffee | 60 | 100 |
AriaMinaei/pretty-error:test/pretty-error.spec.coffee:3:raw_corpus | raw_corpus | console.log p.render e4, no
e5 =
message: "Error with custom stack"
stack: ['line one', 'line two']
wrapper: 'UnhandledRejection'
console.log p.render e5, no
e6 = error -> PrettyError.someNonExistingFuncion()
console.log p.render e6, no
describe "start()", ->
it "throws unformatted error ... | CoffeeScript | AriaMinaei/pretty-error | test/pretty-error.spec.coffee | MIT | 435bd1d5d4def111e174c9cfc756d8aeba09df6a | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/435bd1d5d4def111e174c9cfc756d8aeba09df6a/test/pretty-error.spec.coffee | 60 | 88 | ||
AriaMinaei/pretty-error:test/pretty-error.spec.coffee:3:completion | completion | console.log p.render e4, no
e5 =
message: "Error with custom stack"
stack: ['line one', 'line two']
wrapper: 'UnhandledRejection'
console.log p.render e5, no
e6 = error -> PrettyError.someNonExistingFuncion()
console.log p.render e6, no
describe "start()", ->
it "throws unformatted error ... | try
throw new Error "foo bar"
catch exc
isFormatted(exc).should.be.eql false
it "throws formatted the error", ->
PrettyError.start()
try
throw new Error "foo bar"
catch exc
isFormatted(exc).should.be.eql true
PrettyError.stop() | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | test/pretty-error.spec.coffee | MIT | 435bd1d5d4def111e174c9cfc756d8aeba09df6a | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/435bd1d5d4def111e174c9cfc756d8aeba09df6a/test/pretty-error.spec.coffee | 60 | 88 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/controller.dashboardHistory.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/controller.dashboardHistory.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/mgmt/controller.dashboardHistory.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/controller.dashboardHistory.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | dashboardService.getDashboard($scope.dashboardName).then (dashboard) ->
$scope.dashboard = dashboard
dashboardService.getRevisions($scope.dashboardName).then (revisions) ->
$scope.revisions = revisions
$scope.revisionsCount = revisions.length
$scope.diffWithLatest = (rev) ->
# D... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/controller.dashboardHistory.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/mgmt/controller.dashboardHistory.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.