Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Use empty string as server location so current host is used | define [
'models/server'
'vendor/underscore'
'vendor/jquery'
], ( Server ) ->
# Application base class
#
class App
id: null
serverAddress: '192.168.1.30'
# Constructs a new app.
#
constructor: ( ) ->
@_initTime = performance.now()
@server = new Server(@serverAddress)
@initialize()
... | define [
'models/server'
'vendor/underscore'
'vendor/jquery'
], ( Server ) ->
# Application base class
#
class App
id: null
serverAddress: ''
# Constructs a new app.
#
constructor: ( ) ->
@_initTime = performance.now()
@server = new Server(@serverAddress)
@initialize()
# Is called... |
Add little trick to ParamHandler, so we can handle with on minus too | class ParamHandler
constructor: (@payload = {}) ->
getArguments: (process, callback) ->
match = process.argv.join(' ').match /--[a-zA-Z]* ([a-zA-Z0-9]*)/g
match.map (found) =>
parse = found.match(/--([a-zA-Z]*)\s/)
@payload[parse[1]] = found.replace parse[0], ''
callback @payload
module... | class ParamHandler
constructor: (@payload = {}) ->
getArguments: (process, callback) ->
match = process.argv.join(' ').match /--[a-zA-Z]* ([a-zA-Z0-9]*)/g
match.map (found) =>
parse = found.match(/-{1,2}([a-zA-Z]*)\s/)
@payload[parse[1]] = found.replace parse[0], ''
callback @payload
mod... |
Test all intersections against all spheres | Sphere = require '../sim/sphere'
Vec = require('three').Vector3
assert = require 'assert'
{expect} = require 'chai'
describe 'Sphere', ->
it 'should trilaterate properly', ->
s1 = new Sphere 1, new Vec 0, 0, 0
s2 = new Sphere 1, new Vec 1, 0, 0
s3 = new Sphere 1, new Vec .5, 1, 0
[i1, i2] = Sp... | Sphere = require '../sim/sphere'
Vec = require('three').Vector3
assert = require 'assert'
{expect} = require 'chai'
describe 'Sphere', ->
it 'should trilaterate properly', ->
s1 = new Sphere 1, new Vec 0, 0, 0
s2 = new Sphere 1, new Vec 1, 0, 0
s3 = new Sphere 1, new Vec .5, 1, 0
[i1, i2] = Sp... |
Fix issue with javascript error causing category choosing functionality to break for a product with variants. | $ ->
#
# Refresh the order
#
calculateTax = (form, invokeField)->
if $('select#product_tax_rate_id', form).val().length > 0
$('input#product_price_including_tax', form).prop('disabled', false)
else
$('input#product_price_including_tax', form).prop('disabled', true)
$('input#product_pr... | $ ->
#
# Refresh the order
#
calculateTax = (form, invokeField)->
if $('select#product_tax_rate_id', form).val().length > 0
$('input#product_price_including_tax', form).prop('disabled', false)
else
$('input#product_price_including_tax', form).prop('disabled', true)
$('input#product_pr... |
Make blocked users only available to Koding group. | kd = require 'kd'
KDView = kd.View
KDTabView = kd.TabView
KDTabPaneView = kd.TabPaneView
TeamMembersCommonView = require './teammemberscommonview'
GroupsBlockedUserView = require '../groupsblockeduserview'
module.exports = class AdminMembersView extends KDView
... | kd = require 'kd'
KDView = kd.View
isKoding = require 'app/util/isKoding'
KDTabView = kd.TabView
KDTabPaneView = kd.TabPaneView
TeamMembersCommonView = require './teammemberscommonview'
GroupsBlockedUserView = require '../groupsblockeduserview'
module... |
Add guards to make Facebook renewal more robust | FactlinkApp.module "FacebookRenewal", (FacebookRenewal, FactlinkApp, Backbone, Marionette, $, _) ->
class IframeView extends Backbone.Marionette.ItemView
template:
text: """
<iframe src="/auth/facebook"></iframe>
"""
FacebookRenewal.addInitializer ->
if currentUser?.get('services')['fa... | FactlinkApp.module "FacebookRenewal", (FacebookRenewal, FactlinkApp, Backbone, Marionette, $, _) ->
class IframeView extends Backbone.Marionette.ItemView
template:
text: """
<iframe class="facebook_renewal_iframe" src="/auth/facebook"></iframe>
"""
FacebookRenewal.addInitializer ->
if ... |
Remove check of model state in DurationCalculation | Travis.DurationCalculations = Ember.Mixin.create
duration: (->
if duration = @get('_duration')
duration
else
Travis.Helpers.durationFrom(@get('startedAt'), @get('finishedAt'))
).property('_duration', 'finishedAt', 'startedAt')
updateTimes: ->
unless ['rootState.loaded.reloading', 'rootSta... | Travis.DurationCalculations = Ember.Mixin.create
duration: (->
if duration = @get('_duration')
duration
else
Travis.Helpers.durationFrom(@get('startedAt'), @get('finishedAt'))
).property('_duration', 'finishedAt', 'startedAt')
updateTimes: ->
unless @get('isFinished')
@notifyPropert... |
Include the role '_creator' used by Cloudant to the allowed type of users | utils = require('lib/utils')
exports.validate_doc_update = (newDoc, oldDoc, userCtx) ->
types = ['essay','scene','video','profile']
access = if '_admin' in userCtx.roles or 'admin' in userCtx.roles or 'manager' in userCtx.roles then true else false
if not access
throw unauthorized: 'You must have the ro... | utils = require('lib/utils')
exports.validate_doc_update = (newDoc, oldDoc, userCtx) ->
types = ['essay','scene','video','profile']
access = if '_admin' in userCtx.roles or '_creator' in userCtx.roles or 'admin' in userCtx.roles or 'manager' in userCtx.roles then true else false
if not access
throw unau... |
Fix typo in repos/language view | module.exports =
_id: '_design/repos'
languange: 'javascript'
views:
by_watchers:
map: (doc) -> emit doc.watchers, doc.description if doc.watchers
by_language:
map: (doc) -> emit doc.languange, doc.description if doc.languange
by_prefix:
map: (doc) ->
return unless doc.type ... | module.exports =
_id: '_design/repos'
languange: 'javascript'
views:
by_watchers:
map: (doc) -> emit doc.watchers, doc.description if doc.watchers
by_language:
map: (doc) -> emit doc.language, doc.description if doc.language
by_prefix:
map: (doc) ->
return unless doc.type is... |
Replace is not with isnt - damn you CoffeeScript | Darkswarm.factory "AuthenticationService", (Navigation, $modal, $location, Redirections)->
new class AuthenticationService
selectedPath: "/login"
constructor: ->
if $location.path() in ["/login", "/signup", "/forgot"] && location.pathname is not '/register/auth'
@open $location.path()
el... | Darkswarm.factory "AuthenticationService", (Navigation, $modal, $location, Redirections)->
new class AuthenticationService
selectedPath: "/login"
constructor: ->
if $location.path() in ["/login", "/signup", "/forgot"] && location.pathname isnt '/register/auth'
@open $location.path()
else... |
Fix commits calendar vertical days. | class @calendar
options =
month: "short"
day: "numeric"
year: "numeric"
constructor: (timestamps, starting_year, starting_month) ->
cal = new CalHeatMap()
cal.init
itemName: ["commit"]
data: timestamps
start: new Date(starting_year, starting_month)
domainLabelFormat: "%b... | class @calendar
options =
month: "short"
day: "numeric"
year: "numeric"
constructor: (timestamps, starting_year, starting_month) ->
cal = new CalHeatMap()
cal.init
itemName: ["commit"]
data: timestamps
start: new Date(starting_year, starting_month)
domainLabelFormat: "%b... |
Fix bug where coffeescript would only execute after page refresh. | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
window.onload = ->
btn = undefined
modal = undefined
span = undefined
modal = document.getElementByI... | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
ready = ->
btn = undefined
modal = undefined
span = undefined
modal = document.getElementByI... |
Add commented out docker config | Path = require "path"
module.exports =
# Options are passed to Sequelize.
# See http://sequelizejs.com/documentation#usage-options for details
mysql:
clsi:
database: "clsi"
username: "clsi"
password: null
dialect: "sqlite"
storage: Path.resolve(__dirname + "/../db.sqlite")
path:
compilesDir: ... | Path = require "path"
module.exports =
# Options are passed to Sequelize.
# See http://sequelizejs.com/documentation#usage-options for details
mysql:
clsi:
database: "clsi"
username: "clsi"
password: null
dialect: "sqlite"
storage: Path.resolve(__dirname + "/../db.sqlite")
path:
compilesDir: ... |
Fix IE10 bug on guide | Page = require 'controllers/page'
class GuidePage extends Page
el: $('.guide')
className: 'guide'
events:
'click .menu li' : 'show'
active: ->
super
@el.scroll() # trick lazyload
show: (e) =>
target = e.currentTarget
$(target).addClass('show').siblings('li').removeClass('show... | Page = require 'controllers/page'
class GuidePage extends Page
el: $('.guide')
className: 'guide'
events:
'click .menu li' : 'show'
active: ->
super
@el.scroll() # trick lazyload
show: (e) =>
target = e.currentTarget
type = $(target).data('type')
$(target).addClass('... |
Use ~/.config/au.json to store settings. | {existsSync} = require './utils'
{join} = require 'path'
settingsPath = join process.env.HOME, '.config', '/au'
if existsSync settingsPath
settings = require settingsPath or {}
program = require('commander')
.version(require('../package.json').version)
help = -> console.log program.helpInformation()
program
... | {existsSync} = require './utils'
{join} = require 'path'
settingsPath = join process.env.HOME, '.config', 'au.json'
if existsSync settingsPath
settings = require settingsPath or {}
program = require('commander')
.version(require('../package.json').version)
help = -> console.log program.helpInformation()
program... |
Rename context snippet to con | # Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#... | # Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#... |
Fix hasSearch method, it wasn't working with sublevel of a object | Dashboard.SearchTab = Ember.View.extend
type: 'view'
templateName: 'search-tab'
routeName: ''
tagName: ''
routeParams: (->
@get('controller.searchRouteParams')
).property('controller.searchRouteParams')
hasSearch: (->
hasSearch = false
$.map @get('controller.search'), (value)=>
if val... | Dashboard.SearchTab = Ember.View.extend
type: 'view'
templateName: 'search-tab'
routeName: ''
tagName: ''
routeParams: (->
@get('controller.searchRouteParams')
).property('controller.searchRouteParams')
hasSearch: (->
hasValues = (values)->
results = []
$.map values, (value)=>
... |
Fix incorrect subclass for LoadView | define [
'./core'
], (c) ->
class StateView extends c.Marionette.ItemView
constructor: ->
super
if not @template?
if @options.template
@template = @options.template
else
html = []
if (... | define [
'./core'
], (c) ->
class StateView extends c.Marionette.ItemView
constructor: ->
super
if not @template?
if @options.template
@template = @options.template
else
html = []
if (... |
Fix bug with active tab remembering (saving cookie with different path) | class @ProjectShow
constructor: ->
$('.project-home-panel .star').on 'ajax:success', (e, data, status, xhr) ->
$(@).toggleClass('on').find('.count').html(data.star_count)
.on 'ajax:error', (e, xhr, status, error) ->
new Flash('Star toggle failed. Try again later.', 'alert')
$("a[data-toggle='... | class @ProjectShow
constructor: ->
$('.project-home-panel .star').on 'ajax:success', (e, data, status, xhr) ->
$(@).toggleClass('on').find('.count').html(data.star_count)
.on 'ajax:error', (e, xhr, status, error) ->
new Flash('Star toggle failed. Try again later.', 'alert')
$("a[data-toggle='... |
Add Extension types for objc | extensionsByFenceName =
'bash': 'sh'
'coffee': 'coffee'
'coffeescript': 'coffee'
'coffee-script': 'coffee'
'css': 'css'
'go': 'go'
'java': 'java'
'javascript': 'js'
'js': 'js'
'json': 'json'
'less': 'less'
'mustache': 'mustache'
'python': 'py'
'rb': 'rb'
'ruby': 'rb'
'sh': 'sh'
'toml':... | extensionsByFenceName =
'bash': 'sh'
'coffee': 'coffee'
'coffeescript': 'coffee'
'coffee-script': 'coffee'
'css': 'css'
'go': 'go'
'java': 'java'
'javascript': 'js'
'js': 'js'
'json': 'json'
'less': 'less'
'mustache': 'mustache'
'objc': 'm'
'objective-c': 'm'
'python': 'py'
'rb': 'rb'
... |
Allow multiple pagers on a single page. | Rahani.module 'Helpers', ->
@pagination = (view, collection, selector = '.pager-region') ->
@paginationView = new Rahani.Views.Application.Pagination
collection: collection
renderPagination = =>
view.$el.find(selector).html(@paginationView.render().el)
view.on 'render', renderPagination
... | Rahani.module 'Helpers', ->
@pagination = (view, collection, selector = '.pager-region') ->
paginationView = new Rahani.Views.Application.Pagination
collection: collection
renderPagination = =>
view.$el.find(selector).html(paginationView.render().el)
view.on 'render', renderPagination
p... |
Test que comprueba cuando estamos cargando. | require 'jquery.history.js'
require 'jquery.paginator.js'
describe "Paginator", ->
beforeEach ->
loadFixtures('paginator.html')
$('#list').ajaxPaginator()
describe 'clicking a link', ->
link = null
beforeEach ->
link = $('.pagination a:first')
link.click()
it "calls the link via ... | require 'jquery.history.js'
require 'jquery.paginator.js'
describe "Paginator", ->
beforeEach ->
loadFixtures('paginator.html')
$('#list').ajaxPaginator()
describe 'clicking a link', ->
link = null
beforeEach ->
link = $('.pagination a:first')
link.click()
it "calls the link via ... |
Fix deprecated selectors in keymap | '.platform-darwin, .platform-darwin .command-palette .editor':
'cmd-shift-p': 'command-palette:toggle'
'.platform-win32, .platform-win32 .command-palette .editor':
'ctrl-shift-p': 'command-palette:toggle'
'.platform-linux, .platform-linux .command-palette .editor':
'ctrl-shift-p': 'command-palette:toggle'
| '.platform-darwin, .platform-darwin .command-palette atom-text-editor':
'cmd-shift-p': 'command-palette:toggle'
'.platform-win32, .platform-win32 .command-palette atom-text-editor':
'ctrl-shift-p': 'command-palette:toggle'
'.platform-linux, .platform-linux .command-palette atom-text-editor':
'ctrl-shift-p': 'co... |
Make Books Page Load Faster | App = require '../app'
Book = require './model'
App.PriceChartView = require './price-chart'
# App.BookRoute = Ember.Route.extend
# serialize: (model) ->
# book_id: model._id
App.BookController = Ember.ObjectController.extend
deleteBook: ->
title = @get('model').get('title')
@get('model').one 'didD... | App = require '../app'
Book = require './model'
App.PriceChartView = require './price-chart'
App.BookRoute = Ember.Route.extend
model: (params) ->
Book.find(params.book_id)
App.BookController = Ember.ObjectController.extend
deleteBook: ->
title = @get('model').get('title')
@get('model').one 'didDel... |
Add TODO for database migrations | # Module dependencies.
models = require '../models'
app = require('../app')(models.sequelize)
http = require 'http'
config = require '../config'
# Event listener for HTTP server "error" event.
onError = (error) ->
if error.syscall != 'listen'
throw error
bind = if typeof port == 'string' then 'Pipe ' ... | # Module dependencies.
models = require '../models'
app = require('../app')(models.sequelize)
http = require 'http'
config = require '../config'
# Event listener for HTTP server "error" event.
onError = (error) ->
if error.syscall != 'listen'
throw error
bind = if typeof port == 'string' then 'Pipe ' ... |
Implement back button. Wasn't that hard. | window.MandrillMerge or= {}
class MandrillMergeApp
constructor: ->
@bindEvents()
bindEvents: ->
$('#hello-coffeescript').on('click', @greet)
submit_my_form: (caller)->
caller.parent().prev('form').submit()
go_back: (caller)->
alert 'watch this space'
$ ->
window.MandrillMerge.app = new Ma... | window.MandrillMerge or= {}
class MandrillMergeApp
constructor: ->
@bindEvents()
bindEvents: ->
$('#hello-coffeescript').on('click', @greet)
submit_my_form: (caller)->
caller.parent().prev('form').submit()
go_back: (caller)->
caller.parents('.accordion-navigation').prev().find('a').click()
... |
Refactor service to remove extra promise | angular.module('Sprangular.StaticContent').service 'StaticContent', ($q, $http) ->
service =
current: {}
findContent: (id) ->
_service = @
deferred = $q.defer()
$http.get "/api/pages/#{id}.json"
.success (data) ->
_service.current = data
deferred.resolve "Success... | angular.module('Sprangular.StaticContent').service 'StaticContent', ($q, $http) ->
service =
findContent: (id) ->
$http.get "/api/pages/#{id}.json"
service
|
Simplify logic, use tutor-ui-banner class | React = require 'react'
BS = require 'react-bootstrap'
{TaskActions} = require '../../flux/task'
{TaskStepActions, TaskStepStore} = require '../../flux/task-step'
LoadableItem = require '../loadable-item'
{CardBody} = require '../pinned-header-footer-card/sections'
_ = require 'underscore'
module.exports =
getInit... | React = require 'react'
BS = require 'react-bootstrap'
_ = require 'underscore'
LoadableItem = require '../loadable-item'
{CardBody} = require '../pinned-header-footer-card/sections'
module.exports =
renderGenericFooter: ->
buttonClasses = '-continue'
buttonClasses += ' disabled' unless @isContinueEnabled(... |
Add explicit assertion count for model test case tests | QUnit.module "Batman.ModelTestCase",
setup: ->
@testCase = new Batman.ModelTestCase
class @Foo extends Batman.Model
@resourceName: 'foo'
@validate 'title', presence: true
@encode 'foo', 'bar'
@encode 'baz',
decode: false
encode: (v) -> "!#{v}!"
@foo = new @Foo
... | QUnit.module "Batman.ModelTestCase",
setup: ->
@testCase = new Batman.ModelTestCase
class @Foo extends Batman.Model
@resourceName: 'foo'
@validate 'title', presence: true
@encode 'foo', 'bar'
@encode 'baz',
decode: false
encode: (v) -> "!#{v}!"
@foo = new @Foo
... |
Make highlights even less talkative. aka not at all | #!highlights/node_modules/coffee-script/bin/coffee
Highlights = require 'highlights'
fs = require 'fs'
path = require 'path'
highlighter = new Highlights()
highlighter.requireGrammarsSync
modulePath: require.resolve('./atom-language-perl6/package.json')
stdin = process.openStdin()
stdin.setEncoding 'utf8'
stdin.o... | #!highlights/node_modules/coffee-script/bin/coffee
Highlights = require 'highlights'
fs = require 'fs'
path = require 'path'
highlighter = new Highlights()
highlighter.requireGrammarsSync
modulePath: require.resolve('./atom-language-perl6/package.json')
stdin = process.openStdin()
stdin.setEncoding 'utf8'
mystderr... |
Remove workspace opener on deactivate | styleguideUri = 'atom://styleguide'
createStyleguideView = (state) ->
StyleguideView = require './styleguide-view'
new StyleguideView(state)
atom.deserializers.add
name: 'StyleguideView'
deserialize: (state) -> createStyleguideView(state)
module.exports =
activate: ->
atom.workspace.addOpener (filePath... | {CompositeDisposable} = require 'atom'
StyleguideUri = 'atom://styleguide'
createStyleguideView = (state) ->
StyleguideView = require './styleguide-view'
new StyleguideView(state)
atom.deserializers.add
name: 'StyleguideView'
deserialize: (state) -> createStyleguideView(state)
module.exports =
activate: ->... |
Fix chapter page nav direction | $ ->
$owl = $(".chapter-projects")
$owl.owlCarousel
loop: false,
nav: true,
margin: 10,
autoWidth: true,
dotsContainer: ".owl-dots-wrapper #owl-dots",
responsive:
0: {items: 2},
600: {items: 2},
960: {items: 2},
1200: {items: 3... | $ ->
$owl = $(".chapter-projects")
$owl.owlCarousel
loop: false,
nav: true,
margin: 10,
autoWidth: true,
dotsContainer: ".owl-dots-wrapper #owl-dots",
responsive:
0: {items: 2},
600: {items: 2},
960: {items: 2},
1200: {items: 3... |
Set up a one-way binding for the paginator input | App.CurrentPaginatorPageView = Em.TextField.extend
classNames: 'input-mini'
# If we bind the value to the currentPageNo of the controller, it will
# a page change for each key press, causing a page change for each
# digit in a multi-digit page number. We don't want that, so we rather
# initialize the value o... | App.CurrentPaginatorPageView = Em.TextField.extend
classNames: 'input-mini'
# If we use a two-way binding from the value to the currentPageNo of the
# controller, it will cause a page change for each key press, meaning a page
# change for each digit in a multi-digit page number. We don't want that, so
# we r... |
Fix visualization/show tables tab selection | VisualizationBase = require './visualization-base.js'
class Visualization extends VisualizationBase
constructor: (_id) ->
console.log 'Visualization'
super _id
resize: =>
# setup container height
h = if $('body').hasClass('fullscreen') then $(window).height() else $(window).height() - 178 # -50-6... | VisualizationBase = require './visualization-base.js'
class Visualization extends VisualizationBase
constructor: (_id) ->
console.log 'Visualization'
super _id
# activate table tabs selector
$('#visualization-table-selector a').click (e) ->
e.preventDefault()
$(this).tab 'show'
resize... |
Configure jEditable to not add "Click to edit" on blank cells. | $ ->
enableEditables()
enableEditables = ->
$('span.editable').editable (value, settings) ->
$span = $(this)
data = {_method: 'PUT'}
data[$span.data('attribute')] = value
# TODO: We should handle failures and timeouts in POSTing, and make our own "Saving..." indicator.
$.post($span.data('url'),... | $ ->
enableEditables()
enableEditables = ->
$('span.editable').editable (value, settings) ->
$span = $(this)
data = {_method: 'PUT'}
data[$span.data('attribute')] = value
# TODO: We should handle failures and timeouts in POSTing, and make our own "Saving..." indicator.
$.post($span.data('url'),... |
Fix reference to `@key` in log expression. | logger = require("logger-sharelatex")
NotificationsHandler = require("./NotificationsHandler")
module.exports =
# Note: notification keys should be url-safe
groupPlan: (user, licence)->
key : "join-sub-#{licence.subscription_id}"
create: (callback = ->)->
messageOpts =
groupName: licence.name
subscr... | logger = require("logger-sharelatex")
NotificationsHandler = require("./NotificationsHandler")
module.exports =
# Note: notification keys should be url-safe
groupPlan: (user, licence)->
key : "join-sub-#{licence.subscription_id}"
create: (callback = ->)->
messageOpts =
groupName: licence.name
subscr... |
Revert "Don't depend on modalOpened events but on factlinkAdded events for hiding the loading button" | getTextRange = ->
doc = window.document
if doc.getSelection
doc.getSelection()
else if doc.selection
doc.selection.createRange().text
else
''
FactlinkJailRoot.createFactFromSelection = ->
success = ->
FactlinkJailRoot.createButton.hide()
FactlinkJailRoot.off 'factlinkAdded', success
se... | getTextRange = ->
doc = window.document
if doc.getSelection
doc.getSelection()
else if doc.selection
doc.selection.createRange().text
else
''
FactlinkJailRoot.createFactFromSelection = ->
success = ->
FactlinkJailRoot.createButton.hide()
FactlinkJailRoot.off 'modalOpened', success
selI... |
Add some more fallback for the Highlights runner | #!highlights/node_modules/coffee-script/bin/coffee
Highlights = require 'highlights'
fs = require 'fs'
path = require 'path'
highlighter = new Highlights()
highlighter.requireGrammarsSync
modulePath: require.resolve('./atom-language-perl6/package.json')
stdin = process.openStdin()
stdin.setEncoding 'utf8'
mystderr ... | #!highlights/node_modules/coffee-script/bin/coffee
Highlights = require 'highlights'
fs = require 'fs'
path = require 'path'
highlighter = new Highlights()
highlighter.requireGrammarsSync
modulePath: require.resolve('./atom-language-perl6/package.json')
stdin = process.openStdin()
stdin.setEncoding 'utf8'
mystderr ... |
Fix channel suggestion in add-to-channel on channel page | #= require ./add_channel_to_channels_modal_view
class window.AddChannelToChannelsButtonView extends Backbone.Marionette.Layout
template: 'channels/add_channel_to_channels_button'
events:
"click .js-add-to-channel-button": "openAddToChannelModal"
initialize: ->
@collection = @model.getOwnContainingChann... | #= require ./add_channel_to_channels_modal_view
class window.AddChannelToChannelsButtonView extends Backbone.Marionette.Layout
template: 'channels/add_channel_to_channels_button'
events:
"click .js-add-to-channel-button": "openAddToChannelModal"
initialize: ->
@collection = @model.getOwnContainingChann... |
Add done() and set delay | {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers'
$ = require 'jquery'
describe 'API loader', ->
beforeEach ->
@jquery =
ajax: sinon.spy ->
d = $.Deferred()
_.defer -> d.resolve({})
d.promise()
delete require.cache[require.resolve('api')]
delet... | {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers'
$ = require 'jquery'
describe 'API loader', ->
beforeEach ->
@jquery =
ajax: sinon.spy ->
d = $.Deferred()
_.defer -> d.resolve({})
d.promise()
delete require.cache[require.resolve('api')]
delet... |
Allow template to be a function | define [
'jquery'
'underscore'
'backbone'
], ($, _, Backbone) ->
class Region
constructor: (el, parent) ->
@parent = parent
@el = el
show: (view) ->
@close()
@views = null
@append(view)
append: (view) ->
@$el = @$el or @parent.$el.find(@el)
view.parent = ... | define [
'jquery'
'underscore'
'backbone'
], ($, _, Backbone) ->
class Region
constructor: (el, parent) ->
@parent = parent
@el = el
show: (view) ->
@close()
@views = null
@append(view)
append: (view) ->
@$el = @$el or @parent.$el.find(@el)
view.parent = ... |
Add angular declaration so it works | #= jquery/jquery
| #= jquery/jquery
app = angular.module 'barebones', []
app.controller 'mainController', ($scope) ->
$scope.appName = 'BareBones'
|
Allow to clear datetime inputs | $(document).on 'ready page:change', ->
$('input[type=datetime]').prop('type','text').datetimepicker
useSeconds: false
sideBySide: false
$('input[type=date]').prop('type','text').datetimepicker
pickTime: false
$('input.datetime').on 'dp.change', (event)->
hidden = $(event.target).next 'input[type... | $(document).on 'ready page:change', ->
$('input[type=datetime]').prop('type','text').datetimepicker
useSeconds: false
sideBySide: false
$('input[type=date]').prop('type','text').datetimepicker
pickTime: false
handleChange = (format)->
(event)->
hidden = $(event.target).next 'input[type=hid... |
Add version test for minimap v3 | MinimapSelectionView = require './minimap-selection-view'
module.exports =
active: false
views: {}
activate: (state) ->
minimapPackage = atom.packages.getLoadedPackage('minimap')
return @deactivate() unless minimapPackage?
@minimap = require minimapPackage.path
@minimap.registerPlugin 'selecti... | MinimapSelectionView = require './minimap-selection-view'
module.exports =
active: false
views: {}
activate: (state) ->
minimapPackage = atom.packages.getLoadedPackage('minimap')
return @deactivate() unless minimapPackage?
@minimap = require minimapPackage.path
return @deactivate() unless @min... |
Add include untested option to istanbul | # Load all required libraries.
gulp = require 'gulp'
gutil = require 'gulp-util'
clean = require('gulp-clean')
coffee = require 'gulp-coffee'
coffeelint = require('gulp-coffeelint')
istanbul = require 'gulp-istanbul'
mocha = require 'gulp-mocha'
gulp.task 'clean', ->
gulp.src(['lib/**/*.js'], read: false).pipe(clea... | # Load all required libraries.
gulp = require 'gulp'
gutil = require 'gulp-util'
clean = require('gulp-clean')
coffee = require 'gulp-coffee'
coffeelint = require('gulp-coffeelint')
istanbul = require 'gulp-istanbul'
mocha = require 'gulp-mocha'
gulp.task 'clean', ->
gulp.src(['lib/**/*.js'], read: false).pipe(clea... |
Add fix for arrows in collapsables showing the wrong collapse status. | $document = $(document)
$document.on 'click.dropdown', '[data-toggle="collapse"]', (e)->
# Don't close dropdown when accordion togglers are clicked
e.stopPropagation()
$document.on 'click.dropdown', '[data-toggle="dropdown"]', (e)->
# Close all collapse elements, if dropdown was closed
$parent = $(this).paren... | $document = $(document)
$document.on 'click.dropdown', '[data-toggle="collapse"]', (e)->
# Don't close dropdown when accordion togglers are clicked
e.stopPropagation()
$document.on 'click.dropdown', '[data-toggle="dropdown"]', (e)->
# Close all collapse elements, if dropdown was closed
$parent = $(this).paren... |
Add defaults for single axis grids | Game = @Game
class Game.LocationGrid
constructor: (settings) ->
xs = @_coordList(settings.x)
ys = @_coordList(settings.y)
coords = []
for y in ys
for x in xs
coords.push { x, y }
@freeCoords = _.shuffle coords
_coordList: (listSettings) ->
for i in [0...listSettings.steps]
... | Game = @Game
class Game.LocationGrid
constructor: (settings) ->
settings = _.defaults(settings,
x:
start: 0
steps: 1
stepSize: 1
y:
start: 0
steps: 1
stepSize: 1
)
xs = @_coordList(settings.x)
ys = @_coordList(settings.y)
coords = []
... |
Replace all spaces with + | # Description
# A hubot script to query Board Game Geek
#
# Configuration:
# LIST_OF_ENV_VARS_TO_SET
#
# Commands:
# hubot hello - <what the respond trigger does>
# orly - <what the hear trigger does>
#
# Notes:
# <optional notes required for the script>
#
# Author:
# Bart Dorsey[@<org>]
options =
timeo... | # Description
# A hubot script to query Board Game Geek
#
# Configuration:
# LIST_OF_ENV_VARS_TO_SET
#
# Commands:
# hubot hello - <what the respond trigger does>
# orly - <what the hear trigger does>
#
# Notes:
# <optional notes required for the script>
#
# Author:
# Bart Dorsey[@<org>]
options =
timeo... |
Fix navigating to pages from the ToC | define (require) ->
$ = require('jquery')
router = require('cs!router')
analytics = require('cs!helpers/handlers/analytics')
BaseView = require('cs!helpers/backbone/views/base')
template = require('hbs!./node-template')
require('less!./node')
return class TocNodeView extends BaseView
template: templa... | define (require) ->
$ = require('jquery')
router = require('cs!router')
analytics = require('cs!helpers/handlers/analytics')
BaseView = require('cs!helpers/backbone/views/base')
template = require('hbs!./node-template')
require('less!./node')
return class TocNodeView extends BaseView
template: templa... |
Fix URL redirect when in sub-directory | # *************************************
#
# Application
# -> Manifest
#
# *************************************
# -------------------------------------
# Namespace
# -------------------------------------
#= require presenter
# -------------------------------------
# Routes
# ----------------------------------... | # *************************************
#
# Application
# -> Manifest
#
# *************************************
# -------------------------------------
# Namespace
# -------------------------------------
#= require presenter
# -------------------------------------
# Routes
# ----------------------------------... |
Fix DOM leak in scatterplot | # Created by AshGillman, 05/08/12
__ = require '../helpers'
ScatterChart = require('../NvWrapper').ScatterChart
DrawerBase = require '../DrawerBase'
ScatterDrawer = class ScatterDrawer extends DrawerBase
constructor: (@parent, sensor_metadata, @ts_params) ->
super(@parent, sensor_metadata, @ts_params... | # Created by AshGillman, 05/08/12
__ = require '../helpers'
ScatterChart = require('../NvWrapper').ScatterChart
DrawerBase = require '../DrawerBase'
ScatterDrawer = class ScatterDrawer extends DrawerBase
constructor: (@parent, sensor_metadata, @ts_params) ->
super(@parent, sensor_metadata, @ts_params... |
Use correct error message for course ended | React = require 'react'
NoExercises = React.createClass
displayName: 'NoExercises'
render: ->
<div className='no-exercises'>
Sorry, there are no exercises for this module.
</div>
CourseEnded = React.createClass
displayName: 'NoExercises'
render: ->
<div className='no-exercises'>
Sorry,... | React = require 'react'
NoExercises = React.createClass
displayName: 'NoExercises'
render: ->
<div className='no-exercises'>
Sorry, there are no exercises for this module.
</div>
CourseEnded = React.createClass
displayName: 'CourseEnded'
render: ->
<div className='course-ended'>
This C... |
Correct name of expireAfterSeconds index | mongoose = require 'mongoose'
Settings = require 'settings-sharelatex'
Schema = mongoose.Schema
ObjectId = Schema.ObjectId
THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30
ProjectInviteSchema = new Schema(
{
email: String
token: String
sendingUserId: ObjectId
projectId: ObjectId
privi... | mongoose = require 'mongoose'
Settings = require 'settings-sharelatex'
Schema = mongoose.Schema
ObjectId = Schema.ObjectId
THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30
ProjectInviteSchema = new Schema(
{
email: String
token: String
sendingUserId: ObjectId
projectId: ObjectId
privi... |
Fix one require on new test | TypeFactory = require '../../../../lib/type/factory'
should = require 'should'
describe 'TypeFactory#jsType', ->
factory = new TypeFactory
describe 'when used with a JS class', ->
subject = factory.jsType(Number)
subject.should.equal(Number)
describe 'when used with a JS class name', ->
subj... | TypeFactory = require '../../../../lib/support/factory'
should = require 'should'
describe 'TypeFactory#jsType', ->
factory = new TypeFactory
describe 'when used with a JS class', ->
subject = factory.jsType(Number)
subject.should.equal(Number)
describe 'when used with a JS class name', ->
s... |
Add index ddb record count. | class @PodsStore
records: []
all: ->
@records
update: (new_records) ->
@records = @records.concat(new_records)
@writeObjects(new_records)
writeObjects: (pods) ->
r = indexedDB.open('pods', 1)
r.onupgradeneeded = (e) ->
db = event.target.result
if !db.objectStoreNames.contains 'po... | class @PodsStore
records: []
all: ->
@records
update: (new_records) ->
@records = @records.concat(new_records)
@countAll (c) ->
console.log c
@writeObjects(new_records)
writeObjects: (pods) ->
@database (db) ->
t = db.transaction 'pods', 'readwrite'
s = t.objectStore('pods'... |
Fix check of actual node.js (and not a polyfill of process). |
# This module allows fetch to load local files from file://
# in node.js, electron and NW.js
if window.process?.execPath
req = eval 'require'
fs = req 'fs'
class Body
constructor: (err, @buffer) ->
@ok = not err
@status = ''
@statusText = err?.message
... |
# This module allows fetch to load local files from file://
# in node.js, electron and NW.js
if window.process?.execPath and process.execPath != '/'
req = eval 'require'
fs = req 'fs'
class Body
constructor: (err, @buffer) ->
@ok = not err
@status = ''
@status... |
Remove charset from even source. Spec says it is always utf-8. | # ***** BEGIN LICENSE BLOCK *****
# Copyright (c) 2011-2012 VMware, Inc.
#
# For the license see COPYING.
# ***** END LICENSE BLOCK *****
utils = require('./utils')
transport = require('./transport')
class EventSourceReceiver extends transport.ResponseReceiver
protocol: "eventsource"
doSendFrame: (payload) ... | # ***** BEGIN LICENSE BLOCK *****
# Copyright (c) 2011-2012 VMware, Inc.
#
# For the license see COPYING.
# ***** END LICENSE BLOCK *****
utils = require('./utils')
transport = require('./transport')
class EventSourceReceiver extends transport.ResponseReceiver
protocol: "eventsource"
doSendFrame: (payload) ... |
Remove Webpack devtool configuration (not allowed for Chrome extensions) | webpack = require 'webpack'
LANGS = ['en_gb']
module.exports =
resolve:
# Add automatically the following extensions to required modules
extensions: ['', '.coffee', '.cjsx', '.js']
plugins: [
new webpack.ContextReplacementPlugin /moment[\\\/]locale$/, new RegExp ".[\\\/](#{LANGS.join '|'})"
]
de... | webpack = require 'webpack'
LANGS = ['en_gb']
module.exports =
resolve:
# Add automatically the following extensions to required modules
extensions: ['', '.coffee', '.cjsx', '.js']
plugins: [
new webpack.ContextReplacementPlugin /moment[\\\/]locale$/, new RegExp ".[\\\/](#{LANGS.join '|'})"
]
##... |
Hide the action buttons instead of just disabling them | Spine = require('spine')
class Actions extends Spine.Controller
elements:
'.deal': 'deal_button'
'.continue': 'continue_button'
'.surrender': 'surrender_button'
'.bet': 'bet_buttons'
'.action': 'action_buttons'
events:
'click .deal': 'deal'
constructor: ->
super
Spine.bind 'res... | Spine = require('spine')
class Actions extends Spine.Controller
elements:
'.deal': 'deal_button'
'.continue': 'continue_button'
'.surrender': 'surrender_button'
'.bet': 'bet_buttons'
'.action': 'action_buttons'
events:
'click .deal': 'deal'
constructor: ->
super
Spine.bind 'res... |
Remove dependency on simplifies segments, which is no longer needed in Paper 0.99 | define [
'spine'
'models/moves_path'
'models/simplifies_segments'
'models/link_shape'
'spine.relation'
], (Spine, MovesPath, SimplifiesSegments, LinkShape) ->
class Link extends Spine.Model
@configure "Link", "sourceId", "targetId", "segments", "shape"
@belongsTo 'drawing', 'models/drawing'
... | define [
'spine'
'models/moves_path'
'models/link_shape'
'spine.relation'
], (Spine, MovesPath, LinkShape) ->
class Link extends Spine.Model
@configure "Link", "sourceId", "targetId", "segments", "shape"
@belongsTo 'drawing', 'models/drawing'
# TODO duplication with Node
constructor: (attr... |
Add unit tests for withStats filter | items = require("../build/liblol.js").items
describe "items", ->
describe "find", ->
it "should return all items when nothing is passed to it", ->
items.find().should.include item for item in items.list
it "should throw an error if the filter isn't a function", ->
try
items.find "blah"... | items = require("../build/liblol.js").items
describe "items", ->
describe "find", ->
it "should return all items when nothing is passed to it", ->
items.find().should.include item for item in items.list
it "should throw an error if the filter isn't a function", ->
try
items.find "blah"... |
Use new CSON format for menus | # See https://atom.io/docs/latest/creating-a-package#menus for more details
'context-menu':
'.overlayer':
'Enable decoration-example': 'decoration-example:toggle'
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'decoration-example'
'submenu': [
{ 'label': 'Toggle', 'command'... | # See https://atom.io/docs/latest/creating-a-package#menus for more details
'context-menu':
'atom-text-editor, .overlayer': [
{label: 'Enable decoration-example', command: 'decoration-example:toggle'}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'decoration-example'
'submenu': ... |
Add Grunt task alias build | module.exports = (grunt) ->
grunt.initConfig
clean:
package: ['lib']
coffee:
options:
bare: true
files:
expand: true
cwd: 'src'
src: ['**/*.coffee']
dest: 'lib'
ext: '.js'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.registerTask 'de... | module.exports = (grunt) ->
grunt.initConfig
clean:
package: ['lib']
coffee:
options:
bare: true
files:
expand: true
cwd: 'src'
src: ['**/*.coffee']
dest: 'lib'
ext: '.js'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.registerTask 'bu... |
Use just "deleteFactlink" event, as we also fire another event for closing the modal already | class window.ClientController
constructor: (@annotatedSiteEnvoy) ->
showFact: (fact_id) ->
@_renderDiscussion new Fact id: fact_id
showNewFact: (params={}) =>
fact = new Fact
displaystring: params.displaystring
url: params.url
fact_title: params.fact_title
if Factlink.Global.signed... | class window.ClientController
constructor: (@annotatedSiteEnvoy) ->
showFact: (fact_id) ->
@_renderDiscussion new Fact id: fact_id
showNewFact: (params={}) =>
fact = new Fact
displaystring: params.displaystring
url: params.url
fact_title: params.fact_title
if Factlink.Global.signed... |
Fix cmd + enter submit | angular.module('loomioApp').factory 'KeyEventService', ($rootScope) ->
new class KeyEventService
keyboardShortcuts:
73: 'pressedI'
71: 'pressedG'
84: 'pressedT'
27: 'pressedEsc'
13: 'pressedEnter'
191: 'pressedSlash'
38: 'pressedUpArrow'
40: 'pressedDownArro... | angular.module('loomioApp').factory 'KeyEventService', ($rootScope) ->
new class KeyEventService
keyboardShortcuts:
73: 'pressedI'
71: 'pressedG'
84: 'pressedT'
27: 'pressedEsc'
13: 'pressedEnter'
191: 'pressedSlash'
38: 'pressedUpArrow'
40: 'pressedDownArro... |
Configure icon for SetLayerProperty component. | noflo = require 'noflo'
require 'framerjs'
createLayer = (properties) ->
return new Layer properties
exports.getComponent = ->
component = new noflo.Component
component.description = 'Set layer properties.'
# component.icon = 'picture'
# Add input ports
component.inPorts.add 'in',
datatype: 'object'
... | noflo = require 'noflo'
require 'framerjs'
createLayer = (properties) ->
return new Layer properties
exports.getComponent = ->
component = new noflo.Component
component.description = 'Set layer properties.'
component.icon = 'cogs'
# Add input ports
component.inPorts.add 'in',
datatype: 'object'
d... |
Remove comment in branch test | window.Cosmo =
version: '0.1.0'
# more
# All apps should be an extended instance of this class
class Cosmo.Router
# app regions, assumes main content goes in a div#container
regions:
container: $('#container')
initialize: ->
# do initialization stuff and then start app routing
# TODO: Do some url man... | window.Cosmo =
version: '0.1.0'
# All apps should be an extended instance of this class
class Cosmo.Router
# app regions, assumes main content goes in a div#container
regions:
container: $('#container')
initialize: ->
# do initialization stuff and then start app routing
# TODO: Do some url management... |
Handle new addhoc Tasks to existing Phase | ETahi.ApplicationController = Ember.Controller.extend
currentUser:(->
userId = Tahi.currentUser?.id.toString()
@store.getById('user', userId)
).property().volatile()
connectToES:(->
return unless Tahi.currentUser?.id
store = @store
params =
url: '/event_stream'
method: 'GET'
... | ETahi.ApplicationController = Ember.Controller.extend
currentUser:(->
userId = Tahi.currentUser?.id.toString()
@store.getById('user', userId)
).property().volatile()
connectToES:(->
return unless Tahi.currentUser?.id
store = @store
params =
url: '/event_stream'
method: 'GET'
... |
Remove sprocket directive for extensions | #= require_tree ./vendors
#= require_tree ./written/core
#= require_tree ./written/extensions
#= require_tree ./written/parsers
| #= require_tree ./vendors
#= require_tree ./written/core
#= require_tree ./written/parsers
|
Add change item to editor context menu | 'menu': [
'label': 'Edit'
'submenu': [
'label': 'Select Encoding'
'command': 'encoding-selector:show'
]
]
| 'menu': [
'label': 'Edit'
'submenu': [
'label': 'Select Encoding'
'command': 'encoding-selector:show'
]
]
'context-menu':
'.overlayer': [
'label': 'Change Encoding'
'command': 'encoding-selector:show'
]
|
Set notification events in backbone event hash | Promise = require 'bluebird-q'
{ delay } = require 'underscore'
Backbone = require 'backbone'
template = -> require('./index.jade') arguments...
module.exports = class NotificationsView extends Backbone.View
events:
'click a': -> delay (=> @render()), 250
initialize: ({ @state }) ->
@listenTo @collection,... | Promise = require 'bluebird-q'
{ delay } = require 'underscore'
Backbone = require 'backbone'
template = -> require('./index.jade') arguments...
module.exports = class NotificationsView extends Backbone.View
events:
'click a': -> delay (=> @render()), 250
'mouseleave': 'markAsRead'
'click': 'markAsRead'
... |
Use a relative require path | StatsTracker = require './stats-tracker'
module.exports =
stats: null
editorStatsView: null
activate: ->
@stats = new StatsTracker()
rootView.command 'editor-stats:toggle', => @createView().toggle(@stats)
deactivate: ->
@editorStatsView = null
@stats = null
createView: ->
unless @edito... | StatsTracker = require './stats-tracker'
module.exports =
stats: null
editorStatsView: null
activate: ->
@stats = new StatsTracker()
rootView.command 'editor-stats:toggle', => @createView().toggle(@stats)
deactivate: ->
@editorStatsView = null
@stats = null
createView: ->
unless @edito... |
Add createdAt to admin_journal model | a = DS.attr
ETahi.AdminJournal = DS.Model.extend
logoUrl: a('string')
name: a('string')
paperTypes: a()
taskTypes: a()
manuscriptManagerTemplates: a('manuscriptManagerTemplate')
roles: DS.hasMany('role')
epubCoverUrl: a('string')
epubCoverFileName: a('string')
epubCss: a('string')
pdfCss: a('string'... | a = DS.attr
ETahi.AdminJournal = DS.Model.extend
logoUrl: a('string')
name: a('string')
paperTypes: a()
taskTypes: a()
manuscriptManagerTemplates: a('manuscriptManagerTemplate')
roles: DS.hasMany('role')
epubCoverUrl: a('string')
epubCoverFileName: a('string')
epubCss: a('string')
pdfCss: a('string'... |
Use underlayer property on editor | {View} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class WrapGuideView extends View
@activate: ->
rootView.eachEditor (editor) =>
@appendToEditorPane(rootView, editor) if editor.attached
@appendToEditorPane: (rootView, editor) ->
if underlayer = editor.find('... | {View} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class WrapGuideView extends View
@activate: ->
rootView.eachEditor (editor) =>
editor.underlayer.append(new WrapGuideView(editor)) if editor.attached
@content: ->
@div class: 'wrap-guide'
defaultColumn: 80... |
Fix the target progress bar | define [
'jquery'
'underscore'
'jade.templates'
'mixen'
'mixens/BaseViewMixen'
'mixens/ModelViewMixen'
'views/DonationFormView'
'vex'
], ($, _, jade, Mixen, BaseView, ModelView, DonationFormView, vex) ->
class IndexStats extends Mixen(ModelView, BaseView)
template: jade.indexStats
events:
... | define [
'jquery'
'underscore'
'jade.templates'
'mixen'
'mixens/BaseViewMixen'
'mixens/ModelViewMixen'
'views/DonationFormView'
'vex'
], ($, _, jade, Mixen, BaseView, ModelView, DonationFormView, vex) ->
class IndexStats extends Mixen(ModelView, BaseView)
template: jade.indexStats
events:
... |
Update feed list load check | VoteButton = require './VoteButton.coffee'
init = (el)->
$feeds = $(el)
$btnReload = $('#btn-reload-feeds')
$tipLoading = $('#feeds-loading-tip')
$tipLoaded = $('#feeds-loaded-tip')
pages = parseInt $feeds.data('pages')
loading = false
page = 1
load = ()->
loading = true
$.ajax
data:
... | VoteButton = require './VoteButton.coffee'
init = (el)->
$feeds = $(el)
$btnReload = $('#btn-reload-feeds')
$tipLoading = $('#feeds-loading-tip')
$tipLoaded = $('#feeds-loaded-tip')
pages = parseInt $feeds.data('pages')
loading = false
page = 1
load = ()->
loading = true
$.ajax
data:
... |
Replace linter-jshint with linter-eslint in Atom | packages: [
"autocomplete-emojis"
"editorconfig"
"file-icons"
"highlight-selected"
"linter"
"linter-coffeelint"
"linter-csslint"
"linter-flake8"
"linter-htmlhint"
"linter-js-yaml"
"linter-jshint"
"linter-jsonlint"
"linter-less"
"linter-php"
"linter-scss-lint"
"linter-shellcheck"
"linte... | packages: [
"autocomplete-emojis"
"editorconfig"
"file-icons"
"highlight-selected"
"linter"
"linter-coffeelint"
"linter-csslint"
"linter-eslint"
"linter-flake8"
"linter-htmlhint"
"linter-js-yaml"
"linter-jsonlint"
"linter-less"
"linter-php"
"linter-scss-lint"
"linter-shellcheck"
"linte... |
Rename VCS ignore config setting to fuzzyFinder.hideVcsIgnoredPaths | _ = require 'underscore'
BufferedProcess = require 'buffered-process'
module.exports =
class LoadPathsTask
constructor: (@callback) ->
start: ->
rootPath = project.getPath()
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? ... | _ = require 'underscore'
BufferedProcess = require 'buffered-process'
module.exports =
class LoadPathsTask
constructor: (@callback) ->
start: ->
rootPath = project.getPath()
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? ... |
Change spinner to stop if another is started for a new ajax request | $(document).ready ->
opts =
lines: 11
length: 2
width: 3
radius: 9
corners: 1
rotate: 0
color: '#fff'
speed: 0.8
trail: 48
shadow: false
hwaccel: true
className: 'spinner'
zIndex: 2e9
top: 'auto'
left: 'auto'
target = document.getElementById("spinner")
... | $(document).ready ->
opts =
lines: 11
length: 2
width: 3
radius: 9
corners: 1
rotate: 0
color: '#fff'
speed: 0.8
trail: 48
shadow: false
hwaccel: true
className: 'spinner'
zIndex: 2e9
top: 'auto'
left: 'auto'
target = document.getElementById("spinner")
... |
Add property `author` to sharedDataService | 'use strict'
###*
# @ngdoc service
# @name arashike-blog.githubshareddata
# @description
# # githubshareddata
# Service in the arashike-blog.
###
angular.module 'arashike-blog'
.service 'sharedDataService', ->
gists = []
return {
gists: gists
}
| 'use strict'
###*
# @ngdoc service
# @name arashike-blog.githubshareddata
# @description
# # githubshareddata
# Service in the arashike-blog.
###
angular.module 'arashike-blog'
.service 'sharedDataService', ->
author = {}
gists = []
return {
author: author
gists: gists
}
|
Implement a scrollbar width detector | FactlinkJailRoot.on 'modalOpened', ->
document.documentElement.setAttribute('data-factlink-suppress-scrolling', '')
FactlinkJailRoot.on 'modalClosed', -> document.documentElement.removeAttribute('data-factlink-suppress-scrolling')
| scrollbarWidth = 0
FactlinkJailRoot.loaded_promise.then ->
# Create the measurement nod; see http://davidwalsh.name/detect-scrollbar-width
scrollDiv = document.createElement("div");
$(scrollDiv).css(
width: "100px"
height: "100px"
overflow: "scroll"
position: "absolute"
top: "-9999px"
)
do... |
Add a new keymap `ctrl-backspace` | '.editor':
'ctrl-m': 'bracket-matcher:go-to-matching-bracket'
'ctrl-]': 'bracket-matcher:remove-brackets-from-selection'
'.platform-darwin .editor':
'ctrl-cmd-m': 'bracket-matcher:select-inside-brackets'
'alt-cmd-.': 'bracket-matcher:close-tag'
'.platform-linux .editor':
'alt-ctrl-.': 'bracket-matcher:close... | '.editor':
'ctrl-m': 'bracket-matcher:go-to-matching-bracket'
'ctrl-]': 'bracket-matcher:remove-brackets-from-selection'
'ctrl-backspace': 'bracket-matcher:remove-matching-brackets'
'.platform-darwin .editor':
'ctrl-cmd-m': 'bracket-matcher:select-inside-brackets'
'alt-cmd-.': 'bracket-matcher:close-tag'
'.... |
Update width/height in the snippet block if changed | jQuery.initializer '.edit_widget.map_search', ->
oz = new OZ('oz_map_search')
$form = $('form.widget_map_search')
oz.api 'on_params_changed', (params) ->
$('#widget_map_search_api_params').val(JSON.stringify(params))
$.post $form.attr('action'), $form.serialize(), (data) ->
$('textarea#snippet').val... | jQuery.initializer '.edit_widget.map_search', ->
oz = new OZ('oz_map_search')
$form = $('form.widget_map_search')
oz.api 'on_params_changed', (params) ->
$('#widget_map_search_api_params').val(JSON.stringify(params))
$.post $form.attr('action'), $form.serialize(), (data) ->
$('textarea#snippet').val... |
Add deserializers.add call for backwards compatibility | {Disposable, CompositeDisposable} = require 'atom'
ViewURI = 'atom://deprecation-cop'
DeprecationCopView = null
module.exports =
disposables: null
activate: ->
@disposables = new CompositeDisposable
@disposables.add atom.workspace.addOpener (uri) =>
@deserializeDeprecationCopView({uri}) if uri is ... | {Disposable, CompositeDisposable} = require 'atom'
ViewURI = 'atom://deprecation-cop'
DeprecationCopView = null
module.exports =
disposables: null
activate: ->
@disposables = new CompositeDisposable
@disposables.add atom.workspace.addOpener (uri) =>
@deserializeDeprecationCopView({uri}) if uri is ... |
Add config fallback for development | nconf = require("nconf")
nconf.env().argv()
# Add config file
nconf.file(file: nconf.get("config"))
Base = require('./src/base')
newsroom = new Base nconf.get("newsroom")
| nconf = require("nconf")
nconf.env().argv()
# Add config file
nconf.file(file: nconf.get("config") || "config.json")
Base = require('./src/base')
newsroom = new Base nconf.get("newsroom")
|
Use underscore instead of lodash | _ = require 'lodash'
expect = chai.expect
React = require 'react/addons'
ReactTestUtils = React.addons.TestUtils
{Promise} = require 'es6-promise'
{commonActions} = require './utilities'
sandbox = null
Wrapper = React.createClass
render: ->
React.createElement(@props._wrapped_component,
_.extend(_.om... | _ = require 'underscore'
expect = chai.expect
React = require 'react/addons'
ReactTestUtils = React.addons.TestUtils
{Promise} = require 'es6-promise'
{commonActions} = require './utilities'
sandbox = null
Wrapper = React.createClass
render: ->
React.createElement(@props._wrapped_component,
_.extend(... |
Remove periodic polling of document for labels | define [
], () ->
AUTOMATIC_REFRESH_PERIOD = 1000 * 60 * 10
class LabelsManager
constructor: (@ide, @$scope) ->
@$scope.$root._labels = this
@state =
documents: {} # map of DocId => List[Label]
@loadLabelsTimeout = null
@periodicLoadInterval = null
setTimeout(
() =>
# set up a regul... | define [
], () ->
class LabelsManager
constructor: (@ide, @$scope) ->
@$scope.$root._labels = this
@state =
documents: {} # map of DocId => List[Label]
@loadLabelsTimeout = null
setTimeout(
() =>
# listen for document open
@$scope.$on 'document:opened', (e, doc) =>
setTimeout(... |
Use document.body.scrollHeight, it's more correct | CI.Browser or= {}
CI.Browser.scroll_to = (position) =>
element = if jQuery.browser.webkit then "body" else "html"
offset = if position == "top" then 0 else document.body.offsetHeight
# Scrolling instantly is actually a smoother experience than
# incorporating a delay. When the animation takes some time to run ... | CI.Browser or= {}
CI.Browser.scroll_to = (position) =>
offset = if position == "top" then 0 else document.body.scrollHeight
# Scrolling instantly is actually a smoother experience than
# incorporating a delay. When the animation takes some time to run the
# page jumps unpleasantly when new content is added.
... |
Fix responsive styles (vendor stylesheet order was busted) | exports.config =
paths:
public: '../SingularityService/src/main/resources/static'
files:
javascripts:
defaultExtension: 'coffee'
joinTo:
'static/js/app.js': /^app/
'static/js/vendor.js': /^vendor/
order:
be... | exports.config =
paths:
public: '../SingularityService/src/main/resources/static'
files:
javascripts:
defaultExtension: 'coffee'
joinTo:
'static/js/app.js': /^app/
'static/js/vendor.js': /^vendor/
order:
be... |
Use port 80 by default | colors = require('colors')
url = require('url')
http = require('http')
Proxy = require('http-proxy')
start = (config) ->
match = (url, route) ->
new RegExp(route).test(url)
debug = (args...) ->
if config.debug
console.log args...
getTarget = (req) ->
debug "Proxying request to #{ req.url }"
... | colors = require('colors')
url = require('url')
http = require('http')
Proxy = require('http-proxy')
start = (config) ->
match = (url, route) ->
new RegExp(route).test(url)
debug = (args...) ->
if config.debug
console.log args...
getTarget = (req) ->
debug "Proxying request to #{ req.url }"
... |
Watch all coffee files for running test | path = require('path')
gulp = require('gulp')
mocha = require('gulp-mocha')
coffeelint = require('gulp-coffeelint')
mochaNotifierReporter = require('mocha-notifier-reporter')
OPTIONS =
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
tests: 'li... | path = require('path')
gulp = require('gulp')
mocha = require('gulp-mocha')
coffeelint = require('gulp-coffeelint')
mochaNotifierReporter = require('mocha-notifier-reporter')
OPTIONS =
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
tests: 'li... |
Update cartodb layer for july | class @ProtectedAreaMap
constructor: ($container) ->
@map = L.map($container.attr('id'), {zoomControl: false, scrollWheelZoom: false})
L.tileLayer('http://api.tiles.mapbox.com/v3/unepwcmc.ijh17499/{z}/{x}/{y}.png').addTo(@map)
L.tileLayer('http://carbon-tool.cartodb.com/tiles/wdpa_poly_feb2014_0/{z}/{x}/... | class @ProtectedAreaMap
constructor: ($container) ->
@map = L.map($container.attr('id'), {zoomControl: false, scrollWheelZoom: false})
L.tileLayer('http://api.tiles.mapbox.com/v3/unepwcmc.ijh17499/{z}/{x}/{y}.png').addTo(@map)
L.tileLayer('http://carbon-tool.cartodb.com/tiles/wdpapoly_july2014_0/{z}/{x}/... |
Remove CSON reference from coffee file | fs = require 'fs'
path = require 'path'
CSON = require 'cson'
postcss = require 'postcss'
namespace = postcss.plugin 'postcss-namespace', (opts) ->
if not opts?
opts = {token: '-'}
(css) ->
ref = null
css.walkRules (rule) ->
if /^&/.test rule.selector
... | fs = require 'fs'
path = require 'path'
postcss = require 'postcss'
namespace = postcss.plugin 'postcss-namespace', (opts) ->
if not opts?
opts = {token: '-'}
(css) ->
ref = null
css.walkRules (rule) ->
if /^&/.test rule.selector
rule.selector = rule.selector.r... |
Use interval instead of recreating timers in live | uploadcare.whenReady ->
{
jQuery: $
} = uploadcare
dataAttr = 'uploadcareWidget'
uploadcare.initialize = (targets) ->
for target in $(targets || '@uploadcare-uploader')
el = $(target)
initializeWidget(el)
return
initializeWidget = (el) ->
widget = el.data(dataAttr)
if !widge... | uploadcare.whenReady ->
{
jQuery: $
} = uploadcare
dataAttr = 'uploadcareWidget'
uploadcare.initialize = (targets) ->
for target in $(targets || '@uploadcare-uploader')
el = $(target)
initializeWidget(el)
return
initializeWidget = (el) ->
widget = el.data(dataAttr)
if !widge... |
Fix permissions toggle for limited posts | Marbles.Views.PermissionsFieldsToggle = class PermissionsFieldsToggleView extends TentStatus.View
@template_name: 'permissions_fields_toggle'
@view_name: 'permissions_fields_toggle'
constructor: ->
super
@once 'ready', =>
setImmediate @bindEvents
@render()
context: (permissions = { public:... | Marbles.Views.PermissionsFieldsToggle = class PermissionsFieldsToggleView extends TentStatus.View
@template_name: 'permissions_fields_toggle'
@view_name: 'permissions_fields_toggle'
constructor: ->
super
@once 'ready', =>
setImmediate @bindEvents
@render()
context: (permissions = @parentVi... |
Fix error due to mediatype being undefined | cozydb = require 'cozydb'
module.exports = Contact = cozydb.getModel 'Contact',
fn : String
n : String
datapoints : [Object]
revision : String
note : String
tags : [String]
accounts : String
title : String
org :... | cozydb = require 'cozydb'
module.exports = Contact = cozydb.getModel 'Contact',
fn : String
n : String
datapoints : [Object]
revision : String
note : String
tags : [String]
accounts : String
title : String
org :... |
Use heroku app as backend | Player = require './Player'
TextInput = require './TextInput'
class Game
constructor: (game) ->
@textBox = new TextInput(game)
@player = new Player(game)
window.Game = @
@socket = io.connect('http://localhost:8080', {secure: true})
@socket.emit 'new player', 'name'
@socket.on 'snap', (... | Player = require './Player'
TextInput = require './TextInput'
class Game
constructor: (game) ->
@textBox = new TextInput(game)
@player = new Player(game)
window.Game = @
@socket = io.connect('https://snapgame.herokuapp.com', {secure: true})
@socket.emit 'new player', 'name'
@socket.on ... |
Fix broken project paths from old macOS installation | [
{
title: "@Atom Theme"
paths: [
"/Users/johngardner/Labs/Atom-PhoenixTheme"
]
devMode: true
}
{
title: ".files"
paths: [
"/Users/johngardner/.files"
]
devMode: true
}
{
title: "language-roff"
paths: [
"/Users/johngardner/Labs/language-roff"
]
devMode: true
}
{
title: "file-ic... | [
{
title: ".atom"
paths: [
"~/.atom"
]
devMode: true
}
{
title: ".files"
paths: [
"~/.files"
]
devMode: true
}
{
title: "language-roff"
paths: [
"~/Labs/language-roff"
]
devMode: true
}
{
title: "file-icons"
paths: [
"~/Labs/file-icons"
]
devMode: true
}
{
title: ... |
Allow selecting "Discussions" as a feed | window.ReactFeedSelection = React.createClass
displayName: 'ReactFeedSelection'
mixins: [UpdateOnSignInOrOutMixin]
getInitialState: ->
feedChoice: 'global'
feeds:
global: new GlobalFeedActivities
personal: new PersonalFeedActivities
_handleFeedChoiceChange: (e) ->
if(e.target.checked)... | window.ReactFeedSelection = React.createClass
displayName: 'ReactFeedSelection'
mixins: [UpdateOnSignInOrOutMixin]
getInitialState: ->
feedChoice: 'global'
feeds:
global: new GlobalFeedActivities
personal: new PersonalFeedActivities
discussions: new DiscussionsFeedActivities
_handle... |
Set window object to variable | React = require 'react'
ReactDOM = {render} = require 'react-dom'
{Router, Route, Link} = require 'react-router'
{useBasename} = require 'history'
createBrowserHistory = require 'history/lib/createBrowserHistory'
routes = require './router'
# IE, oh my god:
location.origin ?= location.protocol + "//" + location.hostna... | React = require 'react'
ReactDOM = {render} = require 'react-dom'
{Router, Route, Link} = require 'react-router'
{useBasename} = require 'history'
createBrowserHistory = require 'history/lib/createBrowserHistory'
routes = require './router'
apiClient = require 'panoptes-client/lib/api-client'
# IE, oh my god:
location... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.