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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jnordberg/wintersmith:src/index.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
defaultPlugins =
Page: require('./plugins/markdown-page')
MarkdownPage: req... | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | f4bb67ed46060cd12e58d58a659b1e57cfb0e714 | 3,484 | https://github.com/jnordberg/wintersmith/blob/f4bb67ed46060cd12e58d58a659b1e57cfb0e714/src/index.coffee | 1 | 50 | ||
jnordberg/wintersmith:src/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
defaultPlugins =
Pag... | var ContentPlugin, ContentTree, TemplatePlugin, async, defaultPlugins, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} = require('./content'));
({TemplatePlu... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/index.coffee | MIT | f4bb67ed46060cd12e58d58a659b1e57cfb0e714 | 3,484 | https://github.com/jnordberg/wintersmith/blob/f4bb67ed46060cd12e58d58a659b1e57cfb0e714/src/index.coffee | 1 | 50 |
jnordberg/wintersmith:src/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContentPlugin, ContentTree, TemplatePlugin, async, defaultPlugins, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registe... | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
defaultPlugins =
Page: require('./plugins/markdown-page')
MarkdownPage: req... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | f4bb67ed46060cd12e58d58a659b1e57cfb0e714 | 3,484 | https://github.com/jnordberg/wintersmith/blob/f4bb67ed46060cd12e58d58a659b1e57cfb0e714/src/index.coffee | 1 | 50 |
jnordberg/wintersmith:src/index.coffee:1:completion | completion | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
defaultPlugins =
Page: require('./plugins/markdown-page')
MarkdownPage: req... | contents: path to contents
templates: path to templates
output: path to output directory
locals: optional extra data to send to templates ###
logger.verbose 'running with options:', {options: options}
# load templates & contents then render
async.waterfall [
(callback) ->
async... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | f4bb67ed46060cd12e58d58a659b1e57cfb0e714 | 3,484 | https://github.com/jnordberg/wintersmith/blob/f4bb67ed46060cd12e58d58a659b1e57cfb0e714/src/index.coffee | 1 | 50 |
jnordberg/wintersmith:src/index.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)'... | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc | 3,484 | https://github.com/jnordberg/wintersmith/blob/2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc/src/index.coffee | 1 | 47 | ||
jnordberg/wintersmith:src/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plu... | var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} = require('./content'));
({TemplatePlugin, loadTemplat... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/index.coffee | MIT | 2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc | 3,484 | https://github.com/jnordberg/wintersmith/blob/2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc/src/index.coffee | 1 | 47 |
jnordberg/wintersmith:src/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} ... | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)'... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc | 3,484 | https://github.com/jnordberg/wintersmith/blob/2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc/src/index.coffee | 1 | 47 |
jnordberg/wintersmith:src/index.coffee:1:completion | completion | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)'... | logger.verbose 'running with options:', {options: options}
# load templates & contents then render
async.waterfall [
(callback) ->
async.parallel
contents: async.apply loadContents, options.contents
templates: async.apply loadTemplates, options.templates
, callback
(result, call... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc | 3,484 | https://github.com/jnordberg/wintersmith/blob/2c8daaf2806be5fbe7c1f5ca32386a4f63a84cbc/src/index.coffee | 1 | 47 |
jnordberg/wintersmith:src/index.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)'... | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/index.coffee | 1 | 48 | ||
jnordberg/wintersmith:src/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plu... | var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} = require('./content'));
({TemplatePlugin, loadTemplat... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/index.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/index.coffee | 1 | 48 |
jnordberg/wintersmith:src/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} ... | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)'... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/index.coffee | 1 | 48 |
jnordberg/wintersmith:src/index.coffee:1:completion | completion | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)'... | logger.verbose 'running with options:', {options: options}
# load templates & contents then render
async.waterfall [
(callback) ->
async.parallel
contents: async.apply loadContents, options.contents
templates: async.apply loadTemplates, options.templates
, callback
(result, call... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/index.coffee | 1 | 48 |
jnordberg/wintersmith:src/index.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)... | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 4124dcacb31c836752d7d48cf8b922aa4b7f9cfb | 3,484 | https://github.com/jnordberg/wintersmith/blob/4124dcacb31c836752d7d48cf8b922aa4b7f9cfb/src/index.coffee | 1 | 47 | ||
jnordberg/wintersmith:src/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default pl... | var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} = require('./content'));
({TemplatePlugin, loadTemplat... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/index.coffee | MIT | 4124dcacb31c836752d7d48cf8b922aa4b7f9cfb | 3,484 | https://github.com/jnordberg/wintersmith/blob/4124dcacb31c836752d7d48cf8b922aa4b7f9cfb/src/index.coffee | 1 | 47 |
jnordberg/wintersmith:src/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} ... | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 4124dcacb31c836752d7d48cf8b922aa4b7f9cfb | 3,484 | https://github.com/jnordberg/wintersmith/blob/4124dcacb31c836752d7d48cf8b922aa4b7f9cfb/src/index.coffee | 1 | 47 |
jnordberg/wintersmith:src/index.coffee:1:completion | completion | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)... | locals: optional extra data to send to templates ###
logger.verbose 'running with options:', {options: options}
# load templates & contents then render
async.waterfall [
(callback) ->
async.parallel
contents: async.apply loadContents, options.contents
templates: async.apply loadTemplat... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 4124dcacb31c836752d7d48cf8b922aa4b7f9cfb | 3,484 | https://github.com/jnordberg/wintersmith/blob/4124dcacb31c836752d7d48cf8b922aa4b7f9cfb/src/index.coffee | 1 | 47 |
jnordberg/wintersmith:src/index.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)... | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64 | 3,484 | https://github.com/jnordberg/wintersmith/blob/98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64/src/index.coffee | 1 | 46 | ||
jnordberg/wintersmith:src/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default pl... | var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} = require('./content'));
({TemplatePlugin, loadTemplat... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/index.coffee | MIT | 98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64 | 3,484 | https://github.com/jnordberg/wintersmith/blob/98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64/src/index.coffee | 1 | 46 |
jnordberg/wintersmith:src/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContentPlugin, ContentTree, TemplatePlugin, async, loadContents, loadTemplates, logger, registerContentPlugin, registerTemplatePlugin, renderer;
async = require('async');
({logger} = require('./common'));
({ContentTree, ContentPlugin, registerContentPlugin} ... | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64 | 3,484 | https://github.com/jnordberg/wintersmith/blob/98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64/src/index.coffee | 1 | 46 |
jnordberg/wintersmith:src/index.coffee:1:completion | completion | async = require 'async'
{logger} = require './common'
{ContentTree, ContentPlugin, registerContentPlugin} = require './content'
{TemplatePlugin, loadTemplates, registerTemplatePlugin} = require './templates'
renderer = require './renderer'
# register default plugins
registerContentPlugin 'pages', '**/*.*(markdown|md)... | logger.verbose 'running with options:', {options: options}
# load templates & contents then render
async.waterfall [
(callback) ->
async.parallel
contents: async.apply loadContents, options.contents
templates: async.apply loadTemplates, options.templates
, callback
(result, call... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | 98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64 | 3,484 | https://github.com/jnordberg/wintersmith/blob/98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64/src/index.coffee | 1 | 46 |
jnordberg/wintersmith:src/index.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{logger} = require './common'
{Resource, Page, ContentTree} = require './content'
{loadTemplates} = require './templates'
renderer = require './renderer'
loadContents = (location, callback) ->
### traverse *location* and return a tree of contents ###
logger.verbose "loading contents in #{ ... | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/index.coffee | 1 | 40 | ||
jnordberg/wintersmith:src/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
{logger} = require './common'
{Resource, Page, ContentTree} = require './content'
{loadTemplates} = require './templates'
renderer = require './renderer'
loadContents = (location, callback) ->
### traverse *location* and return a tree ... | var ContentTree, Page, Resource, async, loadContents, loadTemplates, logger, renderer;
async = require('async');
({logger} = require('./common'));
({Resource, Page, ContentTree} = require('./content'));
({loadTemplates} = require('./templates'));
renderer = require('./renderer');
loadContents = function(location,... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/index.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/index.coffee | 1 | 40 |
jnordberg/wintersmith:src/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContentTree, Page, Resource, async, loadContents, loadTemplates, logger, renderer;
async = require('async');
({logger} = require('./common'));
({Resource, Page, ContentTree} = require('./content'));
({loadTemplates} = require('./templates'));
renderer = re... | async = require 'async'
{logger} = require './common'
{Resource, Page, ContentTree} = require './content'
{loadTemplates} = require './templates'
renderer = require './renderer'
loadContents = (location, callback) ->
### traverse *location* and return a tree of contents ###
logger.verbose "loading contents in #{ ... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/index.coffee | 1 | 40 |
jnordberg/wintersmith:src/index.coffee:1:completion | completion | async = require 'async'
{logger} = require './common'
{Resource, Page, ContentTree} = require './content'
{loadTemplates} = require './templates'
renderer = require './renderer'
loadContents = (location, callback) ->
### traverse *location* and return a tree of contents ###
logger.verbose "loading contents in #{ ... | logger.verbose 'running with options:', {options: options}
# load templates & contents then render
async.waterfall [
(callback) ->
async.parallel
contents: async.apply loadContents, options.contents
templates: async.apply loadTemplates, options.templates
, callback
(result, call... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/index.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/index.coffee | 1 | 40 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:raw_corpus | raw_corpus | class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 60
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
@_step = 0.0
# Current time.
@_clock = null
# T... | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 3 | 52 | ||
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 60
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
... | var Physics;
Physics = class Physics {
constructor(integrator = new Euler()) {
this.integrator = integrator;
// Fixed timestep.
this.timestep = 1.0 / 60;
// Friction within the system.
this.viscosity = 0.005;
// Global behaviours.
this.behaviours = [];
// Time in seconds.
this._ti... | CoffeeScript | JavaScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 3 | 52 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Physics;
Physics = class Physics {
constructor(integrator = new Euler()) {
this.integrator = integrator;
// Fixed timestep.
this.timestep = 1.0 / 60;
// Friction within the system.
this.viscosity = 0.005;
// Global behaviours.
thi... | class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 60
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
@_step = 0.0
# Current time.
@_clock = null
# T... | JavaScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 3 | 52 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:completion | completion | class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 60
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
@_step = 0.0
# Current time.
@_clock = null
# T... | # Max iterations per step.
@_maxSteps = 4
# Particles in system.
@particles = []
# Springs in system.
@springs = []
### Performs a numerical integration step. ###
integrate: (dt) ->
# Drag is inversely proportional to viscosity.
drag = 1.0 - @viscosity
# Update particles / apply behaviours.
fo... | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 3 | 52 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:2:raw_corpus | raw_corpus | # Integrate motion.
@integrator.integrate @particles, dt, drag
# Compute all springs.
for spring in @springs
spring.apply()
### Steps the system. ###
step: ->
# Initialise the clock on first step.
@_clock ?= new Date().getTime()
# Compute delta time since last step.
time = new Date().getTime()... | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 53 | 102 | ||
soulwire/Coffee-Physics:source/engine/Physics.coffee:2:completion | completion | # Integrate motion.
@integrator.integrate @particles, dt, drag
# Compute all springs.
for spring in @springs
spring.apply()
### Steps the system. ###
step: ->
# Initialise the clock on first step.
@_clock ?= new Date().getTime()
# Compute delta time since last step.
time = new Date().getTime()... | # Update the clock.
@_clock = time
# Increment time buffer.
@_buffer += delta
# Integrate until the buffer is empty or until the
# maximum amount of iterations per step is reached.
i = 0
while @_buffer >= @timestep and ++i < @_maxSteps
# Integrate motion by fixed timestep.
@integrate @timestep
... | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 53 | 102 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:3:raw_corpus | raw_corpus | ### Clean up after yourself. ###
destroy: ->
@integrator = null
@particles = null
@springs = null | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 103 | 109 | ||
soulwire/Coffee-Physics:source/engine/Physics.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
### Clean up after yourself. ###
destroy: ->
@integrator = null
@particles = null
@springs = null
``` | /* Clean up after yourself. */
({
destroy: function() {
this.integrator = null;
this.particles = null;
return this.springs = null;
}
}); | CoffeeScript | JavaScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 103 | 109 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/* Clean up after yourself. */
({
destroy: function() {
this.integrator = null;
this.particles = null;
return this.springs = null;
}
});
``` | ### Clean up after yourself. ###
destroy: ->
@integrator = null
@particles = null
@springs = null | JavaScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 103 | 109 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:3:completion | completion | ### Clean up after yourself. ###
destroy: -> | @integrator = null
@particles = null
@springs = null | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/engine/Physics.coffee | 103 | 109 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:raw_corpus | raw_corpus | class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 120
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
@_step = 0.0
# Current time.
@_clock = null
# ... | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | c6dd1005d54eb52f41702ef54077f1ee6bbbabd0 | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/c6dd1005d54eb52f41702ef54077f1ee6bbbabd0/source/engine/Physics.coffee | 3 | 52 | ||
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 120
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.... | var Physics;
Physics = class Physics {
constructor(integrator = new Euler()) {
this.integrator = integrator;
// Fixed timestep.
this.timestep = 1.0 / 120;
// Friction within the system.
this.viscosity = 0.005;
// Global behaviours.
this.behaviours = [];
// Time in seconds.
this._t... | CoffeeScript | JavaScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | c6dd1005d54eb52f41702ef54077f1ee6bbbabd0 | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/c6dd1005d54eb52f41702ef54077f1ee6bbbabd0/source/engine/Physics.coffee | 3 | 52 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Physics;
Physics = class Physics {
constructor(integrator = new Euler()) {
this.integrator = integrator;
// Fixed timestep.
this.timestep = 1.0 / 120;
// Friction within the system.
this.viscosity = 0.005;
// Global behaviours.
th... | class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 120
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
@_step = 0.0
# Current time.
@_clock = null
# ... | JavaScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | c6dd1005d54eb52f41702ef54077f1ee6bbbabd0 | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/c6dd1005d54eb52f41702ef54077f1ee6bbbabd0/source/engine/Physics.coffee | 3 | 52 |
soulwire/Coffee-Physics:source/engine/Physics.coffee:1:completion | completion | class Physics
constructor: (@integrator = new Euler()) ->
# Fixed timestep.
@timestep = 1.0 / 120
# Friction within the system.
@viscosity = 0.005
# Global behaviours.
@behaviours = []
# Time in seconds.
@_time = 0.0
# Last step duration.
@_step = 0.0
# Current time.
@_clock = null
# ... | # Max iterations per step.
@_maxSteps = 10
# Particles in system.
@particles = []
# Springs in system.
@springs = []
### Performs a numerical integration step. ###
integrate: (dt) ->
# Drag is inversely proportional to viscosity.
drag = 1.0 - @viscosity
# Update particles / apply behaviours.
f... | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/engine/Physics.coffee | MIT | c6dd1005d54eb52f41702ef54077f1ee6bbbabd0 | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/c6dd1005d54eb52f41702ef54077f1ee6bbbabd0/source/engine/Physics.coffee | 3 | 52 |
jianliaoim/talk-os:talk-web/client/module/creator-info.coffee:1:raw_corpus | raw_corpus | cx = require 'classnames'
React = require 'react'
lang = require '../locales/lang'
time = require '../util/time'
Avatar = React.createFactory require '../module/avatar'
{ h4, div, noscript } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'creator-info'
propTypes:
name: T.st... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/creator-info.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/creator-info.coffee | 1 | 29 | ||
jianliaoim/talk-os:talk-web/client/module/creator-info.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
cx = require 'classnames'
React = require 'react'
lang = require '../locales/lang'
time = require '../util/time'
Avatar = React.createFactory require '../module/avatar'
{ h4, div, noscript } = React.DOM
T = React.PropTypes
module.exports = React.createClass
... | var Avatar, React, T, cx, div, h4, lang, noscript, time;
cx = require('classnames');
React = require('react');
lang = require('../locales/lang');
time = require('../util/time');
Avatar = React.createFactory(require('../module/avatar'));
({h4, div, noscript} = React.DOM);
T = React.PropTypes;
module.exports = Re... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/creator-info.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/creator-info.coffee | 1 | 29 |
jianliaoim/talk-os:talk-web/client/module/creator-info.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Avatar, React, T, cx, div, h4, lang, noscript, time;
cx = require('classnames');
React = require('react');
lang = require('../locales/lang');
time = require('../util/time');
Avatar = React.createFactory(require('../module/avatar'));
({h4, div, noscript} =... | cx = require 'classnames'
React = require 'react'
lang = require '../locales/lang'
time = require '../util/time'
Avatar = React.createFactory require '../module/avatar'
{ h4, div, noscript } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'creator-info'
propTypes:
name: T.st... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/creator-info.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/creator-info.coffee | 1 | 29 |
jianliaoim/talk-os:talk-web/client/module/creator-info.coffee:1:completion | completion | cx = require 'classnames'
React = require 'react'
lang = require '../locales/lang'
time = require '../util/time'
Avatar = React.createFactory require '../module/avatar'
{ h4, div, noscript } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'creator-info' | propTypes:
name: T.string
avatarUrl: T.string
className: T.string
createTime: T.string
getDefaultProps: ->
name: ''
avatarUrl: ''
render: ->
div className: cx('creator-info', @props.className),
Avatar src: @props.avatarUrl, size: 'normal', shape: 'round'
h4 className: 'name... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/creator-info.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/creator-info.coffee | 1 | 29 |
f/omelette:index.coffee:1:raw_corpus | raw_corpus | fs = require "fs"
omelette = require "./omelette"
# Write your CLI template.
complete = omelette "github <action> <user> <repo>"
# Bind events for every template part.
complete.on "action", ->
complete.reply [
"clone"
"update"
"push"
]
complete.on "user", (action)->
complete.reply fs.readdirSync "/... | CoffeeScript | f/omelette | index.coffee | MIT | 795e75a707f1990efac4898b6177078b1531a514 | 1,406 | https://github.com/f/omelette/blob/795e75a707f1990efac4898b6177078b1531a514/index.coffee | 1 | 24 | ||
f/omelette:index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require "fs"
omelette = require "./omelette"
# Write your CLI template.
complete = omelette "github <action> <user> <repo>"
# Bind events for every template part.
complete.on "action", ->
complete.reply [
"clone"
"update"
"push"
]
complete... | var complete, fs, omelette;
fs = require("fs");
omelette = require("./omelette");
// Write your CLI template.
complete = omelette("github <action> <user> <repo>");
// Bind events for every template part.
complete.on("action", function() {
return complete.reply(["clone", "update", "push"]);
});
complete.on("user"... | CoffeeScript | JavaScript | f/omelette | index.coffee | MIT | 795e75a707f1990efac4898b6177078b1531a514 | 1,406 | https://github.com/f/omelette/blob/795e75a707f1990efac4898b6177078b1531a514/index.coffee | 1 | 24 |
f/omelette:index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var complete, fs, omelette;
fs = require("fs");
omelette = require("./omelette");
// Write your CLI template.
complete = omelette("github <action> <user> <repo>");
// Bind events for every template part.
complete.on("action", function() {
return complete.repl... | fs = require "fs"
omelette = require "./omelette"
# Write your CLI template.
complete = omelette "github <action> <user> <repo>"
# Bind events for every template part.
complete.on "action", ->
complete.reply [
"clone"
"update"
"push"
]
complete.on "user", (action)->
complete.reply fs.readdirSync "/... | JavaScript | CoffeeScript | f/omelette | index.coffee | MIT | 795e75a707f1990efac4898b6177078b1531a514 | 1,406 | https://github.com/f/omelette/blob/795e75a707f1990efac4898b6177078b1531a514/index.coffee | 1 | 24 |
f/omelette:index.coffee:1:completion | completion | fs = require "fs"
omelette = require "./omelette"
# Write your CLI template.
complete = omelette "github <action> <user> <repo>"
# Bind events for every template part.
complete.on "action", ->
complete.reply [
"clone"
"update"
"push" | ]
complete.on "user", (action)->
complete.reply fs.readdirSync "/Users/"
complete.on "repo", (user)->
complete.reply [
"http://github.com/#{user}/helloworld"
"http://github.com/#{user}/blabla"
]
complete.init() | CoffeeScript | CoffeeScript | f/omelette | index.coffee | MIT | 795e75a707f1990efac4898b6177078b1531a514 | 1,406 | https://github.com/f/omelette/blob/795e75a707f1990efac4898b6177078b1531a514/index.coffee | 1 | 24 |
js2coffee/js2coffee:test/walker.coffee:1:raw_corpus | raw_corpus | require 'coffee-script/register'
require './setup'
describe 'Walker', ->
Walker = require('../lib/walker')
it 'works', ->
ast =
type: 'Program'
body: { type: 'Identifier', value: 'hi' }
class MyWalker extends Walker
Program: (node) -> @walk node.body
Identifier: (node) -> node.val... | CoffeeScript | js2coffee/js2coffee | test/walker.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/walker.coffee | 1 | 17 | ||
js2coffee/js2coffee:test/walker.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'coffee-script/register'
require './setup'
describe 'Walker', ->
Walker = require('../lib/walker')
it 'works', ->
ast =
type: 'Program'
body: { type: 'Identifier', value: 'hi' }
class MyWalker extends Walker
Program: (node... | require('coffee-script/register');
require('./setup');
describe('Walker', function() {
var Walker;
Walker = require('../lib/walker');
return it('works', function() {
var MyWalker, ast, output;
ast = {
type: 'Program',
body: {
type: 'Identifier',
value: 'hi'
}
};
... | CoffeeScript | JavaScript | js2coffee/js2coffee | test/walker.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/walker.coffee | 1 | 17 |
js2coffee/js2coffee:test/walker.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('coffee-script/register');
require('./setup');
describe('Walker', function() {
var Walker;
Walker = require('../lib/walker');
return it('works', function() {
var MyWalker, ast, output;
ast = {
type: 'Program',
body: {
typ... | require 'coffee-script/register'
require './setup'
describe 'Walker', ->
Walker = require('../lib/walker')
it 'works', ->
ast =
type: 'Program'
body: { type: 'Identifier', value: 'hi' }
class MyWalker extends Walker
Program: (node) -> @walk node.body
Identifier: (node) -> node.val... | JavaScript | CoffeeScript | js2coffee/js2coffee | test/walker.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/walker.coffee | 1 | 17 |
js2coffee/js2coffee:test/walker.coffee:1:completion | completion | require 'coffee-script/register'
require './setup'
describe 'Walker', ->
Walker = require('../lib/walker')
it 'works', ->
ast = | type: 'Program'
body: { type: 'Identifier', value: 'hi' }
class MyWalker extends Walker
Program: (node) -> @walk node.body
Identifier: (node) -> node.value
output = new MyWalker(ast).run()
expect(output).eql 'hi' | CoffeeScript | CoffeeScript | js2coffee/js2coffee | test/walker.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/walker.coffee | 1 | 17 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.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/services/services.loadService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# 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/licens... | /*
* 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 applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.loadService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* 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/li... | ###
# 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 ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.loadService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.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 ... | loadCssUrl: (url, permanent = false) ->
link = document.createElement("link")
link.type = "text/css"
link.rel = "stylesheet"
link.href = url
link.className = 'loadServiceAsset'
if !permanent then link.className += ' temporary'
document... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.loadService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.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/services/services.loadService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# 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/licens... | /*
* 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 applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.loadService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* 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/li... | ###
# 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 ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.loadService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.loadService.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 ... | loadCssUrl: (url, permanent = false) ->
link = document.createElement("link")
link.type = "text/css"
link.rel = "stylesheet"
link.href = url
link.className = 'loadServiceAsset'
if !permanent then link.className += ' temporary'
document... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.loadService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/common/services/services.loadService.coffee | 1 | 49 |
orktes/atom-react:spec/indent-spec.coffee:1:raw_corpus | raw_corpus | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/indent-spec.coffee | 1 | 35 | ||
orktes/atom-react:spec/indent-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString(... | describe("JSX indent", function() {
var buffer, editor, formattedFile, formattedLines, formattedSample, fs, languageMode, sampleFile;
fs = require('fs');
formattedFile = require.resolve('./fixtures/sample-formatted.jsx');
sampleFile = require.resolve('./fixtures/sample.jsx');
formattedSample = fs.readFileSync... | CoffeeScript | JavaScript | orktes/atom-react | spec/indent-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/indent-spec.coffee | 1 | 35 |
orktes/atom-react:spec/indent-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("JSX indent", function() {
var buffer, editor, formattedFile, formattedLines, formattedSample, fs, languageMode, sampleFile;
fs = require('fs');
formattedFile = require.resolve('./fixtures/sample-formatted.jsx');
sampleFile = require.resolve('./fix... | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | JavaScript | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/indent-spec.coffee | 1 | 35 |
orktes/atom-react:spec/indent-spec.coffee:1:completion | completion | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | waitsForPromise ->
atom.packages.activatePackage("react")
afterEach ->
atom.packages.deactivatePackages()
atom.packages.unloadPackages()
runs ->
grammar = atom.grammars.grammarForScopeName("source.js.jsx")
editor.setGrammar(grammar);
describe "should indent sample file correct... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/indent-spec.coffee | 1 | 35 |
orktes/atom-react:spec/indent-spec.coffee:1:raw_corpus | raw_corpus | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 3b3119407e6de87e96fc259b66602e61eb51e561 | 473 | https://github.com/orktes/atom-react/blob/3b3119407e6de87e96fc259b66602e61eb51e561/spec/indent-spec.coffee | 1 | 35 | ||
orktes/atom-react:spec/indent-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString(... | describe("JSX indent", function() {
var buffer, editor, formattedFile, formattedLines, formattedSample, fs, languageMode, sampleFile;
fs = require('fs');
formattedFile = require.resolve('./fixtures/sample-formatted.jsx');
sampleFile = require.resolve('./fixtures/sample.jsx');
formattedSample = fs.readFileSync... | CoffeeScript | JavaScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 3b3119407e6de87e96fc259b66602e61eb51e561 | 473 | https://github.com/orktes/atom-react/blob/3b3119407e6de87e96fc259b66602e61eb51e561/spec/indent-spec.coffee | 1 | 35 |
orktes/atom-react:spec/indent-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("JSX indent", function() {
var buffer, editor, formattedFile, formattedLines, formattedSample, fs, languageMode, sampleFile;
fs = require('fs');
formattedFile = require.resolve('./fixtures/sample-formatted.jsx');
sampleFile = require.resolve('./fix... | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | JavaScript | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 3b3119407e6de87e96fc259b66602e61eb51e561 | 473 | https://github.com/orktes/atom-react/blob/3b3119407e6de87e96fc259b66602e61eb51e561/spec/indent-spec.coffee | 1 | 35 |
orktes/atom-react:spec/indent-spec.coffee:1:completion | completion | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | waitsForPromise ->
atom.packages.activatePackage("react")
afterEach ->
atom.packages.deactivatePackages()
atom.packages.unloadPackages()
runs ->
grammar = atom.grammars.grammarForScopeName("source.js.jsx")
editor.setGrammar(grammar);
describe "should indent sample file correct... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 3b3119407e6de87e96fc259b66602e61eb51e561 | 473 | https://github.com/orktes/atom-react/blob/3b3119407e6de87e96fc259b66602e61eb51e561/spec/indent-spec.coffee | 1 | 35 |
orktes/atom-react:spec/indent-spec.coffee:1:raw_corpus | raw_corpus | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 43ebac43731fd7e4c732589b7f206261518290af | 473 | https://github.com/orktes/atom-react/blob/43ebac43731fd7e4c732589b7f206261518290af/spec/indent-spec.coffee | 1 | 36 | ||
orktes/atom-react:spec/indent-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString(... | describe("JSX indent", function() {
var buffer, editor, formattedFile, formattedLines, formattedSample, fs, languageMode, sampleFile;
fs = require('fs');
formattedFile = require.resolve('./fixtures/sample-formatted.jsx');
sampleFile = require.resolve('./fixtures/sample.jsx');
formattedSample = fs.readFileSync... | CoffeeScript | JavaScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 43ebac43731fd7e4c732589b7f206261518290af | 473 | https://github.com/orktes/atom-react/blob/43ebac43731fd7e4c732589b7f206261518290af/spec/indent-spec.coffee | 1 | 36 |
orktes/atom-react:spec/indent-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("JSX indent", function() {
var buffer, editor, formattedFile, formattedLines, formattedSample, fs, languageMode, sampleFile;
fs = require('fs');
formattedFile = require.resolve('./fixtures/sample-formatted.jsx');
sampleFile = require.resolve('./fix... | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | JavaScript | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 43ebac43731fd7e4c732589b7f206261518290af | 473 | https://github.com/orktes/atom-react/blob/43ebac43731fd7e4c732589b7f206261518290af/spec/indent-spec.coffee | 1 | 36 |
orktes/atom-react:spec/indent-spec.coffee:1:completion | completion | describe "JSX indent", ->
fs = require 'fs'
formattedFile = require.resolve './fixtures/sample-formatted.jsx'
sampleFile = require.resolve './fixtures/sample.jsx'
formattedSample = fs.readFileSync formattedFile
formattedLines = formattedSample.toString().split '\n'
[editor, buffer, languageMode] = []
aft... | atom.packages.activatePackage("react")
afterEach ->
atom.packages.deactivatePackages()
atom.packages.unloadPackages()
runs ->
grammar = atom.grammars.grammarForScopeName("source.js.jsx")
editor.setGrammar(grammar);
describe "should indent sample file correctly", ->
it "autoInden... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/indent-spec.coffee | MIT | 43ebac43731fd7e4c732589b7f206261518290af | 473 | https://github.com/orktes/atom-react/blob/43ebac43731fd7e4c732589b7f206261518290af/spec/indent-spec.coffee | 1 | 36 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:raw_corpus | raw_corpus | TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
# Updates equals to their CoffeeScript equiv... | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/binary.coffee | 1 | 50 | ||
js2coffee/js2coffee:lib/transforms/binary.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(no... | var TransformerBase;
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
BinaryExpression(node) {
this.warnAboutEquals(node);
this.updateEquals(node);
return this.escapeEqualsForCompatibility(node);
}
/*
... | CoffeeScript | JavaScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TransformerBase;
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
BinaryExpression(node) {
this.warnAboutEquals(node);
this.updateEquals(node);
retu... | TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
# Updates equals to their CoffeeScript equiv... | JavaScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:completion | completion | TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
# Updates equals to their CoffeeScript equiv... | escapeEqualsForCompatibility: (node) ->
isIncompatible =
node.operator is '==' or
node.operator is '!='
if @options.compat and isIncompatible
@escapeJs node
else
node
###
# Fire warnings when '==' is used
###
warnAboutEquals: (node) ->
op = node.operator
replacemen... | CoffeeScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:raw_corpus | raw_corpus | { escapeJs, replace } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
... | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 28f62bce9cb81d9f9cc220abbb9e03842d456e88 | 2,082 | https://github.com/js2coffee/js2coffee/blob/28f62bce9cb81d9f9cc220abbb9e03842d456e88/lib/transforms/binary.coffee | 1 | 50 | ||
js2coffee/js2coffee:lib/transforms/binary.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{ escapeJs, replace } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEqu... | var TransformerBase, escapeJs, replace;
({escapeJs, replace} = require('../helpers'));
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
BinaryExpression(node) {
this.warnAboutEquals(node);
this.updateEquals(nod... | CoffeeScript | JavaScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 28f62bce9cb81d9f9cc220abbb9e03842d456e88 | 2,082 | https://github.com/js2coffee/js2coffee/blob/28f62bce9cb81d9f9cc220abbb9e03842d456e88/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TransformerBase, escapeJs, replace;
({escapeJs, replace} = require('../helpers'));
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
BinaryExpression(node) {
... | { escapeJs, replace } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
... | JavaScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 28f62bce9cb81d9f9cc220abbb9e03842d456e88 | 2,082 | https://github.com/js2coffee/js2coffee/blob/28f62bce9cb81d9f9cc220abbb9e03842d456e88/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:completion | completion | { escapeJs, replace } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
... | if dict[op] then node.operator = dict[op]
node
escapeEqualsForCompatibility: (node) ->
isIncompatible =
node.operator is '==' or
node.operator is '!='
if @options.compat and isIncompatible
escapeJs node
else
node
###
# Fire warnings when '==' is used
###
warnAboutEq... | CoffeeScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 28f62bce9cb81d9f9cc220abbb9e03842d456e88 | 2,082 | https://github.com/js2coffee/js2coffee/blob/28f62bce9cb81d9f9cc220abbb9e03842d456e88/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:raw_corpus | raw_corpus | { reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(n... | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 29b7ec2366d35545ebdbc6ebda9309c71149cf4e | 2,082 | https://github.com/js2coffee/js2coffee/blob/29b7ec2366d35545ebdbc6ebda9309c71149cf4e/lib/transforms/binary.coffee | 1 | 50 | ||
js2coffee/js2coffee:lib/transforms/binary.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{ reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
... | var TransformerBase, quote, replace, reservedWords;
({reservedWords, replace, quote} = require('../helpers'));
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
BinaryExpression(node) {
this.warnAboutEquals(node);
... | CoffeeScript | JavaScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 29b7ec2366d35545ebdbc6ebda9309c71149cf4e | 2,082 | https://github.com/js2coffee/js2coffee/blob/29b7ec2366d35545ebdbc6ebda9309c71149cf4e/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TransformerBase, quote, replace, reservedWords;
({reservedWords, replace, quote} = require('../helpers'));
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
Bin... | { reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(n... | JavaScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 29b7ec2366d35545ebdbc6ebda9309c71149cf4e | 2,082 | https://github.com/js2coffee/js2coffee/blob/29b7ec2366d35545ebdbc6ebda9309c71149cf4e/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:completion | completion | { reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@warnAboutEquals(node)
@updateEquals(node)
@escapeEqualsForCompatibility(n... | node
escapeEqualsForCompatibility: (node) ->
isIncompatible =
node.operator is '==' or
node.operator is '!='
return node unless @options.compat
return node unless isIncompatible
if @options.compat
replace node,
type: 'CoffeeEscapedExpression'
raw: require('escodege... | CoffeeScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 29b7ec2366d35545ebdbc6ebda9309c71149cf4e | 2,082 | https://github.com/js2coffee/js2coffee/blob/29b7ec2366d35545ebdbc6ebda9309c71149cf4e/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:2:raw_corpus | raw_corpus | @warn node, "Operator '#{op}' is not supported in CoffeeScript, " +
"use '#{repl}' instead"
node | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | 29b7ec2366d35545ebdbc6ebda9309c71149cf4e | 2,082 | https://github.com/js2coffee/js2coffee/blob/29b7ec2366d35545ebdbc6ebda9309c71149cf4e/lib/transforms/binary.coffee | 51 | 54 | ||
js2coffee/js2coffee:lib/transforms/binary.coffee:1:raw_corpus | raw_corpus | { reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
# Updates equ... | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | eb538dbd6163a3c74fc056afb160bd7616cd70c6 | 2,082 | https://github.com/js2coffee/js2coffee/blob/eb538dbd6163a3c74fc056afb160bd7616cd70c6/lib/transforms/binary.coffee | 1 | 50 | ||
js2coffee/js2coffee:lib/transforms/binary.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{ reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@updateEquals(node)
@... | var TransformerBase, quote, replace, reservedWords;
({reservedWords, replace, quote} = require('../helpers'));
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
BinaryExpression(node) {
this.updateEquals(node);
... | CoffeeScript | JavaScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | eb538dbd6163a3c74fc056afb160bd7616cd70c6 | 2,082 | https://github.com/js2coffee/js2coffee/blob/eb538dbd6163a3c74fc056afb160bd7616cd70c6/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TransformerBase, quote, replace, reservedWords;
({reservedWords, replace, quote} = require('../helpers'));
TransformerBase = require('./base');
/*
* Mangles the AST with various CoffeeScript tweaks.
*/
module.exports = class extends TransformerBase {
Bin... | { reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
# Updates equ... | JavaScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | eb538dbd6163a3c74fc056afb160bd7616cd70c6 | 2,082 | https://github.com/js2coffee/js2coffee/blob/eb538dbd6163a3c74fc056afb160bd7616cd70c6/lib/transforms/binary.coffee | 1 | 50 |
js2coffee/js2coffee:lib/transforms/binary.coffee:1:completion | completion | { reservedWords, replace, quote } = require('../helpers')
TransformerBase = require('./base')
###
# Mangles the AST with various CoffeeScript tweaks.
###
module.exports = class extends TransformerBase
BinaryExpression: (node) ->
@updateEquals(node)
@escapeEqualsForCompatibility(node)
###
# Updates equ... | escapeEqualsForCompatibility: (node) ->
isIncompatible =
node.operator is '==' or
node.operator is '!='
return node unless isIncompatible
if @options.compat
replace node,
type: 'CoffeeEscapedExpression'
raw: require('escodegen').generate(node)
else
@warnAboutEqu... | CoffeeScript | CoffeeScript | js2coffee/js2coffee | lib/transforms/binary.coffee | MIT | eb538dbd6163a3c74fc056afb160bd7616cd70c6 | 2,082 | https://github.com/js2coffee/js2coffee/blob/eb538dbd6163a3c74fc056afb160bd7616cd70c6/lib/transforms/binary.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:test/guards/beginwithcallback.coffee:1:raw_corpus | raw_corpus | suite 'begin() with callbacks Guards:', ->
test 'node', ->
testCases = [
() -> doc(() ->).node()
() -> doc(() ->).node('root1').up().node('root2')
() -> doc(() ->).node('root').ele('node').up().att('att', 'val')
() -> doc(() ->).node('root').dec()
() -> doc(() ->).dtd()
() -> d... | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/beginwithcallback.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/beginwithcallback.coffee | 1 | 27 | ||
oozcitak/xmlbuilder-js:test/guards/beginwithcallback.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'begin() with callbacks Guards:', ->
test 'node', ->
testCases = [
() -> doc(() ->).node()
() -> doc(() ->).node('root1').up().node('root2')
() -> doc(() ->).node('root').ele('node').up().att('att', 'val')
() -> doc(() ->).node... | suite('begin() with callbacks Guards:', function() {
return test('node', function() {
var i, j, ref, results, results1, testCases;
testCases = [
function() {
return doc(function() {}).node();
},
function() {
return doc(function() {}).node('root1').up().node('root2');
},... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/guards/beginwithcallback.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/beginwithcallback.coffee | 1 | 27 |
oozcitak/xmlbuilder-js:test/guards/beginwithcallback.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('begin() with callbacks Guards:', function() {
return test('node', function() {
var i, j, ref, results, results1, testCases;
testCases = [
function() {
return doc(function() {}).node();
},
function() {
return doc(fu... | suite 'begin() with callbacks Guards:', ->
test 'node', ->
testCases = [
() -> doc(() ->).node()
() -> doc(() ->).node('root1').up().node('root2')
() -> doc(() ->).node('root').ele('node').up().att('att', 'val')
() -> doc(() ->).node('root').dec()
() -> doc(() ->).dtd()
() -> d... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/beginwithcallback.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/beginwithcallback.coffee | 1 | 27 |
oozcitak/xmlbuilder-js:test/guards/beginwithcallback.coffee:1:completion | completion | suite 'begin() with callbacks Guards:', ->
test 'node', ->
testCases = [
() -> doc(() ->).node()
() -> doc(() ->).node('root1').up().node('root2')
() -> doc(() ->).node('root').ele('node').up().att('att', 'val')
() -> doc(() ->).node('root').dec()
() -> doc(() ->).dtd()
() -> d... | "Missing node name."
"Document can only have one root node. node: <root2>"
"att() can only be used immediately after an ele() call in callback mode. node: <att>"
"declaration() must be the first node."
"Missing root node name."
"dtd() must come before the root node."
"The document no... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/beginwithcallback.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/beginwithcallback.coffee | 1 | 27 |
jashkenas/coffeescript:test/javascript_literals.coffee:1:raw_corpus | raw_corpus | # JavaScript Literals
# -------------------
test "inline JavaScript is evaluated", ->
eq '\\`', `
// Inline JS
"\\\\\`"
`
test "escaped backticks are output correctly", ->
`var a = \`2 + 2 = ${4}\``
eq a, '2 + 2 = 4'
test "backslashes before a newline don’t break JavaScript blocks", ->
`var a = \`T... | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 1 | 50 | ||
jashkenas/coffeescript:test/javascript_literals.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# JavaScript Literals
# -------------------
test "inline JavaScript is evaluated", ->
eq '\\`', `
// Inline JS
"\\\\\`"
`
test "escaped backticks are output correctly", ->
`var a = \`2 + 2 = ${4}\``
eq a, '2 + 2 = 4'
test "backslashes before a ... | // JavaScript Literals
// -------------------
test("inline JavaScript is evaluated", function() {
return eq('\\`',
// Inline JS
"\\`"
);
});
test("escaped backticks are output correctly", function() {
var a = `2 + 2 = ${4}`;
return eq(a, '2 + 2 = 4');
});
test("backslashes before a newline don’t break... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 1 | 50 |
jashkenas/coffeescript:test/javascript_literals.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// JavaScript Literals
// -------------------
test("inline JavaScript is evaluated", function() {
return eq('\\`',
// Inline JS
"\\`"
);
});
test("escaped backticks are output correctly", function() {
var a = `2 + 2 = ${4}`;
return eq(a, '2 + 2 = 4... | # JavaScript Literals
# -------------------
test "inline JavaScript is evaluated", ->
eq '\\`', `
// Inline JS
"\\\\\`"
`
test "escaped backticks are output correctly", ->
`var a = \`2 + 2 = ${4}\``
eq a, '2 + 2 = 4'
test "backslashes before a newline don’t break JavaScript blocks", ->
`var a = \`T... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 1 | 50 |
jashkenas/coffeescript:test/javascript_literals.coffee:1:completion | completion | # JavaScript Literals
# -------------------
test "inline JavaScript is evaluated", ->
eq '\\`', `
// Inline JS
"\\\\\`"
`
test "escaped backticks are output correctly", ->
`var a = \`2 + 2 = ${4}\``
eq a, '2 + 2 = 4'
test "backslashes before a newline don’t break JavaScript blocks", ->
`var a = \`T... | c = 3
```var d = 4;```
eq a + b + c + d, 10
test "block inline JavaScript containing backticks", ->
```
// This is a comment with `backticks`
var a = 42;
var b = `foo ${'bar'}`;
var c = 3;
var d = 'foo`bar`';
```
eq a + c, 45
eq b, 'foo bar'
eq d, 'foo`bar`'
test "block JavaScript can end with... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 1 | 50 |
jashkenas/coffeescript:test/javascript_literals.coffee:2:raw_corpus | raw_corpus | test "escaped JavaScript blocks speed round", ->
# The following has escaped backslashes because they’re required in strings, but the intent is this:
# `hello` → hello;
# `\`hello\`` → `hello`;
# `\`Escaping backticks in JS: \\\`hello\\\`\`... | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 51 | 70 | ||
jashkenas/coffeescript:test/javascript_literals.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "escaped JavaScript blocks speed round", ->
# The following has escaped backslashes because they’re required in strings, but the intent is this:
# `hello` → hello;
# `\`hello\`` → ... | test("escaped JavaScript blocks speed round", function() {
var i, input, len, output, ref, results;
ref = [['`hello`', 'hello;'], ['`\\`hello\\``', '`hello`;'], ['`\\`Escaping backticks in JS: \\\\\\`hello\\\\\\`\\``', '`Escaping backticks in JS: \\`hello\\``;'], ['`Single backslash: \\ `', 'Single backslash: \\ ;'... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 51 | 70 |
jashkenas/coffeescript:test/javascript_literals.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test("escaped JavaScript blocks speed round", function() {
var i, input, len, output, ref, results;
ref = [['`hello`', 'hello;'], ['`\\`hello\\``', '`hello`;'], ['`\\`Escaping backticks in JS: \\\\\\`hello\\\\\\`\\``', '`Escaping backticks in JS: \\`hello\\``;'... | test "escaped JavaScript blocks speed round", ->
# The following has escaped backslashes because they’re required in strings, but the intent is this:
# `hello` → hello;
# `\`hello\`` → `hello`;
# `\`Escaping backticks in JS: \\\`hello\\\`\`... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 51 | 70 |
jashkenas/coffeescript:test/javascript_literals.coffee:2:completion | completion | test "escaped JavaScript blocks speed round", ->
# The following has escaped backslashes because they’re required in strings, but the intent is this:
# `hello` → hello;
# `\`hello\`` → `hello`;
# `\`Escaping backticks in JS: \\\`hello\\\`\`... | for [input, output] in [
['`hello`', 'hello;']
['`\\`hello\\``', '`hello`;']
['`\\`Escaping backticks in JS: \\\\\\`hello\\\\\\`\\``', '`Escaping backticks in JS: \\`hello\\``;']
['`Single backslash: \\ `', ... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/javascript_literals.coffee | 51 | 70 |
jashkenas/coffeescript:test/javascript_literals.coffee:2:raw_corpus | raw_corpus | test "escaped JavaScript blocks speed round", ->
# The following has escaped backslashes because they’re required in strings, but the intent is this:
# `hello` → hello;
# `\`hello\`` → `hello`;
# `\`Escaping backticks in JS: \\\`hello\\\`\`... | CoffeeScript | jashkenas/coffeescript | test/javascript_literals.coffee | MIT | 073e14746ef062566fc9224aced66714559e201b | 16,577 | https://github.com/jashkenas/coffeescript/blob/073e14746ef062566fc9224aced66714559e201b/test/javascript_literals.coffee | 51 | 70 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.