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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cdglabs/apparatus:src/Graphic/Graphic.coffee:15:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var getDummyCanvasCtx;
getDummyCanvasCtx = function() {
var dummyCanvas, dummyCanvasCtx;
if (dummyCanvasCtx) {
return dummyCanvasCtx;
}
dummyCanvas = document.createElement("canvas");
return dummyCanvasCtx = dummyCanvas.getContext("2d");
};
``` | getDummyCanvasCtx = ->
return dummyCanvasCtx if dummyCanvasCtx
dummyCanvas = document.createElement("canvas")
return dummyCanvasCtx = dummyCanvas.getContext("2d") | JavaScript | CoffeeScript | cdglabs/apparatus | src/Graphic/Graphic.coffee | MIT | 369fbd92d91fa1bfca8d44494fd3e5aac1da82fe | 1,052 | https://github.com/cdglabs/apparatus/blob/369fbd92d91fa1bfca8d44494fd3e5aac1da82fe/src/Graphic/Graphic.coffee | 203 | 206 |
cdglabs/apparatus:src/Graphic/Graphic.coffee:15:completion | completion | getDummyCanvasCtx = ->
return dummyCanvasCtx if dummyCanvasCtx | dummyCanvas = document.createElement("canvas")
return dummyCanvasCtx = dummyCanvas.getContext("2d") | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Graphic/Graphic.coffee | MIT | 369fbd92d91fa1bfca8d44494fd3e5aac1da82fe | 1,052 | https://github.com/cdglabs/apparatus/blob/369fbd92d91fa1bfca8d44494fd3e5aac1da82fe/src/Graphic/Graphic.coffee | 203 | 206 |
cdglabs/apparatus:src/Util/FirebasePromises.coffee:1:raw_corpus | raw_corpus | Firebase = require "firebase"
Q = require "q"
module.exports = FirebasePromises = {}
###
Simple non-Apparatus-specific promises for use with Firebase
###
# Like ref.authWithOAuthPopupPromise(provider, ..., options). Resolves to the
# auth data object if successful.
FirebasePromises.authWithOAuthPopupPromise = (re... | CoffeeScript | cdglabs/apparatus | src/Util/FirebasePromises.coffee | MIT | cb1562a30cc230e18aedef1c9b548deaebdebc08 | 1,052 | https://github.com/cdglabs/apparatus/blob/cb1562a30cc230e18aedef1c9b548deaebdebc08/src/Util/FirebasePromises.coffee | 1 | 50 | ||
cdglabs/apparatus:src/Util/FirebasePromises.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Firebase = require "firebase"
Q = require "q"
module.exports = FirebasePromises = {}
###
Simple non-Apparatus-specific promises for use with Firebase
###
# Like ref.authWithOAuthPopupPromise(provider, ..., options). Resolves to the
# auth data object if suc... | var Firebase, FirebasePromises, Q;
Firebase = require("firebase");
Q = require("q");
module.exports = FirebasePromises = {};
/*
Simple non-Apparatus-specific promises for use with Firebase
*/
// Like ref.authWithOAuthPopupPromise(provider, ..., options). Resolves to the
// auth data object if successful.
FirebasePr... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/FirebasePromises.coffee | MIT | cb1562a30cc230e18aedef1c9b548deaebdebc08 | 1,052 | https://github.com/cdglabs/apparatus/blob/cb1562a30cc230e18aedef1c9b548deaebdebc08/src/Util/FirebasePromises.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/FirebasePromises.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Firebase, FirebasePromises, Q;
Firebase = require("firebase");
Q = require("q");
module.exports = FirebasePromises = {};
/*
Simple non-Apparatus-specific promises for use with Firebase
*/
// Like ref.authWithOAuthPopupPromise(provider, ..., options). Resolv... | Firebase = require "firebase"
Q = require "q"
module.exports = FirebasePromises = {}
###
Simple non-Apparatus-specific promises for use with Firebase
###
# Like ref.authWithOAuthPopupPromise(provider, ..., options). Resolves to the
# auth data object if successful.
FirebasePromises.authWithOAuthPopupPromise = (re... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/FirebasePromises.coffee | MIT | cb1562a30cc230e18aedef1c9b548deaebdebc08 | 1,052 | https://github.com/cdglabs/apparatus/blob/cb1562a30cc230e18aedef1c9b548deaebdebc08/src/Util/FirebasePromises.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/FirebasePromises.coffee:1:completion | completion | Firebase = require "firebase"
Q = require "q"
module.exports = FirebasePromises = {}
###
Simple non-Apparatus-specific promises for use with Firebase
###
# Like ref.authWithOAuthPopupPromise(provider, ..., options). Resolves to the
# auth data object if successful.
FirebasePromises.authWithOAuthPopupPromise = (re... | # Like ref.once('value', ...). Resolves to the resulting data snapshot.
FirebasePromises.getValuePromise = (ref) ->
deferred = Q.defer()
successCallback = (dataSnapshot) ->
deferred.resolve(dataSnapshot)
failureCallback = (error) ->
deferred.reject(error)
ref.once('value', successCallback, failureCall... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/FirebasePromises.coffee | MIT | cb1562a30cc230e18aedef1c9b548deaebdebc08 | 1,052 | https://github.com/cdglabs/apparatus/blob/cb1562a30cc230e18aedef1c9b548deaebdebc08/src/Util/FirebasePromises.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/FirebasePromises.coffee:2:raw_corpus | raw_corpus | pushedRef = ref.push(value, onComplete)
return deferred.promise
# Like ref.set(value, ...). Resolves (to nothing) if the push is successful.
FirebasePromises.setPromise = (ref, value) ->
deferred = Q.defer()
# NOTE: non-traditional onComplete API
onComplete = (maybeError) ->
if maybeError
deferred... | CoffeeScript | cdglabs/apparatus | src/Util/FirebasePromises.coffee | MIT | cb1562a30cc230e18aedef1c9b548deaebdebc08 | 1,052 | https://github.com/cdglabs/apparatus/blob/cb1562a30cc230e18aedef1c9b548deaebdebc08/src/Util/FirebasePromises.coffee | 51 | 70 | ||
cdglabs/apparatus:src/Util/FirebasePromises.coffee:2:completion | completion | pushedRef = ref.push(value, onComplete)
return deferred.promise
# Like ref.set(value, ...). Resolves (to nothing) if the push is successful.
FirebasePromises.setPromise = (ref, value) ->
deferred = Q.defer() | # NOTE: non-traditional onComplete API
onComplete = (maybeError) ->
if maybeError
deferred.reject(maybeError)
else
deferred.resolve()
ref.set(value, onComplete)
return deferred.promise | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/FirebasePromises.coffee | MIT | cb1562a30cc230e18aedef1c9b548deaebdebc08 | 1,052 | https://github.com/cdglabs/apparatus/blob/cb1562a30cc230e18aedef1c9b548deaebdebc08/src/Util/FirebasePromises.coffee | 51 | 70 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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 ... | # Load user-specified format if defined
if !_.isEmpty($scope.widget.format)
$scope.format = _.jsExec $scope.widget.format
# Load user-specified time-zone if defined
if !_.isEmpty($scope.widget.timezone)
if moment.tz.zone($scope.widget.timezone)
$scope.timezone = _.jsExec $scope.... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.coffee:2:raw_corpus | raw_corpus | #
$scope.$on '$destroy', ->
if $scope.interval?
$interval.cancel $scope.interval
$scope.interval = null | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 51 | 55 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
$scope.$on '$destroy', ->
if $scope.interval?
$interval.cancel $scope.interval
$scope.interval = null
``` | $scope.$on('$destroy', function() {
if ($scope.interval != null) {
$interval.cancel($scope.interval);
return $scope.interval = null;
}
}); | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 51 | 55 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
$scope.$on('$destroy', function() {
if ($scope.interval != null) {
$interval.cancel($scope.interval);
return $scope.interval = null;
}
});
``` | #
$scope.$on '$destroy', ->
if $scope.interval?
$interval.cancel $scope.interval
$scope.interval = null | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 51 | 55 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.coffee:2:completion | completion | #
$scope.$on '$destroy', -> | if $scope.interval?
$interval.cancel $scope.interval
$scope.interval = null | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/clock/clockWidget.coffee | 51 | 55 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 256f6a920d88f621f87246096caaccefadb2b2b3 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/256f6a920d88f621f87246096caaccefadb2b2b3/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 256f6a920d88f621f87246096caaccefadb2b2b3 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/256f6a920d88f621f87246096caaccefadb2b2b3/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 256f6a920d88f621f87246096caaccefadb2b2b3 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/256f6a920d88f621f87246096caaccefadb2b2b3/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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 ... | # Load user-specified format if defined
if !_.isEmpty($scope.widget.format)
$scope.format = _.jsExec $scope.widget.format
# Load user-specified time-zone if defined
if !_.isEmpty($scope.widget.timezone)
if moment.tz.zone($scope.widget.timezone)
$scope.timezone = _.jsExec $scope.... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 256f6a920d88f621f87246096caaccefadb2b2b3 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/256f6a920d88f621f87246096caaccefadb2b2b3/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 43 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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 ... | $scope.widgetContext.allowExport = false
$scope.format = configService.widgets.clock.properties.format.default
# Load user-specified format if defined
if $scope.widget.format?
$scope.format = _.jsExec $scope.widget.format
# Schedule an update every second
$scope.updateTime = ->
$s... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 40 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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 ... | $scope.format = configService.widgets.clock.properties.format.default
# Load user-specified format if defined
if $scope.widget.format?
$scope.format = _.jsExec $scope.widget.format
# Schedule an update every second
$scope.updateTime = ->
$scope.currentTime = moment().format $scope.form... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 35 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 35 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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/widgets/clock/clockWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 35 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/clock/clockWidget.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 ... | # Clock Widget
#
cyclotronApp.controller 'ClockWidget', ($scope, $interval) ->
if _.isEmpty($scope.widget.format) then $scope.widget.format = 'dddd, MMMM Do YYYY, h:mm:ss a'
$scope.updateTime = ->
$scope.currentTime = moment().format $scope.widget.format
$scope.updateTime()
$scope.interval = $... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/clock/clockWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/clock/clockWidget.coffee | 1 | 35 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/build.coffee | 45 | 80 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if e... | var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputDir = env.resolvePath(env.config.output);
exists = f... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/build.coffee | 45 | 80 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputD... | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/build.coffee | 45 | 80 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | logger.verbose "creating output directory #{ outputDir }"
fs.mkdir outputDir, callback
async.waterfall [
(callback) -> loadEnv argv, callback
(env, callback) ->
prepareOutputDir env, (error) -> callback error, env
(env, callback) ->
env.build callback
], (error) ->
if error
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/build.coffee | 45 | 80 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | c4e53c1388d28d6ee42e712bce6bc8fcea175ba8 | 3,484 | https://github.com/jnordberg/wintersmith/blob/c4e53c1388d28d6ee42e712bce6bc8fcea175ba8/src/cli/build.coffee | 45 | 79 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if e... | var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputDir = env.resolvePath(env.config.output);
exists = f... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | c4e53c1388d28d6ee42e712bce6bc8fcea175ba8 | 3,484 | https://github.com/jnordberg/wintersmith/blob/c4e53c1388d28d6ee42e712bce6bc8fcea175ba8/src/cli/build.coffee | 45 | 79 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputD... | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | c4e53c1388d28d6ee42e712bce6bc8fcea175ba8 | 3,484 | https://github.com/jnordberg/wintersmith/blob/c4e53c1388d28d6ee42e712bce6bc8fcea175ba8/src/cli/build.coffee | 45 | 79 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | else
logger.verbose "creating output directory #{ outputDir }"
fs.mkdir outputDir, callback
async.waterfall [
(callback) -> loadEnv argv, callback
(env, callback) ->
prepareOutputDir env, (error) -> callback error, env
(env, callback) ->
env.build callback
], (error) ->
if e... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | c4e53c1388d28d6ee42e712bce6bc8fcea175ba8 | 3,484 | https://github.com/jnordberg/wintersmith/blob/c4e53c1388d28d6ee42e712bce6bc8fcea175ba8/src/cli/build.coffee | 45 | 79 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 43a30af7dec1af73ac52ac625a34539e93475306 | 3,484 | https://github.com/jnordberg/wintersmith/blob/43a30af7dec1af73ac52ac625a34539e93475306/src/cli/build.coffee | 45 | 79 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if e... | var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputDir = env.resolvePath(env.config.output);
exists = f... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 43a30af7dec1af73ac52ac625a34539e93475306 | 3,484 | https://github.com/jnordberg/wintersmith/blob/43a30af7dec1af73ac52ac625a34539e93475306/src/cli/build.coffee | 45 | 79 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputD... | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 43a30af7dec1af73ac52ac625a34539e93475306 | 3,484 | https://github.com/jnordberg/wintersmith/blob/43a30af7dec1af73ac52ac625a34539e93475306/src/cli/build.coffee | 45 | 79 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | else
logger.verbose "creating output directory #{ outputDir }"
fs.mkdir outputDir, callback
async.waterfall [
(callback) -> loadEnv argv, callback
(env, callback) ->
prepareOutputDir env, (error) -> callback error, env
(env, callback) ->
env.build callback
], (error) ->
if e... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 43a30af7dec1af73ac52ac625a34539e93475306 | 3,484 | https://github.com/jnordberg/wintersmith/blob/43a30af7dec1af73ac52ac625a34539e93475306/src/cli/build.coffee | 45 | 79 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | a3ce2fed749a3e075ca7233fe93f4be3f167a7f1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/a3ce2fed749a3e075ca7233fe93f4be3f167a7f1/src/cli/build.coffee | 45 | 78 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if e... | var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputDir = env.resolvePath(env.config.output);
exists = f... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | a3ce2fed749a3e075ca7233fe93f4be3f167a7f1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/a3ce2fed749a3e075ca7233fe93f4be3f167a7f1/src/cli/build.coffee | 45 | 78 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var prepareOutputDir, start;
start = new Date();
logger.info('building site');
prepareOutputDir = function(env, callback) {
var exists, outputDir;
// create clean and create output directory if needed
outputD... | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | a3ce2fed749a3e075ca7233fe93f4be3f167a7f1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/a3ce2fed749a3e075ca7233fe93f4be3f167a7f1/src/cli/build.coffee | 45 | 78 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
prepareOutputDir = (env, callback) ->
# create clean and create output directory if needed
outputDir = env.resolvePath env.config.output
exists = fileExistsSync outputDir
if exists
if argv.clean
logger.verbose "cleanin... | else
logger.verbose "creating output directory #{ outputDir }"
fs.mkdir outputDir, callback
async.waterfall [
(callback) -> loadEnv argv, callback
(env, callback) ->
prepareOutputDir env, (error) -> callback error, env
(env, callback) ->
env.build callback
], (error) ->
if e... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | a3ce2fed749a3e075ca7233fe93f4be3f167a7f1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/a3ce2fed749a3e075ca7233fe93f4be3f167a7f1/src/cli/build.coffee | 45 | 78 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
fileExists options.output, (exists) ->
... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 90c6dad170865ab8e94cc9f613210185a81946a7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/90c6dad170865ab8e94cc9f613210185a81946a7/src/cli/build.coffee | 45 | 81 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
... | var build;
build = function(argv) {
var start;
start = new Date();
logger.info('building site');
return async.waterfall([
// load options
async.apply(getOptions,
argv),
function(options,
callback) {
return async.waterfall([
function(callback) {
// create output dir i... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 90c6dad170865ab8e94cc9f613210185a81946a7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/90c6dad170865ab8e94cc9f613210185a81946a7/src/cli/build.coffee | 45 | 81 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var start;
start = new Date();
logger.info('building site');
return async.waterfall([
// load options
async.apply(getOptions,
argv),
function(options,
callback) {
return async.waterfall([
... | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
fileExists options.output, (exists) ->
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 90c6dad170865ab8e94cc9f613210185a81946a7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/90c6dad170865ab8e94cc9f613210185a81946a7/src/cli/build.coffee | 45 | 81 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
fileExists options.output, (exists) ->
... | if options.clean
logger.verbose "cleaning - running rimraf on #{ options.output }"
async.waterfall [
async.apply rimraf, options.output
async.apply fs.mkdir, options.output
], callback
else
callback()
(callback) ->
#... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 90c6dad170865ab8e94cc9f613210185a81946a7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/90c6dad170865ab8e94cc9f613210185a81946a7/src/cli/build.coffee | 45 | 81 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
path.exists options.output, (exists) ->
... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 0edc0a15f19af4f90acc42a8f27ed1d0ec061817 | 3,484 | https://github.com/jnordberg/wintersmith/blob/0edc0a15f19af4f90acc42a8f27ed1d0ec061817/src/cli/build.coffee | 44 | 80 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
... | var build;
build = function(argv) {
var start;
start = new Date();
logger.info('building site');
return async.waterfall([
// load options
async.apply(getOptions,
argv),
function(options,
callback) {
return async.waterfall([
function(callback) {
// create output dir i... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 0edc0a15f19af4f90acc42a8f27ed1d0ec061817 | 3,484 | https://github.com/jnordberg/wintersmith/blob/0edc0a15f19af4f90acc42a8f27ed1d0ec061817/src/cli/build.coffee | 44 | 80 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var start;
start = new Date();
logger.info('building site');
return async.waterfall([
// load options
async.apply(getOptions,
argv),
function(options,
callback) {
return async.waterfall([
... | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
path.exists options.output, (exists) ->
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 0edc0a15f19af4f90acc42a8f27ed1d0ec061817 | 3,484 | https://github.com/jnordberg/wintersmith/blob/0edc0a15f19af4f90acc42a8f27ed1d0ec061817/src/cli/build.coffee | 44 | 80 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
path.exists options.output, (exists) ->
... | if options.clean
logger.verbose "cleaning - running rimraf on #{ options.output }"
async.waterfall [
async.apply rimraf, options.output
async.apply fs.mkdir, options.output
], callback
else
callback()
(callback) ->
#... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 0edc0a15f19af4f90acc42a8f27ed1d0ec061817 | 3,484 | https://github.com/jnordberg/wintersmith/blob/0edc0a15f19af4f90acc42a8f27ed1d0ec061817/src/cli/build.coffee | 44 | 80 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
path.exists options.output, (exists) ->
... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/cli/build.coffee | 44 | 82 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
... | var build;
build = function(argv) {
var start;
start = new Date();
logger.info('building site');
return async.waterfall([
// load options
async.apply(getOptions,
argv),
function(options,
callback) {
return async.waterfall([
function(callback) {
// create output dir i... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/cli/build.coffee | 44 | 82 |
jnordberg/wintersmith:src/cli/build.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var build;
build = function(argv) {
var start;
start = new Date();
logger.info('building site');
return async.waterfall([
// load options
async.apply(getOptions,
argv),
function(options,
callback) {
return async.waterfall([
... | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
path.exists options.output, (exists) ->
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/cli/build.coffee | 44 | 82 |
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | build = (argv) ->
start = new Date()
logger.info 'building site'
async.waterfall [
# load options
async.apply getOptions, argv
(options, callback) ->
async.waterfall [
(callback) ->
# create output dir if not existing
path.exists options.output, (exists) ->
... | logger.verbose "cleaning - running rimraf on #{ options.output }"
async.waterfall [
async.apply rimraf, options.output
async.apply fs.mkdir, options.output
], callback
else
callback()
# load plugins
async.apply loadPlugins, option... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | 22fb44b5b7401db9fb6e5178d05881d9995e1e51 | 3,484 | https://github.com/jnordberg/wintersmith/blob/22fb44b5b7401db9fb6e5178d05881d9995e1e51/src/cli/build.coffee | 44 | 82 |
jnordberg/wintersmith:src/cli/build.coffee:1:raw_corpus | raw_corpus | async = require 'async'
{app} = require 'flatiron'
rimraf = require 'rimraf'
fs = require 'fs'
colors = require 'colors'
{logger} = require '../common' # lib common
{getOptions, commonOptions} = require './common' # cli common
wintersmith = require '../'
usage = """
usage: wintersmith build [options]
options:
... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/cli/build.coffee | 1 | 50 | ||
jnordberg/wintersmith:src/cli/build.coffee:1:completion | completion | async = require 'async'
{app} = require 'flatiron'
rimraf = require 'rimraf'
fs = require 'fs'
colors = require 'colors'
{logger} = require '../common' # lib common
{getOptions, commonOptions} = require './common' # cli common
wintersmith = require '../'
usage = """
usage: wintersmith build [options]
options:
... | build using command line options:
$ wintersmith build -o /var/www/public/ -T extra_data.json -C ~/my-blog
or using both (command-line options will override config options):
$ wintersmith build --config another_config.json --clean
"""
build = ->
start = new Date()
logger.info 'building site'
async.w... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/cli/build.coffee | 1 | 50 |
jnordberg/wintersmith:src/cli/build.coffee:2:raw_corpus | raw_corpus | callback()
(callback) ->
# start building
wintersmith options, callback
], callback
], (error) ->
if error
logger.error error.message, error
else
stop = new Date()
delta = stop - start
logger.info "done in #{ delta.toString().bold } ms\n"
module.expor... | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/cli/build.coffee | 51 | 66 | ||
jnordberg/wintersmith:src/cli/build.coffee:2:completion | completion | callback()
(callback) ->
# start building
wintersmith options, callback
], callback
], (error) ->
if error
logger.error error.message, error | else
stop = new Date()
delta = stop - start
logger.info "done in #{ delta.toString().bold } ms\n"
module.exports = build
module.exports.usage = usage
module.exports.name = 'build' | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/build.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/cli/build.coffee | 51 | 66 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'tag-shelf'
mixins: [ mixinSubscribe, PureRenderMixin ]
propTypes:
tags: T.instanceOf(Immutable.List)
_tagId: T.string
_userId: T.string
selecteAll: T.bool
onTagClick: T.func.isRequired
onAllTagsSelect: T.func.isRequired
getI... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 28 | 77 | ||
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'tag-shelf'
mixins: [ mixinSubscribe, PureRenderMixin ]
propTypes:
tags: T.instanceOf(Immutable.List)
_tagId: T.string
_userId: T.string
selecteAll: T.bool
onTagClick: T.func.... | module.exports = React.createClass({
displayName: 'tag-shelf',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
tags: T.instanceOf(Immutable.List),
_tagId: T.string,
_userId: T.string,
selecteAll: T.bool,
onTagClick: T.func.isRequired,
onAllTagsSelect: T.func.isRequired
},
getIn... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 28 | 77 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'tag-shelf',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
tags: T.instanceOf(Immutable.List),
_tagId: T.string,
_userId: T.string,
selecteAll: T.bool,
onTagClick: T.func.isRequir... | module.exports = React.createClass
displayName: 'tag-shelf'
mixins: [ mixinSubscribe, PureRenderMixin ]
propTypes:
tags: T.instanceOf(Immutable.List)
_tagId: T.string
_userId: T.string
selecteAll: T.bool
onTagClick: T.func.isRequired
onAllTagsSelect: T.func.isRequired
getI... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 28 | 77 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'tag-shelf'
mixins: [ mixinSubscribe, PureRenderMixin ]
propTypes:
tags: T.instanceOf(Immutable.List)
_tagId: T.string
_userId: T.string
selecteAll: T.bool
onTagClick: T.func.isRequired
onAllTagsSelect: T.func.isRequired
getI... | tag = @props.tags.find (tag) =>
tag.get('_id') is @props._tagId
tag?.get('name')
onEditFinish: ->
@setState editable: false
onEditClick: ->
@setState editable: true
onQueryChange: (query) ->
@setState query: query
onCreateTag: ->
tagActions.createTag @props._teamId, @state.query.tr... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 28 | 77 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:2:raw_corpus | raw_corpus | tag.get('_id') is @props._tagId
renderTagList: ->
@filteredTags().map (tag) =>
_tagId = tag.get('_id')
cxItem = cx 'tag', 'item', 'muted', 'is-selected': @props._tagId is _tagId
Tag
key: _tagId
tag: tag
editable: true
onTagClick: @props.onTagClick
tagSel... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 78 | 127 | ||
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
tag.get('_id') is @props._tagId
renderTagList: ->
@filteredTags().map (tag) =>
_tagId = tag.get('_id')
cxItem = cx 'tag', 'item', 'muted', 'is-selected': @props._tagId is _tagId
Tag
key: _tagId
tag: tag
editable: ... | tag.get('_id') === this.props._tagId({
renderTagList: function() {
return this.filteredTags().map((tag) => {
var _tagId, cxItem;
_tagId = tag.get('_id');
cxItem = cx('tag', 'item', 'muted', {
'is-selected': this.props._tagId === _tagId
});
return Tag({
key: _tagId,
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 78 | 127 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
tag.get('_id') === this.props._tagId({
renderTagList: function() {
return this.filteredTags().map((tag) => {
var _tagId, cxItem;
_tagId = tag.get('_id');
cxItem = cx('tag', 'item', 'muted', {
'is-selected': this.props._tagId === _tag... | tag.get('_id') is @props._tagId
renderTagList: ->
@filteredTags().map (tag) =>
_tagId = tag.get('_id')
cxItem = cx 'tag', 'item', 'muted', 'is-selected': @props._tagId is _tagId
Tag
key: _tagId
tag: tag
editable: true
onTagClick: @props.onTagClick
tagSel... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 78 | 127 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:2:completion | completion | tag.get('_id') is @props._tagId
renderTagList: ->
@filteredTags().map (tag) =>
_tagId = tag.get('_id')
cxItem = cx 'tag', 'item', 'muted', 'is-selected': @props._tagId is _tagId
Tag
key: _tagId
tag: tag
editable: true
onTagClick: @props.onTagClick
tagSel... | render: ->
_creatorIds = @props.tags.map((tag) -> tag.get('_creatorId'))
# @props._tagId对应标签不存在时默认选中“全部标签”
cxAll = cx 'tag', 'line', 'muted', 'is-active': @props.selectAll or not @tagExsits()
div className: 'tag-shelf',
div className: 'title',
@renderSearchbox()
if @state.query.tri... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 78 | 127 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:3:raw_corpus | raw_corpus | if @props.tags.size > 0
div className: 'tag-list',
div className: cxAll, onClick: @props.onAllTagsSelect,
span className: 'dot'
span className: 'name', lang.getText('all-tags')
@renderTagList()
else
@renderPlaceholder() | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 128 | 135 | ||
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @props.tags.size > 0
div className: 'tag-list',
div className: cxAll, onClick: @props.onAllTagsSelect,
span className: 'dot'
span className: 'name', lang.getText('all-tags')
@renderTagList()
... | if (this.props.tags.size > 0) {
div({
className: 'tag-list'
}, div({
className: cxAll,
onClick: this.props.onAllTagsSelect
}, span({
className: 'dot'
}), span({
className: 'name'
}, lang.getText('all-tags'))), this.renderTagList());
} else {
this.renderPlaceholder();
} | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 128 | 135 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (this.props.tags.size > 0) {
div({
className: 'tag-list'
}, div({
className: cxAll,
onClick: this.props.onAllTagsSelect
}, span({
className: 'dot'
}), span({
className: 'name'
}, lang.getText('all-tags'))), this.renderTagList());
} ... | if @props.tags.size > 0
div className: 'tag-list',
div className: cxAll, onClick: @props.onAllTagsSelect,
span className: 'dot'
span className: 'name', lang.getText('all-tags')
@renderTagList()
else
@renderPlaceholder() | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 128 | 135 |
jianliaoim/talk-os:talk-web/client/app/tag-shelf.coffee:3:completion | completion | if @props.tags.size > 0
div className: 'tag-list',
div className: cxAll, onClick: @props.onAllTagsSelect,
span className: 'dot' | span className: 'name', lang.getText('all-tags')
@renderTagList()
else
@renderPlaceholder() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-shelf.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-shelf.coffee | 128 | 135 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:raw_corpus | raw_corpus | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 1 | 50 | ||
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When ... | var _, expect;
_ = require('lodash');
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
});
this.When(/^I read th... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, expect;
_ = require('lodash');
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should... | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:completion | completion | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | base.read(child)
.should.eventually.eql(content)
@When /^I read the "([^"]*)" attribute I should get "([^"]*)"$/, (attribute, expected) ->
new @Widget({
root: ".wow"
})
.getAttribute(attribute)
.then (attr) -> attr.should.eql(expected)
@When /^I read the "([^"]*)" attribute of a nested e... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:2:raw_corpus | raw_corpus | @When /^I get the outerHTML of "([^"]*)" I should get "([^"]*)"$/, (rootSelector, expected) ->
new @Widget({
root: rootSelector
})
.getOuterHTML().then (html) ->
html.split('\n').map((string) ->
string.trim()
)
.join("").should.eql(expected) | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 51 | 59 | ||
mojotech/pioneer:test/integration/steps/read_steps.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@When /^I get the outerHTML of "([^"]*)" I should get "([^"]*)"$/, (rootSelector, expected) ->
new @Widget({
root: rootSelector
})
.getOuterHTML().then (html) ->
html.split('\n').map((string) ->
string.trim()
)
.join(""... | this.When(/^I get the outerHTML of "([^"]*)" I should get "([^"]*)"$/, function(rootSelector, expected) {
return new this.Widget({
root: rootSelector
}).getOuterHTML().then(function(html) {
return html.split('\n').map(function(string) {
return string.trim();
}).join("").should.eql(expected);
});... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 51 | 59 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.When(/^I get the outerHTML of "([^"]*)" I should get "([^"]*)"$/, function(rootSelector, expected) {
return new this.Widget({
root: rootSelector
}).getOuterHTML().then(function(html) {
return html.split('\n').map(function(string) {
return str... | @When /^I get the outerHTML of "([^"]*)" I should get "([^"]*)"$/, (rootSelector, expected) ->
new @Widget({
root: rootSelector
})
.getOuterHTML().then (html) ->
html.split('\n').map((string) ->
string.trim()
)
.join("").should.eql(expected) | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 51 | 59 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:2:completion | completion | @When /^I get the outerHTML of "([^"]*)" I should get "([^"]*)"$/, (rootSelector, expected) ->
new @Widget({
root: rootSelector
}) | .getOuterHTML().then (html) ->
html.split('\n').map((string) ->
string.trim()
)
.join("").should.eql(expected) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/read_steps.coffee | 51 | 59 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:raw_corpus | raw_corpus | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/test/integration/steps/read_steps.coffee | 1 | 50 | ||
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When ... | var _, expect;
_ = require('lodash');
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
});
this.When(/^I read th... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, expect;
_ = require('lodash');
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should... | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:completion | completion | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | base.read(child)
.should.eventually.eql(content)
@When /^I read the "([^"]*)" attribute I should get "([^"]*)"$/, (attribute, expected) ->
new @Widget({
root: ".wow"
})
.getAttribute(attribute)
.then (attr) -> attr.should.eql(expected)
@When /^I get the innerHTML of "([^"]*)" I should ge... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:raw_corpus | raw_corpus | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/read_steps.coffee | 1 | 50 | ||
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When ... | var _, expect;
_ = require('lodash');
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
});
this.When(/^I read th... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, expect;
_ = require('lodash');
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should... | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:completion | completion | _ = require('lodash')
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I shou... | .should.eventually.eql(content)
@When /^I read the "([^"]*)" attribute I should get "([^"]*)"$/, (attribute, expected) ->
new @Widget({
root: ".wow"
})
.getAttribute(attribute)
.then (attr) -> attr.should.eql(expected)
@When /^I get the innerHTML of "([^"]*)" I should get "([^"]*)"$/, (rootS... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/read_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:raw_corpus | raw_corpus | expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I should see "([^"]*)"$/, (select... | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | fc9304277372b1bf3022de1d5ab687f79bbcbeb7 | 523 | https://github.com/mojotech/pioneer/blob/fc9304277372b1bf3022de1d5ab687f79bbcbeb7/test/integration/steps/read_steps.coffee | 1 | 49 | ||
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with... | var expect;
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
});
this.When(/^I read the "([^"]*)" with an all cap... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | fc9304277372b1bf3022de1d5ab687f79bbcbeb7 | 523 | https://github.com/mojotech/pioneer/blob/fc9304277372b1bf3022de1d5ab687f79bbcbeb7/test/integration/steps/read_steps.coffee | 1 | 49 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var expect;
expect = require("chai").expect;
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
... | expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I should see "([^"]*)"$/, (select... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | fc9304277372b1bf3022de1d5ab687f79bbcbeb7 | 523 | https://github.com/mojotech/pioneer/blob/fc9304277372b1bf3022de1d5ab687f79bbcbeb7/test/integration/steps/read_steps.coffee | 1 | 49 |
mojotech/pioneer:test/integration/steps/read_steps.coffee:1:completion | completion | expect = require("chai").expect
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I read the "([^"]*)" with an all caps tranformer I should see "([^"]*)"$/, (select... | .should.eventually.eql(content)
@When /^I read the "([^"]*)" attribute I should get "([^"]*)"$/, (attribute, expected) ->
new @Widget({
root: ".wow"
})
.getAttribute(attribute)
.then (attr) -> attr.should.eql(expected)
@When /^I get the innerHTML of "([^"]*)" I should get "([^"]*)"$/, (rootS... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/read_steps.coffee | MIT | fc9304277372b1bf3022de1d5ab687f79bbcbeb7 | 523 | https://github.com/mojotech/pioneer/blob/fc9304277372b1bf3022de1d5ab687f79bbcbeb7/test/integration/steps/read_steps.coffee | 1 | 49 |
Pagedraw/pagedraw:e2e-tests/start-browser.coffee:1:raw_corpus | raw_corpus | _l = require 'lodash'
puppeteer = require 'puppeteer'
puppeteer_args = _l.extend {},
{headless: true},
if process.env.CI then { args: ['--no-sandbox', '--disable-setuid-sandbox'] } else {}
module.exports = start_browser = -> puppeteer.launch(puppeteer_args) | CoffeeScript | Pagedraw/pagedraw | e2e-tests/start-browser.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/e2e-tests/start-browser.coffee | 1 | 8 | ||
Pagedraw/pagedraw:e2e-tests/start-browser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_l = require 'lodash'
puppeteer = require 'puppeteer'
puppeteer_args = _l.extend {},
{headless: true},
if process.env.CI then { args: ['--no-sandbox', '--disable-setuid-sandbox'] } else {}
module.exports = start_browser = -> puppeteer.launch(puppeteer_a... | var _l, puppeteer, puppeteer_args, start_browser;
_l = require('lodash');
puppeteer = require('puppeteer');
puppeteer_args = _l.extend({}, {
headless: true
}, process.env.CI ? {
args: ['--no-sandbox', '--disable-setuid-sandbox']
} : {});
module.exports = start_browser = function() {
return puppeteer.launch(pu... | CoffeeScript | JavaScript | Pagedraw/pagedraw | e2e-tests/start-browser.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/e2e-tests/start-browser.coffee | 1 | 8 |
Pagedraw/pagedraw:e2e-tests/start-browser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _l, puppeteer, puppeteer_args, start_browser;
_l = require('lodash');
puppeteer = require('puppeteer');
puppeteer_args = _l.extend({}, {
headless: true
}, process.env.CI ? {
args: ['--no-sandbox', '--disable-setuid-sandbox']
} : {});
module.exports = st... | _l = require 'lodash'
puppeteer = require 'puppeteer'
puppeteer_args = _l.extend {},
{headless: true},
if process.env.CI then { args: ['--no-sandbox', '--disable-setuid-sandbox'] } else {}
module.exports = start_browser = -> puppeteer.launch(puppeteer_args) | JavaScript | CoffeeScript | Pagedraw/pagedraw | e2e-tests/start-browser.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/e2e-tests/start-browser.coffee | 1 | 8 |
Pagedraw/pagedraw:e2e-tests/start-browser.coffee:1:completion | completion | _l = require 'lodash'
puppeteer = require 'puppeteer'
puppeteer_args = _l.extend {}, | {headless: true},
if process.env.CI then { args: ['--no-sandbox', '--disable-setuid-sandbox'] } else {}
module.exports = start_browser = -> puppeteer.launch(puppeteer_args) | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | e2e-tests/start-browser.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/e2e-tests/start-browser.coffee | 1 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.