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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
yakyak/yakyak:src/ui/views/trayicon.coffee:7:raw_corpus | raw_corpus | module.exports = ({viewstate, conv}) ->
if viewstate.showtray
create() if not tray
update(conv.unreadTotal(), viewstate)
else
destroy() if tray | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/trayicon.coffee | 93 | 98 | ||
yakyak/yakyak:src/ui/views/trayicon.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ({viewstate, conv}) ->
if viewstate.showtray
create() if not tray
update(conv.unreadTotal(), viewstate)
else
destroy() if tray
``` | module.exports = function({viewstate, conv}) {
if (viewstate.showtray) {
if (!tray) {
create();
}
return update(conv.unreadTotal(), viewstate);
} else {
if (tray) {
return destroy();
}
}
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/trayicon.coffee | 93 | 98 |
yakyak/yakyak:src/ui/views/trayicon.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function({viewstate, conv}) {
if (viewstate.showtray) {
if (!tray) {
create();
}
return update(conv.unreadTotal(), viewstate);
} else {
if (tray) {
return destroy();
}
}
};
``` | module.exports = ({viewstate, conv}) ->
if viewstate.showtray
create() if not tray
update(conv.unreadTotal(), viewstate)
else
destroy() if tray | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/trayicon.coffee | 93 | 98 |
yakyak/yakyak:src/ui/views/trayicon.coffee:7:completion | completion | module.exports = ({viewstate, conv}) ->
if viewstate.showtray
create() if not tray | update(conv.unreadTotal(), viewstate)
else
destroy() if tray | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/trayicon.coffee | 93 | 98 |
yakyak/yakyak:src/ui/views/trayicon.coffee:3:raw_corpus | raw_corpus | create = () ->
tray = new Tray trayIcons["read"]
tray.setToolTip i18n.__('title')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow' | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 25 | 29 | ||
yakyak/yakyak:src/ui/views/trayicon.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
create = () ->
tray = new Tray trayIcons["read"]
tray.setToolTip i18n.__('title')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow'
``` | var create;
create = function() {
var tray;
tray = new Tray(trayIcons["read"]);
tray.setToolTip(i18n.__('title'));
// Emitted when the tray icon is clicked
return tray.on('click', function() {
return action('togglewindow');
});
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 25 | 29 |
yakyak/yakyak:src/ui/views/trayicon.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var create;
create = function() {
var tray;
tray = new Tray(trayIcons["read"]);
tray.setToolTip(i18n.__('title'));
// Emitted when the tray icon is clicked
return tray.on('click', function() {
return action('togglewindow');
});
};
``` | create = () ->
tray = new Tray trayIcons["read"]
tray.setToolTip i18n.__('title')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow' | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 25 | 29 |
yakyak/yakyak:src/ui/views/trayicon.coffee:3:completion | completion | create = () ->
tray = new Tray trayIcons["read"] | tray.setToolTip i18n.__('title')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow' | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 25 | 29 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:raw_corpus | raw_corpus | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.start_minimize"
type: "checkbox"
chec... | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 35 | 84 | ||
yakyak/yakyak:src/ui/views/trayicon.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.... | var update;
update = function(unreadCount, viewstate) {
var contextMenu, templateContextMenu;
// update menu
templateContextMenu = compact([
{
label: i18n.__('menu.view.tray.toggle_minimize'),
click: function() {
return action('togglewindow');
}
},
{
label: i18n.__("me... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var update;
update = function(unreadCount, viewstate) {
var contextMenu, templateContextMenu;
// update menu
templateContextMenu = compact([
{
label: i18n.__('menu.view.tray.toggle_minimize'),
click: function() {
return action('toggle... | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.start_minimize"
type: "checkbox"
chec... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:completion | completion | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.start_minimize"
type: "checkbox"
chec... | {
label: i18n.__ "menu.view.tray.close"
type: "checkbox"
checked: viewstate.closetotray
click: -> action 'toggleclosetotray'
}
{
label: i18n.__ 'menu.view.hide_dock'
type: 'checkbox'
checked: viewstate.hidedockicon
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 50b672d7152edc6c1e8b69216336c137f579eab3 | 3,762 | https://github.com/yakyak/yakyak/blob/50b672d7152edc6c1e8b69216336c137f579eab3/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:raw_corpus | raw_corpus | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.start_minimize"
type: "checkbox"
chec... | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/trayicon.coffee | 35 | 84 | ||
yakyak/yakyak:src/ui/views/trayicon.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.... | var update;
update = function(unreadCount, viewstate) {
var contextMenu, templateContextMenu;
// update menu
templateContextMenu = compact([
{
label: i18n.__('menu.view.tray.toggle_minimize'),
click: function() {
return action('togglewindow');
}
},
{
label: i18n.__("me... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var update;
update = function(unreadCount, viewstate) {
var contextMenu, templateContextMenu;
// update menu
templateContextMenu = compact([
{
label: i18n.__('menu.view.tray.toggle_minimize'),
click: function() {
return action('toggle... | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.start_minimize"
type: "checkbox"
chec... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:completion | completion | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'menu.view.tray.toggle_minimize'
click: -> action 'togglewindow'
}
{
label: i18n.__ "menu.view.tray.start_minimize"
type: "checkbox"
chec... | {
label: i18n.__ "menu.view.tray.close"
type: "checkbox"
checked: viewstate.closetotray
click: -> action 'toggleclosetotray'
}
{
label: i18n.__ 'menu.view.hide_dock'
type: 'checkbox'
checked: viewstate.hidedockicon
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:3:raw_corpus | raw_corpus | create = () ->
tray = new Tray trayIcons["read"]
tray.setToolTip i18n.__('YakYak - Hangouts client')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow' | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 25 | 29 | ||
yakyak/yakyak:src/ui/views/trayicon.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
create = () ->
tray = new Tray trayIcons["read"]
tray.setToolTip i18n.__('YakYak - Hangouts client')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow'
``` | var create;
create = function() {
var tray;
tray = new Tray(trayIcons["read"]);
tray.setToolTip(i18n.__('YakYak - Hangouts client'));
// Emitted when the tray icon is clicked
return tray.on('click', function() {
return action('togglewindow');
});
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 25 | 29 |
yakyak/yakyak:src/ui/views/trayicon.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var create;
create = function() {
var tray;
tray = new Tray(trayIcons["read"]);
tray.setToolTip(i18n.__('YakYak - Hangouts client'));
// Emitted when the tray icon is clicked
return tray.on('click', function() {
return action('togglewindow');
});
}... | create = () ->
tray = new Tray trayIcons["read"]
tray.setToolTip i18n.__('YakYak - Hangouts client')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow' | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 25 | 29 |
yakyak/yakyak:src/ui/views/trayicon.coffee:3:completion | completion | create = () ->
tray = new Tray trayIcons["read"] | tray.setToolTip i18n.__('YakYak - Hangouts client')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow' | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 25 | 29 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:raw_corpus | raw_corpus | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'Toggle minimize to tray'
click: -> action 'togglewindow'
}
{
label: i18n.__ "Start minimized to tray"
type: "checkbox"
checked: viewstat... | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 35 | 84 | ||
yakyak/yakyak:src/ui/views/trayicon.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'Toggle minimize to tray'
click: -> action 'togglewindow'
}
{
label: i18n.__ "Start minimized to tra... | var update;
update = function(unreadCount, viewstate) {
var contextMenu, templateContextMenu;
// update menu
templateContextMenu = compact([
{
label: i18n.__('Toggle minimize to tray'),
click: function() {
return action('togglewindow');
}
},
{
label: i18n.__("Start min... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var update;
update = function(unreadCount, viewstate) {
var contextMenu, templateContextMenu;
// update menu
templateContextMenu = compact([
{
label: i18n.__('Toggle minimize to tray'),
click: function() {
return action('togglewindow'... | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'Toggle minimize to tray'
click: -> action 'togglewindow'
}
{
label: i18n.__ "Start minimized to tray"
type: "checkbox"
checked: viewstat... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 35 | 84 |
yakyak/yakyak:src/ui/views/trayicon.coffee:5:completion | completion | update = (unreadCount, viewstate) ->
# update menu
templateContextMenu = compact([
{
label: i18n.__ 'Toggle minimize to tray'
click: -> action 'togglewindow'
}
{
label: i18n.__ "Start minimized to tray"
type: "checkbox"
checked: viewstat... | {
label: i18n.__ "Close to tray"
type: "checkbox"
checked: viewstate.closetotray
click: -> action 'toggleclosetotray'
}
{
label: i18n.__ 'Hide Dock icon'
type: 'checkbox'
checked: viewstate.hidedockicon
click: -> ac... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/trayicon.coffee | MIT | 9b0b7ed8e3ab255e3b3acdcd09018f904675326a | 3,762 | https://github.com/yakyak/yakyak/blob/9b0b7ed8e3ab255e3b3acdcd09018f904675326a/src/ui/views/trayicon.coffee | 35 | 84 |
jianliaoim/talk-os:talk-account/server/components/redis.coffee:1:raw_corpus | raw_corpus | redis = require 'redis'
config = require 'config'
Promise = require 'bluebird'
client = redis.createClient(config.redis.port or 6379, config.redis.host or '127.0.0.1')
client.select config.redis.db if config.redis.db
Promise.promisifyAll client
module.exports = client | CoffeeScript | jianliaoim/talk-os | talk-account/server/components/redis.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/components/redis.coffee | 1 | 10 | ||
jianliaoim/talk-os:talk-account/server/components/redis.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
redis = require 'redis'
config = require 'config'
Promise = require 'bluebird'
client = redis.createClient(config.redis.port or 6379, config.redis.host or '127.0.0.1')
client.select config.redis.db if config.redis.db
Promise.promisifyAll client
module.exports ... | var Promise, client, config, redis;
redis = require('redis');
config = require('config');
Promise = require('bluebird');
client = redis.createClient(config.redis.port || 6379, config.redis.host || '127.0.0.1');
if (config.redis.db) {
client.select(config.redis.db);
}
Promise.promisifyAll(client);
module.export... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/components/redis.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/components/redis.coffee | 1 | 10 |
jianliaoim/talk-os:talk-account/server/components/redis.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Promise, client, config, redis;
redis = require('redis');
config = require('config');
Promise = require('bluebird');
client = redis.createClient(config.redis.port || 6379, config.redis.host || '127.0.0.1');
if (config.redis.db) {
client.select(config.red... | redis = require 'redis'
config = require 'config'
Promise = require 'bluebird'
client = redis.createClient(config.redis.port or 6379, config.redis.host or '127.0.0.1')
client.select config.redis.db if config.redis.db
Promise.promisifyAll client
module.exports = client | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/components/redis.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/components/redis.coffee | 1 | 10 |
jianliaoim/talk-os:talk-account/server/components/redis.coffee:1:completion | completion | redis = require 'redis'
config = require 'config'
Promise = require 'bluebird'
client = redis.createClient(config.redis.port or 6379, config.redis.host or '127.0.0.1') | client.select config.redis.db if config.redis.db
Promise.promisifyAll client
module.exports = client | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/components/redis.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/components/redis.coffee | 1 | 10 |
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:3:raw_corpus | raw_corpus | label:'Vegetable'
data:
definition:"A plant or part of a plant used as food, typically as accompaniment to meat or fish, such as a cabbage, potato, carrot, or bean."
data_can_contain_anything:true
onSelect:(branch)->
# special "on-select" function for this branch
$scope.output = "Vegeta... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | 47b154c3ed6da120be9dced6b49422ee0ae36154 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/47b154c3ed6da120be9dced6b49422ee0ae36154/src/test_abn_tree.coffee | 69 | 113 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:3:completion | completion | label:'Vegetable'
data:
definition:"A plant or part of a plant used as food, typically as accompaniment to meat or fish, such as a cabbage, potato, carrot, or bean."
data_can_contain_anything:true
onSelect:(branch)->
# special "on-select" function for this branch
$scope.output = "Vegeta... | onSelect:apple_selected
]
]
,
label:'Mineral'
children:[
label:'Rock'
# children can be simply a list of strings
# if you are in a hurry
children:['Igneous','Sedimentary','Metamorphic']
,
label:'Metal'
children:['Aluminum','Steel','Copper']
,
label:'... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | 47b154c3ed6da120be9dced6b49422ee0ae36154 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/47b154c3ed6da120be9dced6b49422ee0ae36154/src/test_abn_tree.coffee | 69 | 113 |
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:4:raw_corpus | raw_corpus | ]
]
$scope.change = ()->
debugger
$scope.example_treedata = [
label:'Animal'
children:['Cat','Dog']
] | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | 47b154c3ed6da120be9dced6b49422ee0ae36154 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/47b154c3ed6da120be9dced6b49422ee0ae36154/src/test_abn_tree.coffee | 115 | 126 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:3:raw_corpus | raw_corpus | label:'Vegetable'
data:
definition:"A plant or part of a plant used as food, typically as accompaniment to meat or fish, such as a cabbage, potato, carrot, or bean."
data_can_contain_anything:true
onSelect:(branch)->
# special "on-select" function for this branch
$scope.output = "Fruit:... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | ca3e71bfd8309168b72b9f373e19e612e19dafc2 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ca3e71bfd8309168b72b9f373e19e612e19dafc2/src/test_abn_tree.coffee | 69 | 112 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:3:completion | completion | label:'Vegetable'
data:
definition:"A plant or part of a plant used as food, typically as accompaniment to meat or fish, such as a cabbage, potato, carrot, or bean."
data_can_contain_anything:true
onSelect:(branch)->
# special "on-select" function for this branch
$scope.output = "Fruit:... | ]
]
,
label:'Mineral'
children:[
label:'Rock'
# children can be simply a list of strings
# if you are in a hurry
children:['Igneous','Sedimentary','Metamorphic']
,
label:'Metal'
children:['Aluminum','Steel','Copper']
,
label:'Plastic'
children:[
... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | ca3e71bfd8309168b72b9f373e19e612e19dafc2 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ca3e71bfd8309168b72b9f373e19e612e19dafc2/src/test_abn_tree.coffee | 69 | 112 |
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:1:raw_corpus | raw_corpus | app = angular.module 'AbnTest', ['angularBootstrapNavTree']
app.controller 'AbnTestController',($scope)->
$scope.my_default_handler = (branch)->
$scope.output = "You selected: "+branch.label
#
# your handler can do anything here...
#
apple_selected = (branch)->
$scope.output = "APPLE! : "+br... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | 714149cf73ace5916e2b574c43da2a713b49edfe | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/714149cf73ace5916e2b574c43da2a713b49edfe/src/test_abn_tree.coffee | 1 | 50 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:1:completion | completion | app = angular.module 'AbnTest', ['angularBootstrapNavTree']
app.controller 'AbnTestController',($scope)->
$scope.my_default_handler = (branch)->
$scope.output = "You selected: "+branch.label
#
# your handler can do anything here...
#
apple_selected = (branch)->
$scope.output = "APPLE! : "+br... | # onSelect : a function to run when branch is selected
# data : a place to put your own data -- can be anything
#
$scope.example_treedata = [
label:'Animal'
children:[
label:'Dog'
data:
description:"man's best friend"
,
label:'Cat'
data:
description:"spawn o... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | 714149cf73ace5916e2b574c43da2a713b49edfe | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/714149cf73ace5916e2b574c43da2a713b49edfe/src/test_abn_tree.coffee | 1 | 50 |
nickperkinslondon/angular-bootstrap-nav-tree:src/test_abn_tree.coffee:3:raw_corpus | raw_corpus | #
# a single branch can define it's own "on-select" handler:
#
onSelect:(branch)->
$scope.output = "Fruit: "+branch.data.definition
children:[
label:'Apples'
children:[
label:'Granny Smith'
onSelect:apple_selected
,
label:'Red Delicous'
onSelect:... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/test_abn_tree.coffee | MIT | 714149cf73ace5916e2b574c43da2a713b49edfe | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/714149cf73ace5916e2b574c43da2a713b49edfe/src/test_abn_tree.coffee | 53 | 93 | ||
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:1:raw_corpus | raw_corpus | xss = require 'xss'
React = require 'react'
cx = require 'classnames'
filesize = require 'filesize'
position = require '../util/file-type'
Icon = React.createFactory require './icon'
{ div, span, a, i } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'message-rich-file'
propType... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
xss = require 'xss'
React = require 'react'
cx = require 'classnames'
filesize = require 'filesize'
position = require '../util/file-type'
Icon = React.createFactory require './icon'
{ div, span, a, i } = React.DOM
T = React.PropTypes
module.exports = React.c... | var Icon, React, T, a, cx, div, filesize, i, position, span, xss;
xss = require('xss');
React = require('react');
cx = require('classnames');
filesize = require('filesize');
position = require('../util/file-type');
Icon = React.createFactory(require('./icon'));
({div, span, a, i} = React.DOM);
T = React.PropTyp... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Icon, React, T, a, cx, div, filesize, i, position, span, xss;
xss = require('xss');
React = require('react');
cx = require('classnames');
filesize = require('filesize');
position = require('../util/file-type');
Icon = React.createFactory(require('./icon')... | xss = require 'xss'
React = require 'react'
cx = require 'classnames'
filesize = require 'filesize'
position = require '../util/file-type'
Icon = React.createFactory require './icon'
{ div, span, a, i } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'message-rich-file'
propType... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:1:completion | completion | xss = require 'xss'
React = require 'react'
cx = require 'classnames'
filesize = require 'filesize'
position = require '../util/file-type'
Icon = React.createFactory require './icon'
{ div, span, a, i } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'message-rich-file'
propType... | onClick: (event) ->
event.stopPropagation()
unless @props.attachment.isUploading?
@props.onClick?()
onDownloadClick: (event) ->
event.stopPropagation()
renderFileType: ->
style =
backgroundPosition: position.get(@props.attachment.data)
div className: 'file-type', style: style
re... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:2:raw_corpus | raw_corpus | div className: 'file-details',
@renderFileName()
@renderFileSize()
renderActions: ->
unless @props.attachment.isUploading?
a
className: 'action'
href: @props.attachment.data.downloadUrl
onClick: @onDownloadClick
Icon name: 'download-solid', size: 18
render: ->... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 51 | 68 | ||
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
div className: 'file-details',
@renderFileName()
@renderFileSize()
renderActions: ->
unless @props.attachment.isUploading?
a
className: 'action'
href: @props.attachment.data.downloadUrl
onClick: @onDownloadClick
... | div({
className: 'file-details'
}, this.renderFileName(), this.renderFileSize());
({
renderActions: function() {
if (this.props.attachment.isUploading == null) {
return a({
className: 'action',
href: this.props.attachment.data.downloadUrl,
onClick: this.onDownloadClick
}, Ic... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 51 | 68 |
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
div({
className: 'file-details'
}, this.renderFileName(), this.renderFileSize());
({
renderActions: function() {
if (this.props.attachment.isUploading == null) {
return a({
className: 'action',
href: this.props.attachment.data.downloa... | div className: 'file-details',
@renderFileName()
@renderFileSize()
renderActions: ->
unless @props.attachment.isUploading?
a
className: 'action'
href: @props.attachment.data.downloadUrl
onClick: @onDownloadClick
Icon name: 'download-solid', size: 18
render: ->... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 51 | 68 |
jianliaoim/talk-os:talk-web/client/module/message-rich-file.coffee:2:completion | completion | div className: 'file-details',
@renderFileName()
@renderFileSize()
renderActions: ->
unless @props.attachment.isUploading?
a
className: 'action'
href: @props.attachment.data.downloadUrl | onClick: @onDownloadClick
Icon name: 'download-solid', size: 18
render: ->
className = cx 'attachment-file', 'is-clickable': not @props.attachment.isUploading?
div className: className, onClick: @onClick,
@renderFileType()
@renderFileDetails()
@renderActions() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/message-rich-file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/message-rich-file.coffee | 51 | 68 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.search = (searc... | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 8a9db5d5208a4acfd264afc641d3ff3e745487d5 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8a9db5d5208a4acfd264afc641d3ff3e745487d5/scripts/controllers/twitter.coffee | 1 | 17 | ||
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
... | /*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
function($scope,
$rootScope,
$location,
service) {
$scope.searchTerm = '';
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 8a9db5d5208a4acfd264afc641d3ff3e745487d5 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8a9db5d5208a4acfd264afc641d3ff3e745487d5/scripts/controllers/twitter.coffee | 1 | 17 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
function($scope,
$rootScope,
$... | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.search = (searc... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 8a9db5d5208a4acfd264afc641d3ff3e745487d5 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8a9db5d5208a4acfd264afc641d3ff3e745487d5/scripts/controllers/twitter.coffee | 1 | 17 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:completion | completion | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets | $scope.search = (searchTerm) ->
$location.path "/twitter/#{searchTerm}"
$scope.onRouteChange = (routeParams) ->
$scope.searchTerm = routeParams.searchTerm
service.get $scope.searchTerm
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 8a9db5d5208a4acfd264afc641d3ff3e745487d5 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8a9db5d5208a4acfd264afc641d3ff3e745487d5/scripts/controllers/twitter.coffee | 1 | 17 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.search = (searc... | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | f71adf9c94b291059af8de342e725937457a8170 | 672 | https://github.com/CaryLandholt/AngularFun/blob/f71adf9c94b291059af8de342e725937457a8170/scripts/controllers/twitter.coffee | 1 | 19 | ||
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
... | /*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
function($scope,
$rootScope,
$location,
service) {
$scope.searchTerm = '';
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | f71adf9c94b291059af8de342e725937457a8170 | 672 | https://github.com/CaryLandholt/AngularFun/blob/f71adf9c94b291059af8de342e725937457a8170/scripts/controllers/twitter.coffee | 1 | 19 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
function($scope,
$rootScope,
$... | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.search = (searc... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | f71adf9c94b291059af8de342e725937457a8170 | 672 | https://github.com/CaryLandholt/AngularFun/blob/f71adf9c94b291059af8de342e725937457a8170/scripts/controllers/twitter.coffee | 1 | 19 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:completion | completion | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets | $scope.search = (searchTerm) ->
$location.path "/twitter/#{searchTerm}"
$rootScope.$on 'twitter$routeChangeSuccess', (event, currentRoute, priorRoute) ->
$scope.searchTerm = currentRoute.params.searchTerm
service.get $scope.searchTerm
$scope.$broadcast 'changeTab#twitter'
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | f71adf9c94b291059af8de342e725937457a8170 | 672 | https://github.com/CaryLandholt/AngularFun/blob/f71adf9c94b291059af8de342e725937457a8170/scripts/controllers/twitter.coffee | 1 | 19 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.search = (searc... | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 83e68a53d7c24f7d417b494e4fef7451cf0e3d9b | 672 | https://github.com/CaryLandholt/AngularFun/blob/83e68a53d7c24f7d417b494e4fef7451cf0e3d9b/scripts/controllers/twitter.coffee | 1 | 19 | ||
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
... | /*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
function($scope,
$rootScope,
$location,
service) {
$scope.searchTerm = '';
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 83e68a53d7c24f7d417b494e4fef7451cf0e3d9b | 672 | https://github.com/CaryLandholt/AngularFun/blob/83e68a53d7c24f7d417b494e4fef7451cf0e3d9b/scripts/controllers/twitter.coffee | 1 | 19 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
function($scope,
$rootScope,
$... | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.search = (searc... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 83e68a53d7c24f7d417b494e4fef7451cf0e3d9b | 672 | https://github.com/CaryLandholt/AngularFun/blob/83e68a53d7c24f7d417b494e4fef7451cf0e3d9b/scripts/controllers/twitter.coffee | 1 | 19 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:completion | completion | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', ($scope, $rootScope, $location, service) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets | $scope.search = (searchTerm) ->
$location.path "/twitter/#{searchTerm}"
$rootScope.$on 'twitter$afterRouteChange', (event, currentRoute, priorRoute) ->
$scope.searchTerm = currentRoute.params.searchTerm
service.get $scope.searchTerm
$scope.$emit 'changeTab#twitter'
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 83e68a53d7c24f7d417b494e4fef7451cf0e3d9b | 672 | https://github.com/CaryLandholt/AngularFun/blob/83e68a53d7c24f7d417b494e4fef7451cf0e3d9b/scripts/controllers/twitter.coffee | 1 | 19 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', '$log', ($scope, $rootScope, $location, service, $log) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.s... | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/twitter.coffee | 1 | 24 | ||
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', '$log', ($scope, $rootScope, $location, service, $log) ->
$scope.sea... | /*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
'$log',
function($scope,
$rootScope,
$location,
service,
$log) {
$s... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/twitter.coffee | 1 | 24 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['controllers/controllers', 'services/twitter'], function(controllers) {
'use strict';
return controllers.controller('twitter', [
'$scope',
'$rootScope',
'$location',
'twitter',
'$log',
function($scope,
$root... | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', '$log', ($scope, $rootScope, $location, service, $log) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.s... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/twitter.coffee | 1 | 24 |
CaryLandholt/AngularFun:scripts/controllers/twitter.coffee:1:completion | completion | ###global define###
define ['controllers/controllers', 'services/twitter'], (controllers) ->
'use strict'
controllers.controller 'twitter', ['$scope', '$rootScope', '$location', 'twitter', '$log', ($scope, $rootScope, $location, service, $log) ->
$scope.searchTerm = ''
$scope.tweets = service.tweets
$scope.s... | $rootScope.$on 'twitter$afterRouteChange', (event, currentRoute, priorRoute) ->
$scope.searchTerm = currentRoute.params.searchTerm
service.get $scope.searchTerm, (Resource, getResponseHeaders) ->
return
#$log.info 'twitter.get success', Resource, getResponseHeaders()
, (obj) ->
return
#$log.er... | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitter.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/twitter.coffee | 1 | 24 |
jianliaoim/talk-os:talk-web/client/actions/prefs.coffee:1:raw_corpus | raw_corpus | dispatcher = require '../dispatcher'
api = require '../network/api'
exports.silentUpdate = (data) ->
dispatcher.handleViewAction {type: 'prefs/update', data}
# FIXME: 某个地方同时调用了这个action两次
exports.prefsUpdate = (data, success, fail) ->
api.preferences.update.put(data: data)
.then (resp) ->
dispatcher.han... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/prefs.coffee | 1 | 17 | ||
jianliaoim/talk-os:talk-web/client/actions/prefs.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
dispatcher = require '../dispatcher'
api = require '../network/api'
exports.silentUpdate = (data) ->
dispatcher.handleViewAction {type: 'prefs/update', data}
# FIXME: 某个地方同时调用了这个action两次
exports.prefsUpdate = (data, success, fail) ->
api.preferences.update... | var api, dispatcher;
dispatcher = require('../dispatcher');
api = require('../network/api');
exports.silentUpdate = function(data) {
return dispatcher.handleViewAction({
type: 'prefs/update',
data
});
};
// FIXME: 某个地方同时调用了这个action两次
exports.prefsUpdate = function(data, success, fail) {
return api.pre... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/prefs.coffee | 1 | 17 |
jianliaoim/talk-os:talk-web/client/actions/prefs.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var api, dispatcher;
dispatcher = require('../dispatcher');
api = require('../network/api');
exports.silentUpdate = function(data) {
return dispatcher.handleViewAction({
type: 'prefs/update',
data
});
};
// FIXME: 某个地方同时调用了这个action两次
exports.prefsUp... | dispatcher = require '../dispatcher'
api = require '../network/api'
exports.silentUpdate = (data) ->
dispatcher.handleViewAction {type: 'prefs/update', data}
# FIXME: 某个地方同时调用了这个action两次
exports.prefsUpdate = (data, success, fail) ->
api.preferences.update.put(data: data)
.then (resp) ->
dispatcher.han... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/prefs.coffee | 1 | 17 |
jianliaoim/talk-os:talk-web/client/actions/prefs.coffee:1:completion | completion | dispatcher = require '../dispatcher'
api = require '../network/api'
exports.silentUpdate = (data) ->
dispatcher.handleViewAction {type: 'prefs/update', data}
# FIXME: 某个地方同时调用了这个action两次 | exports.prefsUpdate = (data, success, fail) ->
api.preferences.update.put(data: data)
.then (resp) ->
dispatcher.handleViewAction
type: 'prefs/update'
data: resp
success? resp
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/prefs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/prefs.coffee | 1 | 17 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:raw_corpus | raw_corpus | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_modes/rgb.coffee | 1 | 39 | ||
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -... | module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
});
}
},
combineRgbChannel: function() {
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_modes/rgb.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
... | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_modes/rgb.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:completion | completion | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 then a = val
when 0 then r = val
when 1 then g = val
when 2 then b = val
@pixelData.set([r, g, b, a], i*4)
@readMaskData(rgbChannels)
readMaskData... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_modes/rgb.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:raw_corpus | raw_corpus | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | ab3490dc46a32aa4fab2ae5a1a904b15e5d87051 | 2,846 | https://github.com/meltingice/psd.js/blob/ab3490dc46a32aa4fab2ae5a1a904b15e5d87051/lib/psd/image_modes/rgb.coffee | 1 | 39 | ||
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -... | module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
});
}
},
combineRgbChannel: function() {
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | ab3490dc46a32aa4fab2ae5a1a904b15e5d87051 | 2,846 | https://github.com/meltingice/psd.js/blob/ab3490dc46a32aa4fab2ae5a1a904b15e5d87051/lib/psd/image_modes/rgb.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
... | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | ab3490dc46a32aa4fab2ae5a1a904b15e5d87051 | 2,846 | https://github.com/meltingice/psd.js/blob/ab3490dc46a32aa4fab2ae5a1a904b15e5d87051/lib/psd/image_modes/rgb.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:completion | completion | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 then a = val
when 0 then r = val
when 1 then g = val
when 2 then b = val
@pixelData.set([r, g, b, a], i * 4)
@readMaskData(rgbChannels)
readMask... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | ab3490dc46a32aa4fab2ae5a1a904b15e5d87051 | 2,846 | https://github.com/meltingice/psd.js/blob/ab3490dc46a32aa4fab2ae5a1a904b15e5d87051/lib/psd/image_modes/rgb.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:raw_corpus | raw_corpus | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | c20226221285271a88beb9bbe1c13e673eafca25 | 2,846 | https://github.com/meltingice/psd.js/blob/c20226221285271a88beb9bbe1c13e673eafca25/lib/psd/image_modes/rgb.coffee | 1 | 42 | ||
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -... | module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
});
}
},
combineRgbChannel: function() {
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | c20226221285271a88beb9bbe1c13e673eafca25 | 2,846 | https://github.com/meltingice/psd.js/blob/c20226221285271a88beb9bbe1c13e673eafca25/lib/psd/image_modes/rgb.coffee | 1 | 42 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
... | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | c20226221285271a88beb9bbe1c13e673eafca25 | 2,846 | https://github.com/meltingice/psd.js/blob/c20226221285271a88beb9bbe1c13e673eafca25/lib/psd/image_modes/rgb.coffee | 1 | 42 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:completion | completion | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | switch chan
when -1 then a = val
when 0 then r = val
when 1 then g = val
when 2 then b = val
switch @channels()
when 3 then @pixelData.set([r, g, b], i * 3)
when 4 then @pixelData.set([r, g, b, a], i * 4)
@readMaskData(rgbChannels)
readMaskData... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | c20226221285271a88beb9bbe1c13e673eafca25 | 2,846 | https://github.com/meltingice/psd.js/blob/c20226221285271a88beb9bbe1c13e673eafca25/lib/psd/image_modes/rgb.coffee | 1 | 42 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:raw_corpus | raw_corpus | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 111ea5a8d4e208b7de98d94d4f3cc0cce04d9140 | 2,846 | https://github.com/meltingice/psd.js/blob/111ea5a8d4e208b7de98d94d4f3cc0cce04d9140/lib/psd/image_modes/rgb.coffee | 1 | 29 | ||
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -... | module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
});
}
},
combineRgbChannel: function() {
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 111ea5a8d4e208b7de98d94d4f3cc0cce04d9140 | 2,846 | https://github.com/meltingice/psd.js/blob/111ea5a8d4e208b7de98d94d4f3cc0cce04d9140/lib/psd/image_modes/rgb.coffee | 1 | 29 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
setRgbChannels: function() {
this.channelsInfo = [
{
id: 0
},
{
id: 1
},
{
id: 2
}
];
if (this.channels() === 4) {
return this.channelsInfo.push({
id: -1
... | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2
for i in [0...@numPixel... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 111ea5a8d4e208b7de98d94d4f3cc0cce04d9140 | 2,846 | https://github.com/meltingice/psd.js/blob/111ea5a8d4e208b7de98d94d4f3cc0cce04d9140/lib/psd/image_modes/rgb.coffee | 1 | 29 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:completion | completion | module.exports =
setRgbChannels: ->
@channelsInfo = [
{id: 0}
{id: 1}
{id: 2}
]
@channelsInfo.push {id: -1} if @channels() is 4
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1 # Mask data is -2 | for i in [0...@numPixels]
r = g = b = 0
a = 255
for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 then a = val
when 0 then r = val
when 1 then g = val
when 2 then b = val
@pixelData.pu... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 111ea5a8d4e208b7de98d94d4f3cc0cce04d9140 | 2,846 | https://github.com/meltingice/psd.js/blob/111ea5a8d4e208b7de98d94d4f3cc0cce04d9140/lib/psd/image_modes/rgb.coffee | 1 | 29 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:raw_corpus | raw_corpus | module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = 0
a = 255
for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
... | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 5eda9ee0e6988902fee9ae3c51c614b1de5da659 | 2,846 | https://github.com/meltingice/psd.js/blob/5eda9ee0e6988902fee9ae3c51c614b1de5da659/lib/psd/image_modes/rgb.coffee | 1 | 20 | ||
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = 0
a = 255
for chan, index in rgbChannels
val = @channelData[i + ... | module.exports = {
combineRgbChannel: function() {
var a, b, chan, g, i, index, j, k, len, r, ref, results, rgbChannels, val;
rgbChannels = this.channelsInfo.map(function(ch) {
return ch.id;
}).filter(function(ch) {
return ch >= -1;
});
results = [];
for (i = j = 0, ref = this.numP... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 5eda9ee0e6988902fee9ae3c51c614b1de5da659 | 2,846 | https://github.com/meltingice/psd.js/blob/5eda9ee0e6988902fee9ae3c51c614b1de5da659/lib/psd/image_modes/rgb.coffee | 1 | 20 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
combineRgbChannel: function() {
var a, b, chan, g, i, index, j, k, len, r, ref, results, rgbChannels, val;
rgbChannels = this.channelsInfo.map(function(ch) {
return ch.id;
}).filter(function(ch) {
return ch >= -1;
})... | module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = 0
a = 255
for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 5eda9ee0e6988902fee9ae3c51c614b1de5da659 | 2,846 | https://github.com/meltingice/psd.js/blob/5eda9ee0e6988902fee9ae3c51c614b1de5da659/lib/psd/image_modes/rgb.coffee | 1 | 20 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:completion | completion | module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = 0
a = 255 | for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 then a = val
when 0 then r = val
when 1 then g = val
when 2 then b = val
@pixelData.push r, g, b, a | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 5eda9ee0e6988902fee9ae3c51c614b1de5da659 | 2,846 | https://github.com/meltingice/psd.js/blob/5eda9ee0e6988902fee9ae3c51c614b1de5da659/lib/psd/image_modes/rgb.coffee | 1 | 20 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:raw_corpus | raw_corpus | module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = a = 0
for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 th... | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/image_modes/rgb.coffee | 1 | 19 | ||
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = a = 0
for chan, index in rgbChannels
val = @channelData[i + (@channelL... | module.exports = {
combineRgbChannel: function() {
var a, b, chan, g, i, index, j, k, len, r, ref, results, rgbChannels, val;
rgbChannels = this.channelsInfo.map(function(ch) {
return ch.id;
}).filter(function(ch) {
return ch >= -1;
});
results = [];
for (i = j = 0, ref = this.numP... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/image_modes/rgb.coffee | 1 | 19 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
combineRgbChannel: function() {
var a, b, chan, g, i, index, j, k, len, r, ref, results, rgbChannels, val;
rgbChannels = this.channelsInfo.map(function(ch) {
return ch.id;
}).filter(function(ch) {
return ch >= -1;
})... | module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = a = 0
for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 th... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/image_modes/rgb.coffee | 1 | 19 |
meltingice/psd.js:lib/psd/image_modes/rgb.coffee:1:completion | completion | module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = a = 0 | for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 then a = 255 - val
when 0 then r = val
when 1 then g = val
when 2 then b = val
@pixelData.push r, g, b, a | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_modes/rgb.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/image_modes/rgb.coffee | 1 | 19 |
snd/url-pattern:test/misc.coffee:1:raw_corpus | raw_corpus | test = require 'tape'
UrlPattern = require '../lib/url-pattern'
test 'instance of UrlPattern is handled correctly as constructor argument', (t) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
t.deepEqual copy.match('/user/10/task/52'),
userId: '10'
taskId:... | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | 845881ae23ee8dd2a2b106dfbadabe1d91b532a8 | 588 | https://github.com/snd/url-pattern/blob/845881ae23ee8dd2a2b106dfbadabe1d91b532a8/test/misc.coffee | 1 | 30 | ||
snd/url-pattern:test/misc.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test = require 'tape'
UrlPattern = require '../lib/url-pattern'
test 'instance of UrlPattern is handled correctly as constructor argument', (t) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
t.deepEqual copy.ma... | var UrlPattern, test;
test = require('tape');
UrlPattern = require('../lib/url-pattern');
test('instance of UrlPattern is handled correctly as constructor argument', function(t) {
var copy, pattern;
pattern = new UrlPattern('/user/:userId/task/:taskId');
copy = new UrlPattern(pattern);
t.deepEqual(copy.match... | CoffeeScript | JavaScript | snd/url-pattern | test/misc.coffee | MIT | 845881ae23ee8dd2a2b106dfbadabe1d91b532a8 | 588 | https://github.com/snd/url-pattern/blob/845881ae23ee8dd2a2b106dfbadabe1d91b532a8/test/misc.coffee | 1 | 30 |
snd/url-pattern:test/misc.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var UrlPattern, test;
test = require('tape');
UrlPattern = require('../lib/url-pattern');
test('instance of UrlPattern is handled correctly as constructor argument', function(t) {
var copy, pattern;
pattern = new UrlPattern('/user/:userId/task/:taskId');
c... | test = require 'tape'
UrlPattern = require '../lib/url-pattern'
test 'instance of UrlPattern is handled correctly as constructor argument', (t) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
t.deepEqual copy.match('/user/10/task/52'),
userId: '10'
taskId:... | JavaScript | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | 845881ae23ee8dd2a2b106dfbadabe1d91b532a8 | 588 | https://github.com/snd/url-pattern/blob/845881ae23ee8dd2a2b106dfbadabe1d91b532a8/test/misc.coffee | 1 | 30 |
snd/url-pattern:test/misc.coffee:1:completion | completion | test = require 'tape'
UrlPattern = require '../lib/url-pattern'
test 'instance of UrlPattern is handled correctly as constructor argument', (t) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
t.deepEqual copy.match('/user/10/task/52'),
userId: '10'
taskId:... | t.deepEqual pattern.match('/api/v1/user/test.name/'),
id: 'test.name'
t.end()
test 'regex group names', (t) ->
pattern = new UrlPattern /^\/api\/([a-zA-Z0-9-_~ %]+)(?:\/(\d+))?$/, ['resource', 'id']
t.deepEqual pattern.match('/api/users'),
resource: 'users'
t.equal pattern.match('/apiii/users'), null
... | CoffeeScript | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | 845881ae23ee8dd2a2b106dfbadabe1d91b532a8 | 588 | https://github.com/snd/url-pattern/blob/845881ae23ee8dd2a2b106dfbadabe1d91b532a8/test/misc.coffee | 1 | 30 |
snd/url-pattern:test/misc.coffee:1:raw_corpus | raw_corpus | UrlPattern = require '../lib/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual copy.match('/user/10/task/52'),
userId: '10'
... | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | d9843a09ca2171908c18198f7906eae6a58086e6 | 588 | https://github.com/snd/url-pattern/blob/d9843a09ca2171908c18198f7906eae6a58086e6/test/misc.coffee | 1 | 31 | ||
snd/url-pattern:test/misc.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
UrlPattern = require '../lib/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual co... | var UrlPattern;
UrlPattern = require('../lib/url-pattern');
module.exports = {
'instance of UrlPattern is handled correctly as constructor argument': function(test) {
var copy, pattern;
pattern = new UrlPattern('/user/:userId/task/:taskId');
copy = new UrlPattern(pattern);
test.deepEqual(copy.match(... | CoffeeScript | JavaScript | snd/url-pattern | test/misc.coffee | MIT | d9843a09ca2171908c18198f7906eae6a58086e6 | 588 | https://github.com/snd/url-pattern/blob/d9843a09ca2171908c18198f7906eae6a58086e6/test/misc.coffee | 1 | 31 |
snd/url-pattern:test/misc.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var UrlPattern;
UrlPattern = require('../lib/url-pattern');
module.exports = {
'instance of UrlPattern is handled correctly as constructor argument': function(test) {
var copy, pattern;
pattern = new UrlPattern('/user/:userId/task/:taskId');
copy = ... | UrlPattern = require '../lib/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual copy.match('/user/10/task/52'),
userId: '10'
... | JavaScript | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | d9843a09ca2171908c18198f7906eae6a58086e6 | 588 | https://github.com/snd/url-pattern/blob/d9843a09ca2171908c18198f7906eae6a58086e6/test/misc.coffee | 1 | 31 |
snd/url-pattern:test/misc.coffee:1:completion | completion | UrlPattern = require '../lib/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual copy.match('/user/10/task/52'),
userId: '10'
... | pattern = new UrlPattern '/api/v1/user/:id/', options
test.deepEqual pattern.match('/api/v1/user/test.name/'),
id: 'test.name'
test.done()
'regex group names': (test) ->
pattern = new UrlPattern /^\/api\/([a-zA-Z0-9-_~ %]+)(?:\/(\d+))?$/, ['resource', 'id']
test.deepEqual pattern.match('/... | CoffeeScript | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | d9843a09ca2171908c18198f7906eae6a58086e6 | 588 | https://github.com/snd/url-pattern/blob/d9843a09ca2171908c18198f7906eae6a58086e6/test/misc.coffee | 1 | 31 |
snd/url-pattern:test/misc.coffee:1:raw_corpus | raw_corpus | UrlPattern = require '../src/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual copy.match('/user/10/task/52'),
userId: '10'
... | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | a68aac5d952e18f298a355c877ef812c8f98fd55 | 588 | https://github.com/snd/url-pattern/blob/a68aac5d952e18f298a355c877ef812c8f98fd55/test/misc.coffee | 1 | 31 | ||
snd/url-pattern:test/misc.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
UrlPattern = require '../src/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual co... | var UrlPattern;
UrlPattern = require('../src/url-pattern');
module.exports = {
'instance of UrlPattern is handled correctly as constructor argument': function(test) {
var copy, pattern;
pattern = new UrlPattern('/user/:userId/task/:taskId');
copy = new UrlPattern(pattern);
test.deepEqual(copy.match(... | CoffeeScript | JavaScript | snd/url-pattern | test/misc.coffee | MIT | a68aac5d952e18f298a355c877ef812c8f98fd55 | 588 | https://github.com/snd/url-pattern/blob/a68aac5d952e18f298a355c877ef812c8f98fd55/test/misc.coffee | 1 | 31 |
snd/url-pattern:test/misc.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var UrlPattern;
UrlPattern = require('../src/url-pattern');
module.exports = {
'instance of UrlPattern is handled correctly as constructor argument': function(test) {
var copy, pattern;
pattern = new UrlPattern('/user/:userId/task/:taskId');
copy = ... | UrlPattern = require '../src/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual copy.match('/user/10/task/52'),
userId: '10'
... | JavaScript | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | a68aac5d952e18f298a355c877ef812c8f98fd55 | 588 | https://github.com/snd/url-pattern/blob/a68aac5d952e18f298a355c877ef812c8f98fd55/test/misc.coffee | 1 | 31 |
snd/url-pattern:test/misc.coffee:1:completion | completion | UrlPattern = require '../src/url-pattern'
module.exports =
'instance of UrlPattern is handled correctly as constructor argument': (test) ->
pattern = new UrlPattern '/user/:userId/task/:taskId'
copy = new UrlPattern pattern
test.deepEqual copy.match('/user/10/task/52'),
userId: '10'
... | pattern = new UrlPattern '/api/v1/user/:id/', options
test.deepEqual pattern.match('/api/v1/user/test.name/'),
id: 'test.name'
test.done()
'regex group names': (test) ->
pattern = new UrlPattern /^\/api\/([a-zA-Z0-9-_~ %]+)(?:\/(\d+))?$/, ['resource', 'id']
test.deepEqual pattern.match('/... | CoffeeScript | CoffeeScript | snd/url-pattern | test/misc.coffee | MIT | a68aac5d952e18f298a355c877ef812c8f98fd55 | 588 | https://github.com/snd/url-pattern/blob/a68aac5d952e18f298a355c877ef812c8f98fd55/test/misc.coffee | 1 | 31 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.