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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
linemanjs/lineman:lib/file-utils.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
... | // Synchronous file helpers
var _, _str, fileUtils, fs, grunt, mkdirIfNecessary;
grunt = require('./requires-grunt').require();
_ = require("lodash");
_str = require("underscore.string");
fs = require("fs");
module.exports = fileUtils = {
copy: function(src, dest) {
var file;
file = fs.lstatSync(src);
... | CoffeeScript | JavaScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Synchronous file helpers
var _, _str, fileUtils, fs, grunt, mkdirIfNecessary;
grunt = require('./requires-grunt').require();
_ = require("lodash");
_str = require("underscore.string");
fs = require("fs");
module.exports = fileUtils = {
copy: function(src,... | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.c... | JavaScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:completion | completion | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.c... | return require(configurationFileForName(name))
catch e
if e.code == "MODULE_NOT_FOUND"
return {}
else
throw e
reloadConfigurationFile: (name) ->
configName = configurationFileForName(name)
_.each require.cache, (entry, path) ->
if path.indexOf(configName) == 0
de... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:2:raw_corpus | raw_corpus | try
fs.mkdirSync(dest, checkDir.mode)
catch e
throw e if e.code != "EEXIST"
configurationFileForName = (name) -> "#{process.cwd()}/config/#{name}" | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 51 | 56 | ||
linemanjs/lineman:lib/file-utils.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
try
fs.mkdirSync(dest, checkDir.mode)
catch e
throw e if e.code != "EEXIST"
configurationFileForName = (name) -> "#{process.cwd()}/config/#{name}"
``` | var configurationFileForName, e;
try {
fs.mkdirSync(dest, checkDir.mode);
} catch (error) {
e = error;
if (e.code !== "EEXIST") {
throw e;
}
}
configurationFileForName = function(name) {
return `${process.cwd()}/config/${name}`;
}; | CoffeeScript | JavaScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 51 | 56 |
linemanjs/lineman:lib/file-utils.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var configurationFileForName, e;
try {
fs.mkdirSync(dest, checkDir.mode);
} catch (error) {
e = error;
if (e.code !== "EEXIST") {
throw e;
}
}
configurationFileForName = function(name) {
return `${process.cwd()}/config/${name}`;
};
``` | try
fs.mkdirSync(dest, checkDir.mode)
catch e
throw e if e.code != "EEXIST"
configurationFileForName = (name) -> "#{process.cwd()}/config/#{name}" | JavaScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 51 | 56 |
linemanjs/lineman:lib/file-utils.coffee:2:completion | completion | try
fs.mkdirSync(dest, checkDir.mode)
catch e | throw e if e.code != "EEXIST"
configurationFileForName = (name) -> "#{process.cwd()}/config/#{name}" | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/file-utils.coffee | 51 | 56 |
linemanjs/lineman:lib/file-utils.coffee:1:raw_corpus | raw_corpus | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.c... | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/file-utils.coffee | 1 | 50 | ||
linemanjs/lineman:lib/file-utils.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
... | // Synchronous file helpers
var _, _str, fileUtils, fs, grunt, mkdirIfNecessary;
grunt = require('./requires-grunt').require();
_ = require("lodash");
_str = require("underscore.string");
fs = require("fs");
module.exports = fileUtils = {
copy: function(src, dest) {
var file;
file = fs.lstatSync(src);
... | CoffeeScript | JavaScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Synchronous file helpers
var _, _str, fileUtils, fs, grunt, mkdirIfNecessary;
grunt = require('./requires-grunt').require();
_ = require("lodash");
_str = require("underscore.string");
fs = require("fs");
module.exports = fileUtils = {
copy: function(src,... | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.c... | JavaScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:completion | completion | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
_str = require("underscore.string")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.c... | return require(configurationFileForName(name))
catch e
if e.code == "MODULE_NOT_FOUND"
return {}
else
throw e
reloadConfigurationFile: (name) ->
configName = configurationFileForName(name)
_(require.cache).each (entry, path) ->
if path.indexOf(configName) == 0
de... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | 78f8beebd31b78fec22776e71987f1ff7992e5a1 | 1,168 | https://github.com/linemanjs/lineman/blob/78f8beebd31b78fec22776e71987f1ff7992e5a1/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:raw_corpus | raw_corpus | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.copy(src, dest)
copyDir: (src, des... | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/lib/file-utils.coffee | 1 | 50 | ||
linemanjs/lineman:lib/file-utils.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
el... | // Synchronous file helpers
var _, fileUtils, fs, grunt, mkdirIfNecessary;
grunt = require('./requires-grunt').require();
_ = require("lodash");
fs = require("fs");
module.exports = fileUtils = {
copy: function(src, dest) {
var file;
file = fs.lstatSync(src);
if (file.isDirectory()) {
return fil... | CoffeeScript | JavaScript | linemanjs/lineman | lib/file-utils.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Synchronous file helpers
var _, fileUtils, fs, grunt, mkdirIfNecessary;
grunt = require('./requires-grunt').require();
_ = require("lodash");
fs = require("fs");
module.exports = fileUtils = {
copy: function(src, dest) {
var file;
file = fs.lstatSy... | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.copy(src, dest)
copyDir: (src, des... | JavaScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:1:completion | completion | # Synchronous file helpers
grunt = require('./requires-grunt').require()
_ = require("lodash")
fs = require("fs")
module.exports = fileUtils =
copy: (src, dest) ->
file = fs.lstatSync(src)
if file.isDirectory()
fileUtils.copyDir(src, dest)
else
grunt.file.copy(src, dest)
copyDir: (src, des... | catch e
if e.code == "MODULE_NOT_FOUND"
return {}
else
throw e
reloadConfigurationFile: (name) ->
configName = configurationFileForName(name)
_(require.cache).each (entry, path) ->
if path.indexOf(configName) == 0
delete require.cache[path]
fileUtils.loadConfigur... | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/lib/file-utils.coffee | 1 | 50 |
linemanjs/lineman:lib/file-utils.coffee:2:raw_corpus | raw_corpus | fs.mkdirSync(dest, checkDir.mode)
catch e
throw e if e.code != "EEXIST"
configurationFileForName = (name) -> "#{process.cwd()}/config/#{name}" | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/lib/file-utils.coffee | 51 | 55 | ||
linemanjs/lineman:lib/file-utils.coffee:2:completion | completion | fs.mkdirSync(dest, checkDir.mode)
catch e | throw e if e.code != "EEXIST"
configurationFileForName = (name) -> "#{process.cwd()}/config/#{name}" | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/file-utils.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/lib/file-utils.coffee | 51 | 55 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:1:raw_corpus | raw_corpus | Promise = require 'bluebird'
cluster = require 'cluster'
os = require 'os'
numCPUs = os.cpus().length
logger = require 'graceful-logger'
config = require 'config'
config.searchBulk = size: 999999999, delay: 999999999
if cluster.isMaster
[0...numCPUs].forEach -> cluster.fork()
cluster.on 'exit', (worker, code, s... | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 1 | 40 | ||
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Promise = require 'bluebird'
cluster = require 'cluster'
os = require 'os'
numCPUs = os.cpus().length
logger = require 'graceful-logger'
config = require 'config'
config.searchBulk = size: 999999999, delay: 999999999
if cluster.isMaster
[0...numCPUs].forEach... | var FavoriteModel, MessageModel, Promise, SearchFavoriteModel, SearchMessageModel, _overrideModel, cluster, conditions, config, limbo, limit, logger, numCPUs, os, redis, totalNum;
Promise = require('bluebird');
cluster = require('cluster');
os = require('os');
numCPUs = os.cpus().length;
logger = require('graceful... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 1 | 40 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var FavoriteModel, MessageModel, Promise, SearchFavoriteModel, SearchMessageModel, _overrideModel, cluster, conditions, config, limbo, limit, logger, numCPUs, os, redis, totalNum;
Promise = require('bluebird');
cluster = require('cluster');
os = require('os');
... | Promise = require 'bluebird'
cluster = require 'cluster'
os = require 'os'
numCPUs = os.cpus().length
logger = require 'graceful-logger'
config = require 'config'
config.searchBulk = size: 999999999, delay: 999999999
if cluster.isMaster
[0...numCPUs].forEach -> cluster.fork()
cluster.on 'exit', (worker, code, s... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 1 | 40 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:1:completion | completion | Promise = require 'bluebird'
cluster = require 'cluster'
os = require 'os'
numCPUs = os.cpus().length
logger = require 'graceful-logger'
config = require 'config'
config.searchBulk = size: 999999999, delay: 999999999
if cluster.isMaster
[0...numCPUs].forEach -> cluster.fork()
cluster.on 'exit', (worker, code, s... | else
{limbo, logger, redis} = require '../server/components'
{
MessageModel
FavoriteModel
SearchMessageModel
SearchFavoriteModel
} = limbo.use 'talk'
conditions = isSystem: false
limit = 1000
totalNum = 0
_overrideModel = (SearchModel) ->
SearchModel.flushAsync = Promise.promisify(... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 1 | 40 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:2:raw_corpus | raw_corpus | {worker} = cluster
main = (type) ->
switch type
when 'message'
DataModel = MessageModel
SearchModel = SearchMessageModel
when 'favorite'
DataModel = FavoriteModel
SearchModel = SearchFavoriteModel
else return
cursorKey = "search:#{type}:migrate:id:#{worker.... | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 42 | 83 | ||
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:2:completion | completion | {worker} = cluster
main = (type) ->
switch type
when 'message'
DataModel = MessageModel
SearchModel = SearchMessageModel
when 'favorite'
DataModel = FavoriteModel
SearchModel = SearchFavoriteModel
else return
cursorKey = "search:#{type}:migrate:id:#{worker.... | _index = (_cursorId) ->
conditions._id = $gt: _cursorId if _cursorId
query = DataModel.find conditions
.populate 'tags'
.sort _id: 1
.limit limit
if _cursorId
# 每次偏移量
query = query.skip limit * (numCPUs - 1)
else
# 首次偏移量
query = query.skip (work... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 42 | 83 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:3:raw_corpus | raw_corpus | _main = (_cursorId) ->
logger.info "Start index #{type} from cursor id", _cursorId
_index _cursorId
.then (datas) ->
return unless datas?.length
_cursorId = datas[datas.length - 1]._id
totalNum += datas.length
logger.info "Complete index #{type} number", totalNum, "la... | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 85 | 112 | ||
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_main = (_cursorId) ->
logger.info "Start index #{type} from cursor id", _cursorId
_index _cursorId
.then (datas) ->
return unless datas?.length
_cursorId = datas[datas.length - 1]._id
totalNum += datas.length
l... | var $favorite, $message, _main;
_main = function(_cursorId) {
logger.info(`Start index ${type} from cursor id`, _cursorId);
return _index(_cursorId).then(function(datas) {
if (!(datas != null ? datas.length : void 0)) {
return;
}
_cursorId = datas[datas.length - 1]._id;
totalNum += datas.leng... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 85 | 112 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $favorite, $message, _main;
_main = function(_cursorId) {
logger.info(`Start index ${type} from cursor id`, _cursorId);
return _index(_cursorId).then(function(datas) {
if (!(datas != null ? datas.length : void 0)) {
return;
}
_cursorId = ... | _main = (_cursorId) ->
logger.info "Start index #{type} from cursor id", _cursorId
_index _cursorId
.then (datas) ->
return unless datas?.length
_cursorId = datas[datas.length - 1]._id
totalNum += datas.length
logger.info "Complete index #{type} number", totalNum, "la... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 85 | 112 |
jianliaoim/talk-os:talk-api2x/scripts/migrate-search.coffee:3:completion | completion | _main = (_cursorId) ->
logger.info "Start index #{type} from cursor id", _cursorId
_index _cursorId
.then (datas) ->
return unless datas?.length
_cursorId = datas[datas.length - 1]._id
totalNum += datas.length
logger.info "Complete index #{type} number", totalNum, "la... | _main _cursorId
_getCursorId().then _main
$message = main 'message'
$favorite = main 'favorite'
Promise.all [$message, $favorite]
.then ->
logger.info "Migrate search finish on #{worker.id}"
process.exit 0
.catch (err) ->
logger.err err.stack
process.exit 1 | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/scripts/migrate-search.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/scripts/migrate-search.coffee | 85 | 112 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
nokey: true
url: "http://developers.google.com"
... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/Gruntfile.coffee | 1 | 32 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
n... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
nokey: true,
url: "http://developers... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
nokey: true
url: "http://developers.google.com"
... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
nokey: true
url: "http://developers.google.com" | single:
options:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
threshold: 80
paths:
options:
paths: ["/speed/docs/insights/about", "/speed/docs/insights/v1/getting_started"]
... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
url: "http://developers.google.com"... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 4a5fb5244d54d004755694a5aeff6862de68ca2c | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/4a5fb5244d54d004755694a5aeff6862de68ca2c/Gruntfile.coffee | 1 | 32 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "API_KEY",
url: "http://develop... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 4a5fb5244d54d004755694a5aeff6862de68ca2c | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/4a5fb5244d54d004755694a5aeff6862de68ca2c/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
url: "http://developers.google.com"... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 4a5fb5244d54d004755694a5aeff6862de68ca2c | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/4a5fb5244d54d004755694a5aeff6862de68ca2c/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
url: "http://developers.google.com" | single:
options:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
threshold: 80
paths:
options:
paths: ["/speed/docs/insights/about", "/speed/docs/insights/v1/getting_started"]
... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 4a5fb5244d54d004755694a5aeff6862de68ca2c | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/4a5fb5244d54d004755694a5aeff6862de68ca2c/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
url: "http://developers.google.com"... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 8717917f807bdee6719ddc55c69a0e580b9cb6d6 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/8717917f807bdee6719ddc55c69a0e580b9cb6d6/Gruntfile.coffee | 1 | 32 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "API_KEY",
url: "http://develop... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 8717917f807bdee6719ddc55c69a0e580b9cb6d6 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/8717917f807bdee6719ddc55c69a0e580b9cb6d6/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
url: "http://developers.google.com"... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 8717917f807bdee6719ddc55c69a0e580b9cb6d6 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/8717917f807bdee6719ddc55c69a0e580b9cb6d6/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
url: "http://developers.google.com" | single:
options:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
threshold: 80
paths:
options:
paths: ["/speed/docs/insights/about", "/speed/docs/insights/v1/getting_started"]
... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 8717917f807bdee6719ddc55c69a0e580b9cb6d6 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/8717917f807bdee6719ddc55c69a0e580b9cb6d6/Gruntfile.coffee | 1 | 32 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developer... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2/Gruntfile.coffee | 1 | 24 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "API_KEY"
},
prod: {
... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developer... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig | pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
threshold: 80
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespeed'] | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/af5bb7e91f10d2ced6832bb2a01a7c894ce04fb2/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developer... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | d50a63abc16ef2efe3b1289b2c1fb0581ce923b8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/d50a63abc16ef2efe3b1289b2c1fb0581ce923b8/Gruntfile.coffee | 1 | 24 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "API_KEY"
},
prod: {
... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | d50a63abc16ef2efe3b1289b2c1fb0581ce923b8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/d50a63abc16ef2efe3b1289b2c1fb0581ce923b8/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developer... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | d50a63abc16ef2efe3b1289b2c1fb0581ce923b8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/d50a63abc16ef2efe3b1289b2c1fb0581ce923b8/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig | pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
threshold: 10
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespeed'] | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | d50a63abc16ef2efe3b1289b2c1fb0581ce923b8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/d50a63abc16ef2efe3b1289b2c1fb0581ce923b8/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS4"
prod:... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 0fd25dcc4148f4e235fdaca820faf0e6a185faa8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0fd25dcc4148f4e235fdaca820faf0e6a185faa8/Gruntfile.coffee | 1 | 24 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 0fd25dcc4148f4e235fdaca820faf0e6a185faa8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0fd25dcc4148f4e235fdaca820faf0e6a185faa8/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS4"
prod:... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 0fd25dcc4148f4e235fdaca820faf0e6a185faa8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0fd25dcc4148f4e235fdaca820faf0e6a185faa8/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig | pagespeed:
options:
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS4"
prod:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
threshold: 80
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespe... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 0fd25dcc4148f4e235fdaca820faf0e6a185faa8 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0fd25dcc4148f4e235fdaca820faf0e6a185faa8/Gruntfile.coffee | 1 | 24 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS4"
prod:... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 1045b732a23cc99b51691fa2419a20fbf27b69f1 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/1045b732a23cc99b51691fa2419a20fbf27b69f1/Gruntfile.coffee | 1 | 23 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 1045b732a23cc99b51691fa2419a20fbf27b69f1 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/1045b732a23cc99b51691fa2419a20fbf27b69f1/Gruntfile.coffee | 1 | 23 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS4"
prod:... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 1045b732a23cc99b51691fa2419a20fbf27b69f1 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/1045b732a23cc99b51691fa2419a20fbf27b69f1/Gruntfile.coffee | 1 | 23 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) -> | grunt.initConfig
pagespeed:
options:
key: "AIzaSyA9Y3D2HZI3aaqthB8z6veXczJoNlELJS4"
prod:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespee... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 1045b732a23cc99b51691fa2419a20fbf27b69f1 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/1045b732a23cc99b51691fa2419a20fbf27b69f1/Gruntfile.coffee | 1 | 23 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developer... | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 47d3fa0347b3babdbc341bac60370578add8d204 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/47d3fa0347b3babdbc341bac60370578add8d204/Gruntfile.coffee | 1 | 23 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
k... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options: {
key: "API_KEY"
},
prod: {
... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 47d3fa0347b3babdbc341bac60370578add8d204 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/47d3fa0347b3babdbc341bac60370578add8d204/Gruntfile.coffee | 1 | 23 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pagespeed: {
options:... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developer... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 47d3fa0347b3babdbc341bac60370578add8d204 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/47d3fa0347b3babdbc341bac60370578add8d204/Gruntfile.coffee | 1 | 23 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) -> | grunt.initConfig
pagespeed:
options:
key: "API_KEY"
prod:
url: "https://developers.google.com/speed/docs/insights/v1/getting_started"
locale: "en_GB"
strategy: "desktop"
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespeed'] | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | 47d3fa0347b3babdbc341bac60370578add8d204 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/47d3fa0347b3babdbc341bac60370578add8d204/Gruntfile.coffee | 1 | 23 |
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespeed'] | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | b152b6af5a1b0d3f457276672a453dee354444d0 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/b152b6af5a1b0d3f457276672a453dee354444d0/Gruntfile.coffee | 1 | 17 | ||
jrcryer/grunt-pagespeed:Gruntfile.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
# | 'use strict'
module.exports = (grunt) ->
grunt.initConfig
pagespeed:
grunt.loadTasks 'tasks'
grunt.registerTask 'default', ['pagespeed'] | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | Gruntfile.coffee | MIT | b152b6af5a1b0d3f457276672a453dee354444d0 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/b152b6af5a1b0d3f457276672a453dee354444d0/Gruntfile.coffee | 1 | 17 |
ichord/At.js:src/controller.coffee:1:raw_corpus | raw_corpus | class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@expectedQueryCBId = null
@setting = null
@query = null
@pos = 0
@range = nul... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 1 | 50 | ||
ichord/At.js:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@expectedQueryCBId = null
@setting = null
... | var Controller;
Controller = class Controller {
uid() {
return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime());
}
constructor(app, at) {
this.app = app;
this.at = at;
this.$inputor = this.app.$inputor;
this.id = this.$inputor[0].id || this.uid();
this.exp... | CoffeeScript | JavaScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 1 | 50 |
ichord/At.js:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Controller;
Controller = class Controller {
uid() {
return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime());
}
constructor(app, at) {
this.app = app;
this.at = at;
this.$inputor = this.app.$inputor;
th... | class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@expectedQueryCBId = null
@setting = null
@query = null
@pos = 0
@range = nul... | JavaScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 1 | 50 |
ichord/At.js:src/controller.coffee:1:completion | completion | class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@expectedQueryCBId = null
@setting = null
@query = null
@pos = 0
@range = nul... | this.trigger 'beforeDestroy'
@model.destroy()
@view.destroy()
@$el.remove()
callDefault: (funcName, args...) ->
try
DEFAULT_CALLBACKS[funcName].apply this, args
catch error
$.error "#{error} Or maybe At.js doesn't have function #{funcName}"
# Delegate custom `jQueryEvent` to the in... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 1 | 50 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 51 | 100 | ||
ichord/At.js:src/controller.coffee:2:completion | completion | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | data = $.extend {}, $li.data('item-data'), {'atwho-at': @at}
this.callbacks("tplEval").call(this, tpl, data, "onInsert")
# Render list view
#
# @param data [Array] The data
renderView: (data) ->
searchKey = this.getOpt("searchKey")
data = this.callbacks("sorter").call(this, @query.text, data[0..100... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 51 | 100 |
ichord/At.js:src/controller.coffee:3:raw_corpus | raw_corpus | if wait = this.getOpt('delay')
@_delayLookUp query, wait
else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previ... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 101 | 142 | ||
ichord/At.js:src/controller.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if wait = this.getOpt('delay')
@_delayLookUp query, wait
else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @p... | var wait;
if (wait = this.getOpt('delay')) {
this._delayLookUp(query, wait);
} else {
this._lookUp(query);
}
query;
({
_delayLookUp: function(query, wait) {
var now, remaining;
now = Date.now ? Date.now() : new Date().getTime();
this.previousCallTime || (this.previousCallTime = now);
remaining ... | CoffeeScript | JavaScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 101 | 142 |
ichord/At.js:src/controller.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var wait;
if (wait = this.getOpt('delay')) {
this._delayLookUp(query, wait);
} else {
this._lookUp(query);
}
query;
({
_delayLookUp: function(query, wait) {
var now, remaining;
now = Date.now ? Date.now() : new Date().getTime();
this.previousCa... | if wait = this.getOpt('delay')
@_delayLookUp query, wait
else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previ... | JavaScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 101 | 142 |
ichord/At.js:src/controller.coffee:3:completion | completion | if wait = this.getOpt('delay')
@_delayLookUp query, wait
else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previ... | @_lookUp query
_stopDelayedCall: ->
if @delayedCallTimeout
clearTimeout @delayedCallTimeout
@delayedCallTimeout = null
_generateQueryCBId: ->
return {};
_lookUp: (query) ->
_callback = (queryCBId, data) ->
# ensure only the latest instance of this function perform actions
if... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/controller.coffee | 101 | 142 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | e4aaa30e84d527f3fd29db0e82b062f2da00e3cf | 5,250 | https://github.com/ichord/At.js/blob/e4aaa30e84d527f3fd29db0e82b062f2da00e3cf/src/controller.coffee | 51 | 100 | ||
ichord/At.js:src/controller.coffee:2:completion | completion | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | data = $.extend {}, $li.data('item-data'), {'atwho-at': @at}
this.callbacks("tplEval").call(this, tpl, data, "onInsert")
# Render list view
#
# @param data [Array] The data
renderView: (data) ->
searchKey = this.getOpt("searchKey")
data = this.callbacks("sorter").call(this, @query.text, data[0..100... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | e4aaa30e84d527f3fd29db0e82b062f2da00e3cf | 5,250 | https://github.com/ichord/At.js/blob/e4aaa30e84d527f3fd29db0e82b062f2da00e3cf/src/controller.coffee | 51 | 100 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | c374c9335f761b66ecb3dec4770a3f630e5bcb4e | 5,250 | https://github.com/ichord/At.js/blob/c374c9335f761b66ecb3dec4770a3f630e5bcb4e/src/controller.coffee | 51 | 100 | ||
ichord/At.js:src/controller.coffee:2:completion | completion | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | data = $.extend {}, $li.data('item-data'), {'atwho-at': @at}
this.callbacks("tplEval").call(this, tpl, data, "onInsert")
# Render list view
#
# @param data [Array] The data
renderView: (data) ->
searchKey = this.getOpt("searchKey")
data = this.callbacks("sorter").call(this, @query.text, data[0..100... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | c374c9335f761b66ecb3dec4770a3f630e5bcb4e | 5,250 | https://github.com/ichord/At.js/blob/c374c9335f761b66ecb3dec4770a3f630e5bcb4e/src/controller.coffee | 51 | 100 |
ichord/At.js:src/controller.coffee:3:raw_corpus | raw_corpus | @_delayLookUp query, wait
else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayed... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | c374c9335f761b66ecb3dec4770a3f630e5bcb4e | 5,250 | https://github.com/ichord/At.js/blob/c374c9335f761b66ecb3dec4770a3f630e5bcb4e/src/controller.coffee | 101 | 141 | ||
ichord/At.js:src/controller.coffee:3:completion | completion | @_delayLookUp query, wait
else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayed... | @_lookUp query
_stopDelayedCall: ->
if @delayedCallTimeout
clearTimeout @delayedCallTimeout
@delayedCallTimeout = null
_generateQueryCBId: ->
return {};
_lookUp: (query) ->
_callback = (queryCBId, data) ->
# ensure only the latest instance of this function perform actions
if... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | c374c9335f761b66ecb3dec4770a3f630e5bcb4e | 5,250 | https://github.com/ichord/At.js/blob/c374c9335f761b66ecb3dec4770a3f630e5bcb4e/src/controller.coffee | 101 | 141 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 1b3e013c131be0db75835e6e0a0e2e22fc1e1493 | 5,250 | https://github.com/ichord/At.js/blob/1b3e013c131be0db75835e6e0a0e2e22fc1e1493/src/controller.coffee | 51 | 100 | ||
ichord/At.js:src/controller.coffee:2:completion | completion | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | data = $.extend {}, $li.data('item-data'), {'atwho-at': @at}
this.callbacks("tplEval").call(this, tpl, data, "onInsert")
# Render list view
#
# @param data [Array] The data
renderView: (data) ->
searchKey = this.getOpt("searchKey")
data = this.callbacks("sorter").call(this, @query.text, data[0..100... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 1b3e013c131be0db75835e6e0a0e2e22fc1e1493 | 5,250 | https://github.com/ichord/At.js/blob/1b3e013c131be0db75835e6e0a0e2e22fc1e1493/src/controller.coffee | 51 | 100 |
ichord/At.js:src/controller.coffee:3:raw_corpus | raw_corpus | else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeo... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 1b3e013c131be0db75835e6e0a0e2e22fc1e1493 | 5,250 | https://github.com/ichord/At.js/blob/1b3e013c131be0db75835e6e0a0e2e22fc1e1493/src/controller.coffee | 101 | 140 | ||
ichord/At.js:src/controller.coffee:3:completion | completion | else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeo... | _stopDelayedCall: ->
if @delayedCallTimeout
clearTimeout @delayedCallTimeout
@delayedCallTimeout = null
_generateQueryCBId: ->
return {};
_lookUp: (query) ->
_callback = (queryCBId, data) ->
# ensure only the latest instance of this function perform actions
if queryCBId isnt @e... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 1b3e013c131be0db75835e6e0a0e2e22fc1e1493 | 5,250 | https://github.com/ichord/At.js/blob/1b3e013c131be0db75835e6e0a0e2e22fc1e1493/src/controller.coffee | 101 | 140 |
ichord/At.js:src/controller.coffee:3:raw_corpus | raw_corpus | else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeo... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 1feff74c67ee89c38e92a636eb3728a0fc3e8a3e | 5,250 | https://github.com/ichord/At.js/blob/1feff74c67ee89c38e92a636eb3728a0fc3e8a3e/src/controller.coffee | 101 | 137 | ||
ichord/At.js:src/controller.coffee:3:completion | completion | else
@_lookUp query
query
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeo... | @previousCallTime = 0 if @previousCallTime isnt now
@_lookUp query
_stopDelayedCall: ->
if @delayedCallTimeout
clearTimeout @delayedCallTimeout
@delayedCallTimeout = null
_lookUp: (query) ->
_callback = (queryCBId, data) ->
# ensure only the latest instance of this function perform... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 1feff74c67ee89c38e92a636eb3728a0fc3e8a3e | 5,250 | https://github.com/ichord/At.js/blob/1feff74c67ee89c38e92a636eb3728a0fc3e8a3e/src/controller.coffee | 101 | 137 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 21d3972611327f21e45a3ea4739028beea19b917 | 5,250 | https://github.com/ichord/At.js/blob/21d3972611327f21e45a3ea4739028beea19b917/src/controller.coffee | 51 | 100 | ||
ichord/At.js:src/controller.coffee:2:completion | completion | alias = this.getOpt('alias')
eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callb... | data = $.extend {}, $li.data('item-data'), {'atwho-at': @at}
this.callbacks("tplEval").call(this, tpl, data, "onInsert")
# Render list view
#
# @param data [Array] The data
renderView: (data) ->
searchKey = this.getOpt("searchKey")
data = this.callbacks("sorter").call(this, @query.text, data[0..100... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 21d3972611327f21e45a3ea4739028beea19b917 | 5,250 | https://github.com/ichord/At.js/blob/21d3972611327f21e45a3ea4739028beea19b917/src/controller.coffee | 51 | 100 |
ichord/At.js:src/controller.coffee:3:raw_corpus | raw_corpus | _delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeout = setTimeout(=>
@previousCal... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 21d3972611327f21e45a3ea4739028beea19b917 | 5,250 | https://github.com/ichord/At.js/blob/21d3972611327f21e45a3ea4739028beea19b917/src/controller.coffee | 101 | 134 | ||
ichord/At.js:src/controller.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
... | ({
_delayLookUp: function(query, wait) {
var now, remaining;
now = Date.now ? Date.now() : new Date().getTime();
this.previousCallTime || (this.previousCallTime = now);
remaining = wait - (now - this.previousCallTime);
if ((0 < remaining && remaining < wait)) {
this.previousCallTime = now;
... | CoffeeScript | JavaScript | ichord/At.js | src/controller.coffee | MIT | 21d3972611327f21e45a3ea4739028beea19b917 | 5,250 | https://github.com/ichord/At.js/blob/21d3972611327f21e45a3ea4739028beea19b917/src/controller.coffee | 101 | 134 |
ichord/At.js:src/controller.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_delayLookUp: function(query, wait) {
var now, remaining;
now = Date.now ? Date.now() : new Date().getTime();
this.previousCallTime || (this.previousCallTime = now);
remaining = wait - (now - this.previousCallTime);
if ((0 < remaining && re... | _delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeout = setTimeout(=>
@previousCal... | JavaScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 21d3972611327f21e45a3ea4739028beea19b917 | 5,250 | https://github.com/ichord/At.js/blob/21d3972611327f21e45a3ea4739028beea19b917/src/controller.coffee | 101 | 134 |
ichord/At.js:src/controller.coffee:3:completion | completion | _delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeout = setTimeout(=>
@previousCal... | _stopDelayedCall: ->
if @delayedCallTimeout
clearTimeout @delayedCallTimeout
@delayedCallTimeout = null
_lookUp: (query) ->
_callback = (queryCBId, data) ->
# ensure only the latest instance of this function perform actions
if queryCBId isnt @expectedQueryCBId
return
if ... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 21d3972611327f21e45a3ea4739028beea19b917 | 5,250 | https://github.com/ichord/At.js/blob/21d3972611327f21e45a3ea4739028beea19b917/src/controller.coffee | 101 | 134 |
ichord/At.js:src/controller.coffee:1:raw_corpus | raw_corpus | class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@setting = null
@query = null
@pos = 0
@range = null
if (@$el = $("#atwho-gro... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 1 | 50 | ||
ichord/At.js:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@setting = null
@query = null
@pos ... | var Controller;
Controller = class Controller {
uid() {
return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime());
}
constructor(app, at) {
this.app = app;
this.at = at;
this.$inputor = this.app.$inputor;
this.id = this.$inputor[0].id || this.uid();
this.set... | CoffeeScript | JavaScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 1 | 50 |
ichord/At.js:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Controller;
Controller = class Controller {
uid() {
return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime());
}
constructor(app, at) {
this.app = app;
this.at = at;
this.$inputor = this.app.$inputor;
th... | class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@setting = null
@query = null
@pos = 0
@range = null
if (@$el = $("#atwho-gro... | JavaScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 1 | 50 |
ichord/At.js:src/controller.coffee:1:completion | completion | class Controller
uid: ->
(Math.random().toString(16)+"000000000").substr(2,8) + (new Date().getTime())
constructor: (@app, @at) ->
@$inputor = @app.$inputor
@id = @$inputor[0].id || this.uid()
@setting = null
@query = null
@pos = 0
@range = null
if (@$el = $("#atwho-gro... | @model.destroy()
@view.destroy()
@$el.remove()
callDefault: (funcName, args...) ->
try
DEFAULT_CALLBACKS[funcName].apply this, args
catch error
$.error "#{error} Or maybe At.js doesn't have function #{funcName}"
# Delegate custom `jQueryEvent` to the inputor
# This function will add ... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 1 | 50 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callback.
callbacks: (funcName)->
... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 51 | 100 | ||
ichord/At.js:src/controller.coffee:2:completion | completion | eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callback.
callbacks: (funcName)->
... | data = $.extend {}, $li.data('item-data'), {'atwho-at': @at}
this.callbacks("tplEval").call(this, tpl, data, "onInsert")
# Render list view
#
# @param data [Array] The data
renderView: (data) ->
searchKey = this.getOpt("searchKey")
data = this.callbacks("sorter").call(this, @query.text, data[0..100... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 51 | 100 |
ichord/At.js:src/controller.coffee:3:raw_corpus | raw_corpus | _delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeout = setTimeout(=>
@previousCal... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 101 | 129 | ||
ichord/At.js:src/controller.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
... | ({
_delayLookUp: function(query, wait) {
var now, remaining;
now = Date.now ? Date.now() : new Date().getTime();
this.previousCallTime || (this.previousCallTime = now);
remaining = wait - (now - this.previousCallTime);
if ((0 < remaining && remaining < wait)) {
this.previousCallTime = now;
... | CoffeeScript | JavaScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 101 | 129 |
ichord/At.js:src/controller.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_delayLookUp: function(query, wait) {
var now, remaining;
now = Date.now ? Date.now() : new Date().getTime();
this.previousCallTime || (this.previousCallTime = now);
remaining = wait - (now - this.previousCallTime);
if ((0 < remaining && re... | _delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeout = setTimeout(=>
@previousCal... | JavaScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 101 | 129 |
ichord/At.js:src/controller.coffee:3:completion | completion | _delayLookUp: (query, wait) ->
now = if Date.now then Date.now() else new Date().getTime()
@previousCallTime ||= now
remaining = wait - (now - @previousCallTime)
if 0 < remaining < wait
@previousCallTime = now
@_stopDelayedCall()
@delayedCallTimeout = setTimeout(=>
@previousCal... | @previousCallTime = 0 if @previousCallTime isnt now
@_lookUp query
_stopDelayedCall: ->
if @delayedCallTimeout
clearTimeout @delayedCallTimeout
@delayedCallTimeout = null
_lookUp: (query) ->
_callback = (data) ->
if data and data.length > 0
this.renderView @constructor.arra... | CoffeeScript | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 39cb46862afb44dd5e107684a46686cdf2c6292c | 5,250 | https://github.com/ichord/At.js/blob/39cb46862afb44dd5e107684a46686cdf2c6292c/src/controller.coffee | 101 | 129 |
ichord/At.js:src/controller.coffee:2:raw_corpus | raw_corpus | eventName = if alias then "#{name}-#{alias}.atwho" else "#{name}.atwho"
@$inputor.trigger eventName, data
# Get callback either in settings which was set by plugin user or in default callbacks list.
#
# @param funcName [String] callback's name
# @return [Function] The callback.
callbacks: (funcName)->
... | CoffeeScript | ichord/At.js | src/controller.coffee | MIT | 294b093f8c65eb8c830c64610a39ebab1b32938c | 5,250 | https://github.com/ichord/At.js/blob/294b093f8c65eb8c830c64610a39ebab1b32938c/src/controller.coffee | 51 | 100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.