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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mauricemach/coffeekup:test.coffee:1:completion | completion | render = require('coffeekup').render
exports.run = ->
test 'Literal text', ->
'Just text' is render ->
text 'Just text'
test 'Default DOCTYPE', ->
'<!DOCTYPE html>' is render ->
doctype()
test 'DOCTYPE', ->
'<?xml version="1.0" encoding="utf-8" ?>' is render ->
doctype 'xml'
te... | a href: '/', title: 'Home'
test 'HereDocs', ->
"<script>$(document).ready(function(){\n alert('test');\n});</script>" is render ->
script """
$(document).ready(function(){
alert('test');
});
"""
test 'CoffeeScript', ->
"<script>$(document).ready(function() {\n ... | CoffeeScript | CoffeeScript | mauricemach/coffeekup | test.coffee | MIT | 503d7d9371e28d42008ad988d36cf76cdc8a46b2 | 1,245 | https://github.com/mauricemach/coffeekup/blob/503d7d9371e28d42008ad988d36cf76cdc8a46b2/test.coffee | 1 | 50 |
mauricemach/coffeekup:test.coffee:2:raw_corpus | raw_corpus | tests.push name
print "Testing \"#{name}\"... "
try
if code()
passed.push name
puts "[OK]"
else
failed.push name
puts "[Failed]"
catch ex
errors.push name
puts "[Error] (#{ex.message})" | CoffeeScript | mauricemach/coffeekup | test.coffee | MIT | 503d7d9371e28d42008ad988d36cf76cdc8a46b2 | 1,245 | https://github.com/mauricemach/coffeekup/blob/503d7d9371e28d42008ad988d36cf76cdc8a46b2/test.coffee | 51 | 62 | ||
mauricemach/coffeekup:test.coffee:2:completion | completion | tests.push name
print "Testing \"#{name}\"... "
try
if code()
passed.push name
puts "[OK]" | else
failed.push name
puts "[Failed]"
catch ex
errors.push name
puts "[Error] (#{ex.message})" | CoffeeScript | CoffeeScript | mauricemach/coffeekup | test.coffee | MIT | 503d7d9371e28d42008ad988d36cf76cdc8a46b2 | 1,245 | https://github.com/mauricemach/coffeekup/blob/503d7d9371e28d42008ad988d36cf76cdc8a46b2/test.coffee | 51 | 62 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.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/common/directives/directives.spinjs.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 1 | 40 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.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 ... | link: (scope, element, attrs) ->
elementWidth = $(element).parent().width()
if elementWidth < 300
radius = elementWidth / 10.0
length = radius * 0.666
else
# Max dimensions
radius = 30
length = 20
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee:2:raw_corpus | raw_corpus | # The radius of the inner circle
radius: radius
# Corner roundness (0..1)
corners: 1
# The rotation offset
rotate: 0
# 1: clockwise, -1: counterclockwise
direction: 1
color: '#888'
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 42 | 84 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee:2:completion | completion | # The radius of the inner circle
radius: radius
# Corner roundness (0..1)
corners: 1
# The rotation offset
rotate: 0
# 1: clockwise, -1: counterclockwise
direction: 1
color: '#888'
... | # Whether to use hardware acceleration
hwaccel: false
# The CSS class to assign to the spinner
className: 'spinner'
# The z-index (defaults to 2000000000)
zIndex: 9000
# Position relative to parent in px
t... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 42 | 84 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 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/common/directives/directives.spinjs.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 1 | 40 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 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 ... | link: (scope, element, attrs) ->
elementWidth = $(element).parent().width()
if elementWidth < 300
radius = elementWidth / 10.0
length = radius * 0.666
else
# Max dimensions
radius = 30
length = 20
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee:2:raw_corpus | raw_corpus | # The radius of the inner circle
radius: radius
# Corner roundness (0..1)
corners: 1
# The rotation offset
rotate: 0
# 1: clockwise, -1: counterclockwise
direction: 1
color: '#888'
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 42 | 84 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee:2:completion | completion | # The radius of the inner circle
radius: radius
# Corner roundness (0..1)
corners: 1
# The rotation offset
rotate: 0
# 1: clockwise, -1: counterclockwise
direction: 1
color: '#888'
... | # Whether to use hardware acceleration
hwaccel: false
# The CSS class to assign to the spinner
className: 'spinner'
# The z-index (defaults to 2000000000)
zIndex: 2e9
# Position relative to parent in px
to... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/directives/directives.spinjs.coffee | 42 | 84 |
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'inte-webhook'
mixins: [
LinkedStateMixin
mixinCreateTopic, mixinInteHandler
PureRenderMixin
]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
onPageBack: T.func.isRequired
inte: T.object
settings: T.obj... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 25 | 74 | ||
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'inte-webhook'
mixins: [
LinkedStateMixin
mixinCreateTopic, mixinInteHandler
PureRenderMixin
]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
onPageBack: T.f... | module.exports = React.createClass({
displayName: 'inte-webhook',
mixins: [LinkedStateMixin, mixinCreateTopic, mixinInteHandler, PureRenderMixin],
propTypes: {
_teamId: T.string.isRequired,
_roomId: T.string.isRequired,
onPageBack: T.func.isRequired,
inte: T.object,
settings: T.object.isRequir... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 25 | 74 |
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'inte-webhook',
mixins: [LinkedStateMixin, mixinCreateTopic, mixinInteHandler, PureRenderMixin],
propTypes: {
_teamId: T.string.isRequired,
_roomId: T.string.isRequired,
onPageBack: T.func.isRequir... | module.exports = React.createClass
displayName: 'inte-webhook'
mixins: [
LinkedStateMixin
mixinCreateTopic, mixinInteHandler
PureRenderMixin
]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
onPageBack: T.func.isRequired
inte: T.object
settings: T.obj... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 25 | 74 |
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'inte-webhook'
mixins: [
LinkedStateMixin
mixinCreateTopic, mixinInteHandler
PureRenderMixin
]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
onPageBack: T.func.isRequired
inte: T.object
settings: T.obj... | field.get('key') is 'token'
isToSubmit: ->
unless @state._roomId then return false
return true
hasChanges: ->
unless @props.inte?
return false
@props.settings.get('fields')
.filter (field) -> not field.get('readonly')
.some (field) =>
@state[field.get('key')] isnt @props.inte.... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 25 | 74 |
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:2:raw_corpus | raw_corpus | _roomId: @state._roomId
category: @props.settings.get('name')
@setState isSending: true
inteActions.inteCreate data,
(resp) =>
@setState webhookUrl: resp.webhookUrl, isSending: false
@props.onInteEdit Immutable.fromJS(resp)
(error) =>
@setState isSending: false
onUp... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 75 | 124 | ||
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:2:completion | completion | _roomId: @state._roomId
category: @props.settings.get('name')
@setState isSending: true
inteActions.inteCreate data,
(resp) =>
@setState webhookUrl: resp.webhookUrl, isSending: false
@props.onInteEdit Immutable.fromJS(resp)
(error) =>
@setState isSending: false
onUp... | @setState isSending: false
@onPageBack true
(error) =>
@setState isSending: false
# renderers
renderInteWebhookUrl: ->
settings = @props.settings.toJS()
field = fieldsReader.getField settings.fields, 'webhookUrl'
language = lang.getLang()
div className: 'table-pair',
d... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 75 | 124 |
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:3:raw_corpus | raw_corpus | @renderInteGuide()
if @props.inte?
@renderInteWebhookUrl()
else
@renderInteCreate()
if @props.inte?
div null,
if @needToken()
@renderInteToken()
@renderInteTitle()
@renderInteDesc()
@renderInteIcon()
@renderInteModif... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 125 | 140 | ||
jianliaoim/talk-os:talk-web/client/app/inte-webhook.coffee:3:completion | completion | @renderInteGuide()
if @props.inte?
@renderInteWebhookUrl()
else
@renderInteCreate()
if @props.inte?
div null,
if @needToken() | @renderInteToken()
@renderInteTitle()
@renderInteDesc()
@renderInteIcon()
@renderInteModify()
# modals
@renderTopicCreate() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-webhook.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-webhook.coffee | 125 | 140 |
lucasmotta/dploy:src/generator.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_dployCompleted = new Signal()
@_dployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/generator.coffee | 1 | 50 | ||
lucasmotta/dploy:src/generator.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_dployCompleted = new Signal()
@_dployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | @_dployCompleted.dispatch()
# Generate the content of the post-commit hook
_generatePostCommit: =>
# Ignore the installation if it's not a .git repository
return @_postCommitCompleted.dispatch() unless fs.existsSync ".git"
fileName = ".git/hooks/post-commit"
content = fs.readFileSync(path.resolve(__dirname... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:2:raw_corpus | raw_corpus | console.log "Error:".bold.red, "The post-commit file could not be created. Check the permissions of the folder.".red
console.log "\t #{error}"
return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch()
_completed: ->
console.log "Done!".bold.green + " Your ... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/generator.coffee | 51 | 60 | ||
lucasmotta/dploy:src/generator.coffee:2:completion | completion | console.log "Error:".bold.red, "The post-commit file could not be created. Check the permissions of the folder.".red
console.log "\t #{error}"
return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755" | @_postCommitCompleted.dispatch()
_completed: ->
console.log "Done!".bold.green + " Your project is ready to ".green + "DEPLOY".green.bold + " :) ".green
process.exit(code=0) | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/generator.coffee | 51 | 60 |
lucasmotta/dploy:src/generator.coffee:2:raw_corpus | raw_corpus | console.log "Error:".bold.red, "The post-commit file could not be created. Check the permissions of the folder.".red
console.log "\t #{error}"
return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch()
_completed: =>
console.log "Done!".bold.green + " Your ... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | ceede908f5bbeaf53fb729ee2e3d1ae32d9c46ca | 973 | https://github.com/lucasmotta/dploy/blob/ceede908f5bbeaf53fb729ee2e3d1ae32d9c46ca/src/generator.coffee | 51 | 60 | ||
lucasmotta/dploy:src/generator.coffee:2:completion | completion | console.log "Error:".bold.red, "The post-commit file could not be created. Check the permissions of the folder.".red
console.log "\t #{error}"
return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755" | @_postCommitCompleted.dispatch()
_completed: =>
console.log "Done!".bold.green + " Your project is ready to ".green + "DEPLOY".green.bold + " :) ".green
process.exit(code=0) | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | ceede908f5bbeaf53fb729ee2e3d1ae32d9c46ca | 973 | https://github.com/lucasmotta/dploy/blob/ceede908f5bbeaf53fb729ee2e3d1ae32d9c46ca/src/generator.coffee | 51 | 60 |
lucasmotta/dploy:src/generator.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_dployCompleted = new Signal()
@_dployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/generator.coffee | 1 | 50 | ||
lucasmotta/dploy:src/generator.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_dployCompleted = new Signal()
@_dployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
this._generateConfig = this._generateConfig.bind(this);
// Generate the content of the post-commit h... | CoffeeScript | JavaScript | lucasmotta/dploy | src/generator.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
this._generateConfig = this._generateConfig.bind(... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_dployCompleted = new Signal()
@_dployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | JavaScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_dployCompleted = new Signal()
@_dployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | @_dployCompleted.dispatch()
# Generate the content of the post-commit hook
_generatePostCommit: =>
# Ignore the installation if it's not a .git repository
return @_postCommitCompleted.dispatch() unless fs.existsSync ".git"
fileName = ".git/hooks/post-commit"
content = fs.readFileSync(path.resolve(__dirname... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:2:raw_corpus | raw_corpus | return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch()
_completed: =>
console.log "Done!".bold.green + " Your project is ready to ".green + "DEPLOY".green.bold + " :) ".green
process.exit(code=0) | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/generator.coffee | 51 | 58 | ||
lucasmotta/dploy:src/generator.coffee:2:completion | completion | return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch() | _completed: =>
console.log "Done!".bold.green + " Your project is ready to ".green + "DEPLOY".green.bold + " :) ".green
process.exit(code=0) | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/generator.coffee | 51 | 58 |
lucasmotta/dploy:src/generator.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_gployCompleted = new Signal()
@_gployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/generator.coffee | 1 | 50 | ||
lucasmotta/dploy:src/generator.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_gployCompleted = new Signal()
@_gployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
this._generateGPLOY = this._generateGPLOY.bind(this);
// Generate the content of the post-commit hoo... | CoffeeScript | JavaScript | lucasmotta/dploy | src/generator.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
this._generateGPLOY = this._generateGPLOY.bind(th... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_gployCompleted = new Signal()
@_gployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | JavaScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
@_gployCompleted = new Signal()
@_gployCompleted.add @_generatePostCommit
@_postCommitCompleted = new Signal()
@_postCommitCompleted.add @_completed
console.log... | @_gployCompleted.dispatch()
# Generate the content of the post-commit hook
_generatePostCommit: =>
# Ignore the installation if it's not a .git repository
return @_postCommitCompleted.dispatch() unless fs.existsSync ".git"
fileName = ".git/hooks/post-commit"
content = fs.readFileSync(path.resolve(__dirname... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/generator.coffee | 1 | 50 |
lucasmotta/dploy:src/generator.coffee:2:raw_corpus | raw_corpus | return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch()
_completed: =>
console.log "Done!".bold.green + " Your project is ready to ".green + "GPLOY".green.bold + " :) ".green
process.exit(code=0) | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/generator.coffee | 51 | 58 | ||
lucasmotta/dploy:src/generator.coffee:2:completion | completion | return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch() | _completed: =>
console.log "Done!".bold.green + " Your project is ready to ".green + "GPLOY".green.bold + " :) ".green
process.exit(code=0) | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/generator.coffee | 51 | 58 |
lucasmotta/dploy:src/generator.coffee:2:raw_corpus | raw_corpus | return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755"
@_postCommitCompleted.dispatch()
_completed: => console.log "Done!".bold.green + " Your project is ready to ".green + "GPLOY".green.bold + " :) ".green | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 62859a46c5eb62a64115b3fe4c80eb2be93c5f13 | 973 | https://github.com/lucasmotta/dploy/blob/62859a46c5eb62a64115b3fe4c80eb2be93c5f13/src/generator.coffee | 51 | 56 | ||
lucasmotta/dploy:src/generator.coffee:2:completion | completion | return @_postCommitCompleted.dispatch()
fs.chmodSync fileName, "0755" | @_postCommitCompleted.dispatch()
_completed: => console.log "Done!".bold.green + " Your project is ready to ".green + "GPLOY".green.bold + " :) ".green | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 62859a46c5eb62a64115b3fe4c80eb2be93c5f13 | 973 | https://github.com/lucasmotta/dploy/blob/62859a46c5eb62a64115b3fe4c80eb2be93c5f13/src/generator.coffee | 51 | 56 |
lucasmotta/dploy:src/generator.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
@_generatePostCommit()
# Generate the content of the post-commit hook
# TODO Create from an external file
_generatePostCommit: ->
fileName ... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 7d8d4856d2933c4cea2d8dabf808687ce2d2a916 | 973 | https://github.com/lucasmotta/dploy/blob/7d8d4856d2933c4cea2d8dabf808687ce2d2a916/src/generator.coffee | 1 | 39 | ||
lucasmotta/dploy:src/generator.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
@_generatePostCommit()
# Generate the content of the post-commit hook
# TODO Create f... | var Generator, colors, exec, fs;
colors = require("colors");
fs = require("fs");
exec = require("child_process").exec;
module.exports = Generator = (function() {
class Generator {
constructor() {
this._generatePostCommit();
}
// Generate the content of the post-commit hook
// TODO Create fr... | CoffeeScript | JavaScript | lucasmotta/dploy | src/generator.coffee | MIT | 7d8d4856d2933c4cea2d8dabf808687ce2d2a916 | 973 | https://github.com/lucasmotta/dploy/blob/7d8d4856d2933c4cea2d8dabf808687ce2d2a916/src/generator.coffee | 1 | 39 |
lucasmotta/dploy:src/generator.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, colors, exec, fs;
colors = require("colors");
fs = require("fs");
exec = require("child_process").exec;
module.exports = Generator = (function() {
class Generator {
constructor() {
this._generatePostCommit();
}
// Generate th... | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
@_generatePostCommit()
# Generate the content of the post-commit hook
# TODO Create from an external file
_generatePostCommit: ->
fileName ... | JavaScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 7d8d4856d2933c4cea2d8dabf808687ce2d2a916 | 973 | https://github.com/lucasmotta/dploy/blob/7d8d4856d2933c4cea2d8dabf808687ce2d2a916/src/generator.coffee | 1 | 39 |
lucasmotta/dploy:src/generator.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
@_generatePostCommit()
# Generate the content of the post-commit hook
# TODO Create from an external file
_generatePostCommit: ->
fileName ... | content += 'tag="#gploy"' + '\n'
content += 'if [[ "$message" = *"$tag"* ]]; then' + '\n'
content += '\tservers=${tag}${message#*${tag}}' + '\n'
content += '\tnoTag=${servers//#/""}' + '\n'
content += '\teval $noTag' + '\n'
content += 'fi\n'
if fs.existsSync fileName
fileData = fs.readFileSync(fileName)... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 7d8d4856d2933c4cea2d8dabf808687ce2d2a916 | 973 | https://github.com/lucasmotta/dploy/blob/7d8d4856d2933c4cea2d8dabf808687ce2d2a916/src/generator.coffee | 1 | 39 |
lucasmotta/dploy:src/generator.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
# Generate the content of the post-commit hook
# TODO Create from an external file
content = '#!/bin/bash' + '\n\n'
content += 'message=$(... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | f83e5365275ffa146b2f01f0ac7c963ec776b637 | 973 | https://github.com/lucasmotta/dploy/blob/f83e5365275ffa146b2f01f0ac7c963ec776b637/src/generator.coffee | 1 | 26 | ||
lucasmotta/dploy:src/generator.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
# Generate the content of the post-commit hook
# TODO Create from an external file
... | var Generator, colors, exec, fs;
colors = require("colors");
fs = require("fs");
exec = require("child_process").exec;
module.exports = Generator = (function() {
class Generator {
constructor() {
var content;
// Generate the content of the post-commit hook
// TODO Create from an external fil... | CoffeeScript | JavaScript | lucasmotta/dploy | src/generator.coffee | MIT | f83e5365275ffa146b2f01f0ac7c963ec776b637 | 973 | https://github.com/lucasmotta/dploy/blob/f83e5365275ffa146b2f01f0ac7c963ec776b637/src/generator.coffee | 1 | 26 |
lucasmotta/dploy:src/generator.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, colors, exec, fs;
colors = require("colors");
fs = require("fs");
exec = require("child_process").exec;
module.exports = Generator = (function() {
class Generator {
constructor() {
var content;
// Generate the content of the pos... | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
# Generate the content of the post-commit hook
# TODO Create from an external file
content = '#!/bin/bash' + '\n\n'
content += 'message=$(... | JavaScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | f83e5365275ffa146b2f01f0ac7c963ec776b637 | 973 | https://github.com/lucasmotta/dploy/blob/f83e5365275ffa146b2f01f0ac7c963ec776b637/src/generator.coffee | 1 | 26 |
lucasmotta/dploy:src/generator.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
# Generate the content of the post-commit hook
# TODO Create from an external file
content = '#!/bin/bash' + '\n\n' | content += 'message=$(git log -1 --all --pretty=%B)' + '\n'
content += 'tag="#gploy"' + '\n'
content += 'if [[ "$message" = *"$tag"* ]]; then' + '\n'
content += '\tservers=${tag}${message#*${tag}}' + '\n'
content += '\tnoTag=${servers//#/""}' + '\n'
content += '\teval $noTag' + '\n'
content += 'fi'
fs.wr... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | f83e5365275ffa146b2f01f0ac7c963ec776b637 | 973 | https://github.com/lucasmotta/dploy/blob/f83e5365275ffa146b2f01f0ac7c963ec776b637/src/generator.coffee | 1 | 26 |
lucasmotta/dploy:src/generator.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
content = '#!/bin/bash' + '\n\n'
content += 'message=$(git log -1 --all --pretty=%B)' + '\n'
content += 'tag="#gploy"' + '\n'
content += '... | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 33f795d2556864a4c64e6d991100b7f557245f0e | 973 | https://github.com/lucasmotta/dploy/blob/33f795d2556864a4c64e6d991100b7f557245f0e/src/generator.coffee | 1 | 24 | ||
lucasmotta/dploy:src/generator.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
content = '#!/bin/bash' + '\n\n'
content += 'message=$(git log -1 --all --pretty=%B)'... | var Generator, colors, exec, fs;
colors = require("colors");
fs = require("fs");
exec = require("child_process").exec;
module.exports = Generator = (function() {
class Generator {
constructor() {
var content;
content = '#!/bin/bash' + '\n\n';
content += 'message=$(git log -1 --all --pretty=%... | CoffeeScript | JavaScript | lucasmotta/dploy | src/generator.coffee | MIT | 33f795d2556864a4c64e6d991100b7f557245f0e | 973 | https://github.com/lucasmotta/dploy/blob/33f795d2556864a4c64e6d991100b7f557245f0e/src/generator.coffee | 1 | 24 |
lucasmotta/dploy:src/generator.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, colors, exec, fs;
colors = require("colors");
fs = require("fs");
exec = require("child_process").exec;
module.exports = Generator = (function() {
class Generator {
constructor() {
var content;
content = '#!/bin/bash' + '\n\n';
... | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
content = '#!/bin/bash' + '\n\n'
content += 'message=$(git log -1 --all --pretty=%B)' + '\n'
content += 'tag="#gploy"' + '\n'
content += '... | JavaScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 33f795d2556864a4c64e6d991100b7f557245f0e | 973 | https://github.com/lucasmotta/dploy/blob/33f795d2556864a4c64e6d991100b7f557245f0e/src/generator.coffee | 1 | 24 |
lucasmotta/dploy:src/generator.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
exec = require("child_process").exec
module.exports = class Generator
fileName : ".git/hooks/post-commit"
constructor: ->
content = '#!/bin/bash' + '\n\n'
content += 'message=$(git log -1 --all --pretty=%B)' + '\n' | content += 'tag="#gploy"' + '\n'
content += 'if [[ "$message" = *"$tag"* ]]; then' + '\n'
content += '\tservers=${tag}${message#*${tag}}' + '\n'
content += '\tnoTag=${servers//#/""}' + '\n'
content += '\teval $noTag' + '\n'
content += 'fi'
fs.writeFile @fileName, content, (error) =>
return console.log "... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/generator.coffee | MIT | 33f795d2556864a4c64e6d991100b7f557245f0e | 973 | https://github.com/lucasmotta/dploy/blob/33f795d2556864a4c64e6d991100b7f557245f0e/src/generator.coffee | 1 | 24 |
discolabs/cartjs:src/compatibility.coffee:1:raw_corpus | raw_corpus | # CartJS.Compatibility
# Compatibility mode code for non-ES5 browsers.
#
# Non-ES5 browsers (namely, IE8) don't support Object.defineProperty(), which
# Rivets.js uses to observe changes on data models and trigger DOM updates.
# This means that by default, users with non-ES5 browsers won't see their pages
# dynamically... | CoffeeScript | discolabs/cartjs | src/compatibility.coffee | MIT | 0d1722b3d7b62e6b732171fafaf753b366e29961 | 493 | https://github.com/discolabs/cartjs/blob/0d1722b3d7b62e6b732171fafaf753b366e29961/src/compatibility.coffee | 1 | 50 | ||
discolabs/cartjs:src/compatibility.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# CartJS.Compatibility
# Compatibility mode code for non-ES5 browsers.
#
# Non-ES5 browsers (namely, IE8) don't support Object.defineProperty(), which
# Rivets.js uses to observe changes on data models and trigger DOM updates.
# This means that by default, users ... | // CartJS.Compatibility
// Compatibility mode code for non-ES5 browsers.
// Non-ES5 browsers (namely, IE8) don't support Object.defineProperty(), which
// Rivets.js uses to observe changes on data models and trigger DOM updates.
// This means that by default, users with non-ES5 browsers won't see their pages
// dynami... | CoffeeScript | JavaScript | discolabs/cartjs | src/compatibility.coffee | MIT | 0d1722b3d7b62e6b732171fafaf753b366e29961 | 493 | https://github.com/discolabs/cartjs/blob/0d1722b3d7b62e6b732171fafaf753b366e29961/src/compatibility.coffee | 1 | 50 |
discolabs/cartjs:src/compatibility.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// CartJS.Compatibility
// Compatibility mode code for non-ES5 browsers.
// Non-ES5 browsers (namely, IE8) don't support Object.defineProperty(), which
// Rivets.js uses to observe changes on data models and trigger DOM updates.
// This means that by default, user... | # CartJS.Compatibility
# Compatibility mode code for non-ES5 browsers.
#
# Non-ES5 browsers (namely, IE8) don't support Object.defineProperty(), which
# Rivets.js uses to observe changes on data models and trigger DOM updates.
# This means that by default, users with non-ES5 browsers won't see their pages
# dynamically... | JavaScript | CoffeeScript | discolabs/cartjs | src/compatibility.coffee | MIT | 0d1722b3d7b62e6b732171fafaf753b366e29961 | 493 | https://github.com/discolabs/cartjs/blob/0d1722b3d7b62e6b732171fafaf753b366e29961/src/compatibility.coffee | 1 | 50 |
discolabs/cartjs:src/compatibility.coffee:1:completion | completion | # CartJS.Compatibility
# Compatibility mode code for non-ES5 browsers.
#
# Non-ES5 browsers (namely, IE8) don't support Object.defineProperty(), which
# Rivets.js uses to observe changes on data models and trigger DOM updates.
# This means that by default, users with non-ES5 browsers won't see their pages
# dynamically... | # Tear down non-ES5 compatibility.
destroy: () ->
CartJS.Utils.log('Tearing down compatibility module.')
jQuery(document).off 'cart.requestComplete', CartJS.Compatibility.rebindViews
# Rebind all Rivets.js views to force an update in non-ES5 browsers. It
# seems odd that we need to unbind(), up... | CoffeeScript | CoffeeScript | discolabs/cartjs | src/compatibility.coffee | MIT | 0d1722b3d7b62e6b732171fafaf753b366e29961 | 493 | https://github.com/discolabs/cartjs/blob/0d1722b3d7b62e6b732171fafaf753b366e29961/src/compatibility.coffee | 1 | 50 |
soulwire/Coffee-Physics:source/engine/integrator/Verlet.coffee:1:raw_corpus | raw_corpus | ### Velocity Verlet Integrator ###
class Verlet extends Integrator
# v = x - ox
# x = x + (v + a * dt * dt)
integrate: (particles, dt, drag) ->
pos = new Vector()
dtSq = dt * dt
for p in particles when not p.fixed
# Scale force to mass.
p.acc.scale p.ma... | CoffeeScript | soulwire/Coffee-Physics | source/engine/integrator/Verlet.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/integrator/Verlet.coffee | 1 | 35 | ||
soulwire/Coffee-Physics:source/engine/integrator/Verlet.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
### Velocity Verlet Integrator ###
class Verlet extends Integrator
# v = x - ox
# x = x + (v + a * dt * dt)
integrate: (particles, dt, drag) ->
pos = new Vector()
dtSq = dt * dt
for p in particles when not p.fixed
... | /* Velocity Verlet Integrator */
var Verlet;
Verlet = class Verlet extends Integrator {
// v = x - ox
// x = x + (v + a * dt * dt)
integrate(particles, dt, drag) {
var dtSq, i, len, p, pos, results;
pos = new Vector();
dtSq = dt * dt;
results = [];
for (i = 0, len = particles.length; i < len;... | CoffeeScript | JavaScript | soulwire/Coffee-Physics | source/engine/integrator/Verlet.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/integrator/Verlet.coffee | 1 | 35 |
soulwire/Coffee-Physics:source/engine/integrator/Verlet.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/* Velocity Verlet Integrator */
var Verlet;
Verlet = class Verlet extends Integrator {
// v = x - ox
// x = x + (v + a * dt * dt)
integrate(particles, dt, drag) {
var dtSq, i, len, p, pos, results;
pos = new Vector();
dtSq = dt * dt;
results... | ### Velocity Verlet Integrator ###
class Verlet extends Integrator
# v = x - ox
# x = x + (v + a * dt * dt)
integrate: (particles, dt, drag) ->
pos = new Vector()
dtSq = dt * dt
for p in particles when not p.fixed
# Scale force to mass.
p.acc.scale p.ma... | JavaScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/integrator/Verlet.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/integrator/Verlet.coffee | 1 | 35 |
soulwire/Coffee-Physics:source/engine/integrator/Verlet.coffee:1:completion | completion | ### Velocity Verlet Integrator ###
class Verlet extends Integrator
# v = x - ox
# x = x + (v + a * dt * dt)
integrate: (particles, dt, drag) ->
pos = new Vector()
dtSq = dt * dt
for p in particles when not p.fixed
# Scale force to mass.
p.acc.scale p.ma... | # Derive velocity.
(p.vel.copy p.pos).sub p.old.pos
# Apply friction.
if drag then p.vel.scale drag
# Apply forces to new position.
(pos.copy p.pos).add (p.vel.add p.acc.scale dtSq)
# Store old position.
p.old.pos.copy p.pos
... | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/integrator/Verlet.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/integrator/Verlet.coffee | 1 | 35 |
Glavin001/atom-beautify:src/beautifiers/tidy-markdown.coffee:1:raw_corpus | raw_corpus | "use strict"
Beautifier = require('./beautifier')
module.exports = class TidyMarkdown extends Beautifier
name: "Tidy Markdown"
link: "https://github.com/slang800/tidy-markdown"
options: {
Markdown: false
}
beautify: (text, language, options) ->
return new @Promise((resolve, reject) ->
tidyMark... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/tidy-markdown.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/tidy-markdown.coffee | 1 | 16 | ||
Glavin001/atom-beautify:src/beautifiers/tidy-markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"use strict"
Beautifier = require('./beautifier')
module.exports = class TidyMarkdown extends Beautifier
name: "Tidy Markdown"
link: "https://github.com/slang800/tidy-markdown"
options: {
Markdown: false
}
beautify: (text, language, options) ->
... | "use strict";
var Beautifier, TidyMarkdown;
Beautifier = require('./beautifier');
module.exports = TidyMarkdown = (function() {
class TidyMarkdown extends Beautifier {
beautify(text, language, options) {
return new this.Promise(function(resolve, reject) {
var cleanMarkdown, tidyMarkdown;
t... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/tidy-markdown.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/tidy-markdown.coffee | 1 | 16 |
Glavin001/atom-beautify:src/beautifiers/tidy-markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
"use strict";
var Beautifier, TidyMarkdown;
Beautifier = require('./beautifier');
module.exports = TidyMarkdown = (function() {
class TidyMarkdown extends Beautifier {
beautify(text, language, options) {
return new this.Promise(function(resolve, rejec... | "use strict"
Beautifier = require('./beautifier')
module.exports = class TidyMarkdown extends Beautifier
name: "Tidy Markdown"
link: "https://github.com/slang800/tidy-markdown"
options: {
Markdown: false
}
beautify: (text, language, options) ->
return new @Promise((resolve, reject) ->
tidyMark... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/tidy-markdown.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/tidy-markdown.coffee | 1 | 16 |
Glavin001/atom-beautify:src/beautifiers/tidy-markdown.coffee:1:completion | completion | "use strict"
Beautifier = require('./beautifier')
module.exports = class TidyMarkdown extends Beautifier
name: "Tidy Markdown"
link: "https://github.com/slang800/tidy-markdown"
options: {
Markdown: false | }
beautify: (text, language, options) ->
return new @Promise((resolve, reject) ->
tidyMarkdown = require 'tidy-markdown'
cleanMarkdown = tidyMarkdown(text)
resolve(cleanMarkdown)
) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/tidy-markdown.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/tidy-markdown.coffee | 1 | 16 |
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:1:raw_corpus | raw_corpus | should = require 'should'
Promise = require 'bluebird'
limbo = require 'limbo'
app = require '../app'
{prepare, clear, requestAsync} = app
describe 'Group#CURD', ->
before prepare
it 'should create a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 1 | 47 | ||
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
should = require 'should'
Promise = require 'bluebird'
limbo = require 'limbo'
app = require '../app'
{prepare, clear, requestAsync} = app
describe 'Group#CURD', ->
before prepare
it 'should create a group', (done) ->
$broadcast = new Promise (resolve,... | var Promise, app, clear, limbo, prepare, requestAsync, should;
should = require('should');
Promise = require('bluebird');
limbo = require('limbo');
app = require('../app');
({prepare, clear, requestAsync} = app);
describe('Group#CURD', function() {
before(prepare);
it('should create a group', function(done) {... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 1 | 47 |
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Promise, app, clear, limbo, prepare, requestAsync, should;
should = require('should');
Promise = require('bluebird');
limbo = require('limbo');
app = require('../app');
({prepare, clear, requestAsync} = app);
describe('Group#CURD', function() {
before(p... | should = require 'should'
Promise = require 'bluebird'
limbo = require 'limbo'
app = require '../app'
{prepare, clear, requestAsync} = app
describe 'Group#CURD', ->
before prepare
it 'should create a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 1 | 47 |
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:1:completion | completion | should = require 'should'
Promise = require 'bluebird'
limbo = require 'limbo'
app = require '../app'
{prepare, clear, requestAsync} = app
describe 'Group#CURD', ->
before prepare
it 'should create a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel... | options =
method: 'POST'
url: 'groups'
body:
_sessionUserId: app.user1._id
_teamId: app.team1._id
name: 'XXX'
_memberIds: [app.user1._id]
requestAsync options
Promise.all [$broadcast, $group]
.nodeify done
it 'should read groups', (done) ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 1 | 47 |
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:2:raw_corpus | raw_corpus | $groups.nodeify done
it 'should update a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel, event, data) ->
if event is 'group:update'
data.name.should.eql 'YYY'
hits |= 0b1
resolve() if hits is 0b1
$group = Prom... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 49 | 90 | ||
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:2:completion | completion | $groups.nodeify done
it 'should update a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel, event, data) ->
if event is 'group:update'
data.name.should.eql 'YYY'
hits |= 0b1
resolve() if hits is 0b1
$group = Prom... | .nodeify done
it 'should add members to a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel, event, data) ->
if event is 'group:update'
data._memberIds.length.should.eql 2
data._memberIds.should.containEql "#{app.user2._id}"
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 49 | 90 |
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:3:raw_corpus | raw_corpus | Promise.all [$broadcast, $group]
.nodeify done
it 'should remove members from a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel, event, data) ->
if event is 'group:update'
data._memberIds.length.should.eql 1
data._membe... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 92 | 132 | ||
jianliaoim/talk-os:talk-api2x/test/controllers/group.coffee:3:completion | completion | Promise.all [$broadcast, $group]
.nodeify done
it 'should remove members from a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel, event, data) ->
if event is 'group:update'
data._memberIds.length.should.eql 1
data._membe... | requestAsync options
Promise.all [$broadcast, $group]
.nodeify done
it 'should remove a group', (done) ->
$broadcast = new Promise (resolve, reject) ->
hits = 0
app.broadcast = (channel, event, data) ->
if event is 'group:remove'
"#{data._id}".should.eql "#{app.group1._id}"... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/group.coffee | 92 | 132 |
outsideris/popularconvention:src/parser/parser.coffee:1:raw_corpus | raw_corpus | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 1 | 50 | ||
outsideris/popularconvention:src/parser/parser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logge... | // parsing source
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var csharpParser, helpers, javaParser, jsParser, logger, parser, path, phpParser, pythonParser, rubyParser, scalaParser;
helpers = require('../h... | CoffeeScript | JavaScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// parsing source
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var csharpParser, helpers, javaParser, jsParser, logger, parser, path, phpParser, pythonPa... | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | JavaScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:1:completion | completion | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | parse: (commit) ->
conventions = []
try
commit = JSON.parse commit if 'string' is helpers.extractType commit
commit.files.forEach (file) ->
ext = path.extname file.filename
if isSupportExt(ext) and file.patch?
convention = {lang: ext.substr(1)}
psr = parser.getPar... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:2:raw_corpus | raw_corpus | switch ext
when '.js' then jsParser
when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
when '.cs' then csharpParser
when '.php' then phpParser
# private
supportExts = [
'.js'
'.java'
'.py'
'.scala'
'.rb... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 51 | 73 | ||
outsideris/popularconvention:src/parser/parser.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
switch ext
when '.js' then jsParser
when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
when '.cs' then csharpParser
when '.php' then phpParser
# private
su... | var isSupportExt, supportExts;
switch (ext) {
case '.js':
jsParser;
break;
case '.java':
javaParser;
break;
case '.py':
pythonParser;
break;
case '.scala':
scalaParser;
break;
case '.rb':
rubyParser;
break;
case '.cs':
csharpParser;
break;
case '.php':
... | CoffeeScript | JavaScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 51 | 73 |
outsideris/popularconvention:src/parser/parser.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var isSupportExt, supportExts;
switch (ext) {
case '.js':
jsParser;
break;
case '.java':
javaParser;
break;
case '.py':
pythonParser;
break;
case '.scala':
scalaParser;
break;
case '.rb':
rubyParser;
break;
case ... | switch ext
when '.js' then jsParser
when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
when '.cs' then csharpParser
when '.php' then phpParser
# private
supportExts = [
'.js'
'.java'
'.py'
'.scala'
'.rb... | JavaScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 51 | 73 |
outsideris/popularconvention:src/parser/parser.coffee:2:completion | completion | switch ext
when '.js' then jsParser
when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
when '.cs' then csharpParser
when '.php' then phpParser
# private
supportExts = [ | '.js'
'.java'
'.py'
'.scala'
'.rb'
'.cs'
'.php'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/parser.coffee | 51 | 73 |
outsideris/popularconvention:src/parser/parser.coffee:1:raw_corpus | raw_corpus | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | f718c9b3965365ba91a094e5ae031bd78a4fc84d | 730 | https://github.com/outsideris/popularconvention/blob/f718c9b3965365ba91a094e5ae031bd78a4fc84d/src/parser/parser.coffee | 1 | 50 | ||
outsideris/popularconvention:src/parser/parser.coffee:1:completion | completion | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | parse: (commit) ->
conventions = []
try
commit = JSON.parse commit if 'string' is helpers.extractType commit
commit.files.forEach (file) ->
ext = path.extname file.filename
if isSupportExt(ext) and file.patch?
convention = {lang: ext.substr(1)}
psr = parser.getPar... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | f718c9b3965365ba91a094e5ae031bd78a4fc84d | 730 | https://github.com/outsideris/popularconvention/blob/f718c9b3965365ba91a094e5ae031bd78a4fc84d/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:2:raw_corpus | raw_corpus | when '.js' then jsParser
when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
when '.cs' then csharpParser
# private
supportExts = [
'.js'
'.java'
'.py'
'.scala'
'.rb'
'.cs'
]
isSupportExt = (ext) ->
supportExts... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | f718c9b3965365ba91a094e5ae031bd78a4fc84d | 730 | https://github.com/outsideris/popularconvention/blob/f718c9b3965365ba91a094e5ae031bd78a4fc84d/src/parser/parser.coffee | 51 | 70 | ||
outsideris/popularconvention:src/parser/parser.coffee:2:completion | completion | when '.js' then jsParser
when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
when '.cs' then csharpParser
# private
supportExts = [
'.js' | '.java'
'.py'
'.scala'
'.rb'
'.cs'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | f718c9b3965365ba91a094e5ae031bd78a4fc84d | 730 | https://github.com/outsideris/popularconvention/blob/f718c9b3965365ba91a094e5ae031bd78a4fc84d/src/parser/parser.coffee | 51 | 70 |
outsideris/popularconvention:src/parser/parser.coffee:1:raw_corpus | raw_corpus | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | df321275c908de4b74a7293cc066cd3055596483 | 730 | https://github.com/outsideris/popularconvention/blob/df321275c908de4b74a7293cc066cd3055596483/src/parser/parser.coffee | 1 | 50 | ||
outsideris/popularconvention:src/parser/parser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logge... | // parsing source
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var helpers, javaParser, jsParser, logger, parser, path, pythonParser, rubyParser, scalaParser;
helpers = require('../helpers');
path = require... | CoffeeScript | JavaScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | df321275c908de4b74a7293cc066cd3055596483 | 730 | https://github.com/outsideris/popularconvention/blob/df321275c908de4b74a7293cc066cd3055596483/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// parsing source
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var helpers, javaParser, jsParser, logger, parser, path, pythonParser, rubyParser, scalaPa... | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | JavaScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | df321275c908de4b74a7293cc066cd3055596483 | 730 | https://github.com/outsideris/popularconvention/blob/df321275c908de4b74a7293cc066cd3055596483/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:1:completion | completion | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | conventions = []
try
commit = JSON.parse commit if 'string' is helpers.extractType commit
commit.files.forEach (file) ->
ext = path.extname file.filename
if isSupportExt(ext) and file.patch?
convention = {lang: ext.substr(1)}
psr = parser.getParser ext
lines... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | df321275c908de4b74a7293cc066cd3055596483 | 730 | https://github.com/outsideris/popularconvention/blob/df321275c908de4b74a7293cc066cd3055596483/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:2:raw_corpus | raw_corpus | when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
# private
supportExts = [
'.js'
'.java'
'.py'
'.scala'
'.rb'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | df321275c908de4b74a7293cc066cd3055596483 | 730 | https://github.com/outsideris/popularconvention/blob/df321275c908de4b74a7293cc066cd3055596483/src/parser/parser.coffee | 51 | 67 | ||
outsideris/popularconvention:src/parser/parser.coffee:2:completion | completion | when '.java' then javaParser
when '.py' then pythonParser
when '.scala' then scalaParser
when '.rb' then rubyParser
# private
supportExts = [
'.js' | '.java'
'.py'
'.scala'
'.rb'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | df321275c908de4b74a7293cc066cd3055596483 | 730 | https://github.com/outsideris/popularconvention/blob/df321275c908de4b74a7293cc066cd3055596483/src/parser/parser.coffee | 51 | 67 |
outsideris/popularconvention:src/parser/parser.coffee:1:raw_corpus | raw_corpus | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | a13b7f694a632550ddf5638659f006f21f96c8dc | 730 | https://github.com/outsideris/popularconvention/blob/a13b7f694a632550ddf5638659f006f21f96c8dc/src/parser/parser.coffee | 1 | 50 | ||
outsideris/popularconvention:src/parser/parser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logge... | // parsing source
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var helpers, javaParser, jsParser, logger, parser, path, pythonParser, scalaParser;
helpers = require('../helpers');
path = require('path');
l... | CoffeeScript | JavaScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | a13b7f694a632550ddf5638659f006f21f96c8dc | 730 | https://github.com/outsideris/popularconvention/blob/a13b7f694a632550ddf5638659f006f21f96c8dc/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// parsing source
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var helpers, javaParser, jsParser, logger, parser, path, pythonParser, scalaParser;
helpe... | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | JavaScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | a13b7f694a632550ddf5638659f006f21f96c8dc | 730 | https://github.com/outsideris/popularconvention/blob/a13b7f694a632550ddf5638659f006f21f96c8dc/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:1:completion | completion | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | try
commit = JSON.parse commit if 'string' is helpers.extractType commit
commit.files.forEach (file) ->
ext = path.extname file.filename
if isSupportExt(ext) and file.patch?
convention = {lang: ext.substr(1)}
psr = parser.getParser ext
lines = parser.parseAdditi... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | a13b7f694a632550ddf5638659f006f21f96c8dc | 730 | https://github.com/outsideris/popularconvention/blob/a13b7f694a632550ddf5638659f006f21f96c8dc/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:2:raw_corpus | raw_corpus | when '.py' then pythonParser
when '.scala' then scalaParser
# private
supportExts = [
'.js'
'.java'
'.py'
'.scala'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | a13b7f694a632550ddf5638659f006f21f96c8dc | 730 | https://github.com/outsideris/popularconvention/blob/a13b7f694a632550ddf5638659f006f21f96c8dc/src/parser/parser.coffee | 51 | 64 | ||
outsideris/popularconvention:src/parser/parser.coffee:2:completion | completion | when '.py' then pythonParser
when '.scala' then scalaParser
# private
supportExts = [
'.js'
'.java' | '.py'
'.scala'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | a13b7f694a632550ddf5638659f006f21f96c8dc | 730 | https://github.com/outsideris/popularconvention/blob/a13b7f694a632550ddf5638659f006f21f96c8dc/src/parser/parser.coffee | 51 | 64 |
outsideris/popularconvention:src/parser/parser.coffee:1:raw_corpus | raw_corpus | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 25cd3d632f88809e4685cf397bbfe53d67cbde14 | 730 | https://github.com/outsideris/popularconvention/blob/25cd3d632f88809e4685cf397bbfe53d67cbde14/src/parser/parser.coffee | 1 | 50 | ||
outsideris/popularconvention:src/parser/parser.coffee:1:completion | completion | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | try
commit = JSON.parse commit if 'string' is helpers.extractType commit
commit.files.forEach (file) ->
ext = path.extname file.filename
if isSupportExt(ext) and file.patch?
convention = {lang: ext.substr(1)}
psr = parser.getParser ext
lines = parser.parseAdditi... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 25cd3d632f88809e4685cf397bbfe53d67cbde14 | 730 | https://github.com/outsideris/popularconvention/blob/25cd3d632f88809e4685cf397bbfe53d67cbde14/src/parser/parser.coffee | 1 | 50 |
outsideris/popularconvention:src/parser/parser.coffee:2:raw_corpus | raw_corpus | '.js'
'.java'
'.py'
'.scala'
]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 25cd3d632f88809e4685cf397bbfe53d67cbde14 | 730 | https://github.com/outsideris/popularconvention/blob/25cd3d632f88809e4685cf397bbfe53d67cbde14/src/parser/parser.coffee | 51 | 59 | ||
outsideris/popularconvention:src/parser/parser.coffee:2:completion | completion | '.js'
'.java'
'.py'
'.scala' | ]
isSupportExt = (ext) ->
supportExts.some (elem) ->
elem is ext | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 25cd3d632f88809e4685cf397bbfe53d67cbde14 | 730 | https://github.com/outsideris/popularconvention/blob/25cd3d632f88809e4685cf397bbfe53d67cbde14/src/parser/parser.coffee | 51 | 59 |
outsideris/popularconvention:src/parser/parser.coffee:1:raw_corpus | raw_corpus | # parsing source
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
path = require 'path'
logger = (require '../helpers').logger
jsParser = require './js-parser'
javaParser = require '... | CoffeeScript | outsideris/popularconvention | src/parser/parser.coffee | MIT | 8e22316359ae8613b414e5650c95b107a20fec4e | 730 | https://github.com/outsideris/popularconvention/blob/8e22316359ae8613b414e5650c95b107a20fec4e/src/parser/parser.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.