Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Load atom://assets/ urls from ~/.atom/assets | app = require 'app'
fs = require 'fs'
path = require 'path'
protocol = require 'protocol'
# Handles requests with 'atom' protocol.
#
# It's created by {AtomApplication} upon instantiation, and is used to create a
# custom resource loader by adding the 'atom' custom protocol.
module.exports =
class AtomProtocolHandler
... | app = require 'app'
fs = require 'fs'
path = require 'path'
protocol = require 'protocol'
# Handles requests with 'atom' protocol.
#
# It's created by {AtomApplication} upon instantiation and is used to create a
# custom resource loader for 'atom://' URLs.
#
# The following directories are searched in order:
# * ~/.... |
Disable logging to Sentry in development | Client = require('raven').Client
Client.prototype.captureDocumentError = (req, err) ->
@captureMessage "#{req.type}: #{err.details[0].message}",
level: 'warning'
extra: req: req, err: err
module.exports = new Client process.env.SENTRY_DNS
module.exports.patchGlobal (id, err) ->
console.error 'Uncaught Ex... | Client = require('raven').Client
Client.prototype.captureDocumentError = (req, err) ->
@captureMessage "#{req.type}: #{err.details[0].message}",
level: 'warning'
extra: req: req, err: err
module.exports = new Client process.env.SENTRY_DNS
if process.env.NODE_ENV isnt 'development'
module.exports.patchGlo... |
Use ATOM_HOME env var in protocol handler | app = require 'app'
fs = require 'fs'
path = require 'path'
protocol = require 'protocol'
# Handles requests with 'atom' protocol.
#
# It's created by {AtomApplication} upon instantiation and is used to create a
# custom resource loader for 'atom://' URLs.
#
# The following directories are searched in order:
# * ~/.... | app = require 'app'
fs = require 'fs'
path = require 'path'
protocol = require 'protocol'
# Handles requests with 'atom' protocol.
#
# It's created by {AtomApplication} upon instantiation and is used to create a
# custom resource loader for 'atom://' URLs.
#
# The following directories are searched in order:
# * ~/.... |
Use getPrediction() instead of predict() during inspection | H2O.PredictOutput = (_, prediction) ->
{ frame, model } = prediction
_predictionTable = _.inspect 'prediction', prediction
inspect = ->
#XXX get this from prediction table
_.insertAndExecuteCell 'cs', "inspect predict #{stringify model.key}, #{stringify frame.key.name}"
predictionTable: _predictionTa... | H2O.PredictOutput = (_, prediction) ->
{ frame, model } = prediction
_predictionTable = _.inspect 'prediction', prediction
inspect = ->
#XXX get this from prediction table
_.insertAndExecuteCell 'cs', "inspect getPrediction #{stringify model.key}, #{stringify frame.key.name}"
predictionTable: _predic... |
Set Solarized Dark as editor theme and One Dark as UI theme | "*":
Zen:
softWrap: false
width: 160
core:
disabledPackages: [
"notebook"
"language-gfm"
"wrap-guide"
]
telemetryConsent: "limited"
themes: [
"atom-dark-ui"
"atom-dark-syntax"
]
"default-language":
defaultLanguage: "Pandoc markdown"
editor:
fontS... | "*":
Zen:
softWrap: false
width: 160
core:
disabledPackages: [
"notebook"
"language-gfm"
"wrap-guide"
]
telemetryConsent: "limited"
themes: [
"one-dark-ui"
"solarized-dark-syntax"
]
"default-language":
defaultLanguage: "Pandoc markdown"
editor:
f... |
Add findOrCreate and a method for course updates | _ = require 'underscore'
React = require 'react'
EventEmitter2 = require 'eventemitter2'
Course = require '../course/model'
api = require '../api'
BLANK_USER =
is_admin: false
is_content_analyst: false
is_customer_service: false
name: null
profile_url: null
User =
channel: new EventEmitter2 wildcard: tru... | _ = require 'underscore'
React = require 'react'
EventEmitter2 = require 'eventemitter2'
Course = require '../course/model'
api = require '../api'
BLANK_USER =
is_admin: false
is_content_analyst: false
is_customer_service: false
name: null
profile_url: null
courses: []
User =
channel: new EventEmitter2... |
Disable vm patching by default. | fs = require 'fs'
path = require 'path'
vm = require './vm'
walk = require './walk'
{debounce, parseArgs} = require './utils'
module.exports = parseArgs (basePath, opts, cb) ->
{relative, excluded} = opts
opts.patch ?= true
opts.recurse ?= true
opts.watchSymlink ?= false
modules ... | fs = require 'fs'
path = require 'path'
vm = require './vm'
walk = require './walk'
{debounce, parseArgs} = require './utils'
module.exports = parseArgs (basePath, opts, cb) ->
{relative, excluded} = opts
opts.patch ?= false
opts.recurse ?= true
opts.watchSymlink ?= false
modules ... |
Use function pointer for plagiarism view report | angular.module('doubtfire.projects.states.dashboard.directives.task-dashboard.directives.task-plagiarism-card', [])
#
# plagiarism of task information
#
.directive('taskPlagiarismCard', ->
restrict: 'E'
templateUrl: 'projects/states/dashboard/directives/task-dashboard/directives/task-plagiarism-card/task-plagiarism... | angular.module('doubtfire.projects.states.dashboard.directives.task-dashboard.directives.task-plagiarism-card', [])
#
# plagiarism of task information
#
.directive('taskPlagiarismCard', ->
restrict: 'E'
templateUrl: 'projects/states/dashboard/directives/task-dashboard/directives/task-plagiarism-card/task-plagiarism... |
Allow overlay to be opened multiple times | class @Overlay
constructor: (selector, options) ->
@selector = selector
@options = options
self = this
@overlay = $("<div class='overlay'></div>")
$(@selector).click (event) ->
event.preventDefault()
self.open(this)
$(document).on 'keyup', (event) ->
return unless event.whi... | class @Overlay
constructor: (selector, options) ->
@selector = selector
@options = options
self = this
@overlay = $("<div class='overlay'></div>")
$('body').append(@overlay)
$(@selector).click (event) ->
event.preventDefault()
self.open(this)
$(document).on 'keyup', (event) -... |
Update machine label on UI when machine domain updated. | class NavigationMachineItem extends JView
{Running, Stopped} = Machine.State
stateClasses = ''
stateClasses += "#{state.toLowerCase()} " for state in Object.keys Machine.State
constructor:(options = {}, data)->
machine = data
@alias = machine.getName()
path ... | class NavigationMachineItem extends JView
{Running, Stopped} = Machine.State
stateClasses = ''
stateClasses += "#{state.toLowerCase()} " for state in Object.keys Machine.State
constructor:(options = {}, data)->
machine = data
@alias = machine.getName()
path ... |
Hide browser extension button on feed when kennisland | 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
_handleFeedChoiceChange: (e) ->
if(e.target.checked)... |
Make archive group work again | angular.module('loomioApp').factory 'GroupRecordsInterface', (BaseRecordsInterface, GroupModel) ->
class GroupRecordsInterface extends BaseRecordsInterface
model: GroupModel
fetchByParent: (parentGroup) ->
@fetch
path: "#{parentGroup.id}/subgroups"
cacheKey: "subgroupsFor#{parentGroup.k... | angular.module('loomioApp').factory 'GroupRecordsInterface', (BaseRecordsInterface, GroupModel) ->
class GroupRecordsInterface extends BaseRecordsInterface
model: GroupModel
fetchByParent: (parentGroup) ->
@fetch
path: "#{parentGroup.id}/subgroups"
cacheKey: "subgroupsFor#{parentGroup.k... |
Remove :large suffix to usefully expand on limechat | # Description:
# 今日も一日頑張るぞい!
#
# Commands:
# hubot zoi - 今日も一日頑張る
#
# Author:
# Uchio KONDO
request = require 'request'
uri = 'http://zoi.herokuapp.com/js/services.js'
getZois = (cb) ->
request(uri, (err, response, body) ->
if err
cb.onError(err)
else
zois = body.match(/image: 'https:... | # Description:
# 今日も一日頑張るぞい!
#
# Commands:
# hubot zoi - 今日も一日頑張る
#
# Author:
# Uchio KONDO
request = require 'request'
uri = 'http://zoi.herokuapp.com/js/services.js'
getZois = (cb) ->
request(uri, (err, response, body) ->
if err
cb.onError(err)
else
zois = body.match(/image: 'https:... |
Append HTML instead of Text | # Source: https://github.com/lukehoban/atom-ide-flow/blob/master/lib/tooltip-view.coffee
{$, View} = require 'atom'
module.exports = (Main)->
class TooltipView extends View
@content: ->
@div class: 'ide-hack-tooltip'
initialize: (@rect, text = null) ->
@text(text) if text?
$(document.body)... | # Source: https://github.com/lukehoban/atom-ide-flow/blob/master/lib/tooltip-view.coffee
{$, View} = require 'atom'
module.exports = (Main)->
class TooltipView extends View
@content: ->
@div class: 'ide-hack-tooltip'
initialize: (@rect, @LeMessage) ->
@append LeMessage
$(document.body).app... |
Fix default_callback wrong method names | # Default callbacks for internal storage of received packets
class CableNotifications.Store.DefaultCallbacks
constructor: (@collections) ->
# Callbacks
##################################################
collection_remove: (packet, collection) ->
console.warn 'Method not implemented: collection_remove '
... | # Default callbacks for internal storage of received packets
class CableNotifications.Store.DefaultCallbacks
constructor: (@collections) ->
# Callbacks
##################################################
collection_remove: (packet, collection) ->
console.warn 'Method not implemented: collection_remove '
... |
Remove unused methods from Fold | Range = require 'range'
Point = require 'point'
module.exports =
class Fold
@idCounter: 1
renderer: null
startRow: null
endRow: null
constructor: (@renderer, @startRow, @endRow) ->
@id = @constructor.idCounter++
destroy: ->
@renderer.destroyFold(this)
getRange: ->
throw "Don't worry about... | Range = require 'range'
Point = require 'point'
module.exports =
class Fold
@idCounter: 1
renderer: null
startRow: null
endRow: null
constructor: (@renderer, @startRow, @endRow) ->
@id = @constructor.idCounter++
destroy: ->
@renderer.destroyFold(this)
getBufferDelta: ->
new Point(@endRow ... |
Add isPastDue method and export methods | moment = require 'moment'
twix = require 'twix'
_ = require 'underscore'
durations =
create: (startTime, endTime) ->
moment(startTime).twix(endTime)
| moment = require 'moment'
twix = require 'twix'
_ = require 'underscore'
{TimeStore} = require '../flux/time'
module.exports =
create: (startTime, endTime) ->
moment(startTime).twix(endTime)
isPastDue: ({due_at}) ->
moment(TimeStore.getNow()).isAfter(due_at)
|
Set browser to true on Game class when in browser | requirejs.config({
paths: {
fabric: [
'lib/fabric']
}
})
define ['game', 'synchronizedtime', 'position', 'lib/fabric'], (Game, SynchronizedTime, Position) -> # Fabric is deliberately not set as an argument
console.log "Fabric: ", fabric
console.log "Position: ", new Position([1,2], 0, 5)
canvas = n... | requirejs.config({
paths: {
fabric: [
'lib/fabric']
}
})
define ['game', 'synchronizedtime', 'position', 'lib/fabric'], (Game, SynchronizedTime, Position) -> # Fabric is deliberately not set as an argument
console.log "Fabric: ", fabric
console.log "Position: ", new Position([1,2], 0, 5)
canvas = n... |
Support get parameters for fragment routing |
loadFragment = (locale, university, controller, param, modal) ->
controller ?= ""
param ?= ""
url = "/#{locale}/#{university}"
if controller
url += "/#{controller}"
if param
url += "/#{param}"
url += ".fragment"
contentWrap = $('#page-content')
cached.getDOM url, (error, dom) ->
... |
loadFragment = (locale, university, controller, param, modal) ->
controller ?= ""
param ?= ""
getParams = null
url = "/#{locale}/#{university}"
if controller
url += "/#{controller}"
if param
rest = param.split('?')
getParams = rest[1]
url += "/#{rest[0]}"
url += ".fragment"... |
Make sure selection elements have 0 line height to not offset line height. | {makeElement, defer} = Trix
prototypes =
cursorTarget:
makeElement
tagName: "span"
textContent: Trix.ZERO_WIDTH_SPACE
data:
trixSelection: true
trixCursorTarget: true
trixSerialize: false
Trix.extend
selectionElements:
selector: "[data-trix-selection]"
cssTex... | {makeElement, defer} = Trix
prototypes =
cursorTarget:
makeElement
tagName: "span"
textContent: Trix.ZERO_WIDTH_SPACE
data:
trixSelection: true
trixCursorTarget: true
trixSerialize: false
Trix.extend
selectionElements:
selector: "[data-trix-selection]"
cssTex... |
Use dev.zooniverse.org for local development | define (require, exports, module) ->
# This object stores generic information about the app
# that might need to be available globally.
config = {}
# `set` is a shortcut for setting a bunch of properties by passing in an object.
# Order isn't guaranteed. Call it multiple times if order is important.
config... | define (require, exports, module) ->
# This object stores generic information about the app
# that might need to be available globally.
config = {}
# `set` is a shortcut for setting a bunch of properties by passing in an object.
# Order isn't guaranteed. Call it multiple times if order is important.
config... |
Add extra line at end of file | # An animation sequence is an array of frames where each frame includes:
# * A pattern
# * A duration (ms)
class AnimationSequence
# Initializes an animation sequence with a pattern and a duration for that pattern
# @param pattern A single pattern or array of patterns
# @param duration A single duration or array... | # An animation sequence is an array of frames where each frame includes:
# * A pattern
# * A duration (ms)
class AnimationSequence
# Initializes an animation sequence with a pattern and a duration for that pattern
# @param pattern A single pattern or array of patterns
# @param duration A single duration or array... |
Set default data property in schema validation when formatting | JSV = require("JSV").JSV
class SchemaValidator
constructor: (@schema_manager) ->
@jsv = JSV.createEnvironment("json-schema-draft-03")
for schema in @schema_manager.schemas
@jsv.createSchema(schema, false, schema.id)
validate: (identifier, data) ->
schema = @schema_manager.find(identifier)
i... | JSV = require("JSV").JSV
class SchemaValidator
constructor: (@schema_manager) ->
@jsv = JSV.createEnvironment("json-schema-draft-03")
for schema in @schema_manager.schemas
@jsv.createSchema(schema, false, schema.id)
validate: (identifier, data) ->
schema = @schema_manager.find(identifier)
i... |
Add keymap for new selection expansion | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://ato... | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://ato... |
Fix errors appearing after long requests | define [
"chaplin"
"lib/utils"
], (Chaplin, utils) ->
"use strict"
class Model extends Chaplin.Model
urlRoot: utils.bnwUrl "/api"
apiCall: (url = @url(), data = undefined) ->
reqData = if data? then data else @query
$.ajax
url: url
type: if data? then "POST" else "GET"
... | define [
"jquery"
"chaplin"
"lib/utils"
], ($, Chaplin, utils) ->
"use strict"
class Model extends Chaplin.Model
urlRoot: utils.bnwUrl "/api"
apiCall: (url = @url(), data = undefined) ->
deferred = $.Deferred()
promise = deferred.promise()
reqData = if data? then data else @query
... |
Improve how params and routes are looked up | express = require 'express'
stylus = require 'stylus'
assets = require 'connect-assets'
app = express.createServer()
app.use assets()
app.set 'view engine', 'jade'
app.get '/', (req, resp) -> resp.render 'index'
app.get '/:filename', (req, resp) ->
content = req.query['content']
if (content and content.length > ... | express = require 'express'
stylus = require 'stylus'
assets = require 'connect-assets'
app = express.createServer()
app.use assets()
app.set 'view engine', 'jade'
app.get '/', (req, resp) -> resp.render 'index'
app.get '/:filename.:extension', (req, resp) ->
content = req.param['content']
if (content and conten... |
Remove deprecated User.create{} method call | angular.module('gi.security').controller 'usersController'
, ['$scope', '$location', 'User', 'Auth'
, ($scope, $location, User, Auth) ->
$scope.newUser = User.create()
$scope.currentView = 'list'
$scope.getData = () ->
User.query (results) ->
$scope.users = results
$scope.selectedUser = $scope.u... | angular.module('gi.security').controller 'usersController'
, ['$scope', '$location', 'User', 'Auth'
, ($scope, $location, User, Auth) ->
$scope.newUser = {}
$scope.currentView = 'list'
$scope.getData = () ->
User.query (results) ->
$scope.users = results
$scope.selectedUser = $scope.users[0]
... |
Send back the original time entry | crypto = require 'crypto'
_ = require 'underscore'
Singleton = require 'singleton'
Riak = require "#{__dirname}/../db/riak"
TimeEntry = require "#{__dirname}/../models/time_entry"
class TimeEntriesController extends Singleton
bucket: 'time_entries'
idGen: ()->
sha = crypto.createHash 'sha1'
_.each argumen... | crypto = require 'crypto'
_ = require 'underscore'
Singleton = require 'singleton'
Riak = require "#{__dirname}/../db/riak"
TimeEntry = require "#{__dirname}/../models/time_entry"
class TimeEntriesController extends Singleton
bucket: 'time_entries'
idGen: ()->
sha = crypto.createHash 'sha1'
_.each argumen... |
Remove flamsteed from secure pages | require ['jquery', 'lib/core/base', 'flamsteed', 'lib/utils/scroll_perf', 'polyfills/function_bind', 'trackjs'], ($, Base, _FS, ScrollPerf) ->
$ ->
base = new Base()
new ScrollPerf
window.lp.fs = new _FS({events: window.lp.fs.buffer, u: $.cookies.get('lpUid')})
require ['sailthru'], ->
Sailthru.... | require ['jquery', 'lib/core/base', 'flamsteed', 'lib/utils/scroll_perf', 'polyfills/function_bind', 'trackjs'], ($, Base, _FS, ScrollPerf) ->
$ ->
base = new Base()
new ScrollPerf
# Currently we can't serve Flamsteed over https because of f.staticlp.com
# New community is using this file rather than... |
Add reset company image behavior for Startups.coffee | $ ->
$body = $('body')
bodyClass = $body.attr 'class'
routes = ['startups-new', 'startups-edit']
if bodyClass in ['startups-new', 'startups-edit']
$markets = $("#startup_market_list")
$('.upload-photo').click (event) ->
event.preventDefault()
$('#startup_image').cli... | $ ->
$body = $('body')
bodyClass = $body.attr 'class'
routes = ['startups-new', 'startups-edit']
if bodyClass in ['startups-new', 'startups-edit']
$markets = $("#startup_market_list")
$('.upload-photo').click (event) ->
event.preventDefault()
$('#startup_image').cli... |
Include templates in column.coffee deps. | define [
'../../core'
'tpl!templates/views/columns.html'
'plugins/jquery-ui'
], (c, templates...) ->
| define [
'../../core'
'tpl!templates/views/columns-avail.html'
'tpl!templates/views/columns-select.html'
'tpl!templates/views/columns-selected.html'
'plugins/jquery-ui'
], (c, templates...) ->
|
Add on click event only once to each toggle element. | root = exports ? this
class DateChooser
constructor: (chooser) ->
@chooser = chooser
selectors = chooser.find(".date-chooser-select") # Today/Tomorrow selection
initialDate = selectors.data("initial-date")
@dateDisplay = chooser.find(".date-chooser-display")
@values = chooser.find(".date-chooser... | root = exports ? this
class DateChooser
constructor: (chooser) ->
@chooser = chooser
selectors = chooser.find(".date-chooser-select") # Today/Tomorrow selection
initialDate = selectors.data("initial-date")
@dateDisplay = chooser.find(".date-chooser-display")
@values = chooser.find(".date-chooser... |
Add spec for visibility being toggled on tab double click | describe 'Linter Behavior', ->
linter = null
linterState = null
bottomContainer = null
trigger = (el, name) ->
event = document.createEvent('HTMLEvents');
event.initEvent(name, true, false);
el.dispatchEvent(event);
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage('linter... | describe 'Linter Behavior', ->
linter = null
linterState = null
bottomContainer = null
trigger = (el, name) ->
event = document.createEvent('HTMLEvents');
event.initEvent(name, true, false);
el.dispatchEvent(event);
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage('linter... |
Add version test for minimap v3 | {CompositeDisposable} = require 'event-kit'
class MinimapHighlightSelected
constructor: ->
@subscriptions = new CompositeDisposable
activate: (state) ->
@highlightSelectedPackage = atom.packages.getLoadedPackage('highlight-selected')
@minimapPackage = atom.packages.getLoadedPackage('minimap')
ret... | {CompositeDisposable} = require 'event-kit'
class MinimapHighlightSelected
constructor: ->
@subscriptions = new CompositeDisposable
activate: (state) ->
@highlightSelectedPackage = atom.packages.getLoadedPackage('highlight-selected')
@minimapPackage = atom.packages.getLoadedPackage('minimap')
ret... |
Add loading view when joining session | require 'atom'
require 'window'
{createPeer, connectDocument} = require './session-utils'
{createSite, Document} = require 'telepath'
window.setDimensions(x: 0, y: 0, width: 800, height: 800)
atom.show()
peer = createPeer()
{sessionId} = atom.getLoadSettings()
connection = peer.connect(sessionId, reliable: true)
conn... | require 'atom'
require 'window'
$ = require 'jquery'
{$$} = require 'space-pen'
{createPeer, connectDocument} = require './session-utils'
{createSite, Document} = require 'telepath'
window.setDimensions(width: 350, height: 100)
window.setUpEnvironment('editor')
{sessionId} = atom.getLoadSettings()
loadingView = $$ ->... |
Add methods to serialize and parameterize query strings | define (require) ->
_ = require('underscore')
settings = require('settings')
shortcodes = settings.shortcodes
inverseShortcodes = _.invert(shortcodes)
return new class LinksHelper
getPath: (page, data) ->
url = settings.root
switch page
when 'contents'
uuid = data.model.ge... | define (require) ->
_ = require('underscore')
settings = require('settings')
shortcodes = settings.shortcodes
inverseShortcodes = _.invert(shortcodes)
return new class LinksHelper
getPath: (page, data) ->
url = settings.root
switch page
when 'contents'
uuid = data.model.ge... |
Make event positions relative to node offset | utils = window.Curve
module.exports =
class PointerTool
constructor: (svg, {@selectionModel, @selectionView}={}) ->
@_evrect = svg.node.createSVGRect();
@_evrect.width = @_evrect.height = 1;
activate: ->
svg.on 'click', @onClick
svg.on 'mousemove', @onMouseMove
deactivate: ->
svg.off 'click... | $ = require 'jquery'
utils = window.Curve
module.exports =
class PointerTool
constructor: (svg, {@selectionModel, @selectionView}={}) ->
@_evrect = svg.node.createSVGRect();
@_evrect.width = @_evrect.height = 1;
activate: ->
svg.on 'click', @onClick
svg.on 'mousemove', @onMouseMove
deactivate:... |
Add compile-css to grunt compile task. | module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
shell:
'compile-client-side':
options: stdout: true
command: 'coffee -o ./ -c src/'
'compile-server-side':
options: stdout: true
command: 'coffee -o public/scripts/compiled -c public/scripts/src... | module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
shell:
'compile-client-side':
options: stdout: true
command: 'coffee -o ./ -c src/'
'compile-server-side':
options: stdout: true
command: 'coffee -o public/scripts/compiled -c public/scripts/src... |
Clear error when buffer changes | {$, EditorView, View} = require 'atom'
path = require 'path'
module.exports =
class Dialog extends View
@content: ({prompt} = {}) ->
@div class: 'tree-view-dialog overlay from-top', =>
@div class: 'block', =>
@label prompt, class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new Edit... | {$, EditorView, View} = require 'atom'
path = require 'path'
module.exports =
class Dialog extends View
@content: ({prompt} = {}) ->
@div class: 'tree-view-dialog overlay from-top', =>
@div class: 'block', =>
@label prompt, class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new Edit... |
Use title case in menu | 'context-menu':
'.overlayer':
'Correct spelling': 'spell-check:correct-misspelling'
| 'context-menu':
'.overlayer':
'Correct Spelling': 'spell-check:correct-misspelling'
|
Rename function to match standard | # Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
fileTypes = {
"GitHub Markdown": (editor) ->
editor.setSoftWrap(true)
editor.setTabLength(4)
"Java": (editor) ->
... | # Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
fileTypes = {
"GitHub Markdown": (editor) ->
editor.setSoftWrap(true)
editor.setTabLength(4)
"Java": (editor) ->
... |
Add binding for enter key in table view editor | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://ato... | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://ato... |
Allow for feedback open to be triggered through the mediator | _ = require 'underscore'
Backbone = require 'backbone'
FeedbackView = require '../../feedback/view.coffee'
module.exports = class FooterView extends Backbone.View
events:
'click .mlf-feedback': 'feedback'
feedback: (e) ->
e.preventDefault()
# FeedbackView inherits ModalView which au... | _ = require 'underscore'
Backbone = require 'backbone'
FeedbackView = require '../../feedback/view.coffee'
mediator = require '../../../lib/mediator.coffee'
module.exports = class FooterView extends Backbone.View
events:
'click .mlf-feedback': 'feedback'
initialize: (options) ->
med... |
Make tz selection test non-system-specific | # depends:
# python.install
# prosilver?
#
# after:
# casper.registration_agreement
#
# phpbb_version:
# >=3.1.0
d = ->
console.log arguments...
base = global.wolis.config.test_url
casper.start base + '/ucp.php?mode=register&agreed=1', ->
@test.assertExists '#tz_date'
tz_value = @evaluate ->
document.query... | # depends:
# python.install
# prosilver?
#
# after:
# casper.registration_agreement
#
# phpbb_version:
# >=3.1.0
d = ->
console.log arguments...
base = global.wolis.config.test_url
casper.start base + '/ucp.php?mode=register&agreed=1', ->
@test.assertExists '#tz_date'
tz_value = @evaluate ->
document.query... |
Fix a typo in a comment | define ['mediator', 'lib/route'], (mediator, Route) ->
'use strict'
class Router # This class does not inherit from Backbone’s router
constructor: ->
# Create a Backbone.History instance
@createHistory()
createHistory: ->
Backbone.history or= new Backbone.History
startHistory: ->
... | define ['mediator', 'lib/route'], (mediator, Route) ->
'use strict'
class Router # This class does not inherit from Backbone’s router
constructor: ->
# Create a Backbone.History instance
@createHistory()
createHistory: ->
Backbone.history or= new Backbone.History
startHistory: ->
... |
Update the breadcrumb directive to use the new router and use the actual design. | angular.module('fileManager')
.directive('breadcrumb', ($location)->
return {
restrict: 'E'
scope: true
template: '<ol class="breadcrumb">' +
'<li ng-repeat="piece in breadcrumb" class="breadcrumb-part" ng-class="{active: $last}">' +
'<a ng-if="!$last" ng-href="#{{piece.l... | angular.module('fileManager')
.directive('breadcrumb', ($stateParams)->
return {
restrict: 'E'
template: """
<div class="breadcrumb">
<div class="breadcrumb-separator"><i class="icon icon-arrow-right"></i></div>
<span ng-repeat="piece in breadcrumb">
... |
Remove the closure function from generated JS files. Add support for generating source maps |
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
clean:
main: 'target/src'
test: 'target/test'
coffeelint:
options:
configFile: 'coffeelint.json'
main: 'src/**/*.coffee'
test: 'test/**/*.coffee'
build: 'gruntfile.coffee... |
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
clean:
main: 'target/src'
test: 'target/test'
coffeelint:
options:
configFile: 'coffeelint.json'
main: 'src/**/*.coffee'
test: 'test/**/*.coffee'
build: 'gruntfile.coffee... |
Revert "Frontend now explicitly connects to port 443 - localhost now works" | 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:443', {secure: true})
@socket.emit 'new player', 'name'
@socket... | 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 ... |
Access active pane item from atom.workspace | class FocusAction
constructor: ->
isComplete: -> true
isRecordable: -> false
focusCursor: ->
editor = atom.workspaceView.getActivePaneItem()
editorView = atom.workspaceView.getActiveView()
if editor? and editorView?
cursorPosition = editor.getCursorBufferPosition()
editorView.scrollToBu... | class FocusAction
constructor: ->
isComplete: -> true
isRecordable: -> false
focusCursor: ->
editor = atom.workspace.getActivePaneItem()
editorView = atom.workspaceView.getActiveView()
if editor? and editorView?
cursorPosition = editor.getCursorBufferPosition()
editorView.scrollToBuffer... |
Remove hubot boom throw documentation line, since it's not a special case | # Description
# Trys to crash Hubot on purpose
#
# Commands:
# hubot boom - try to crash Hubot
# hubot boom emit with msg - try to crash Hubot by emitting an error with a msg
# hubot boom emit without msg - try to crash Hubot by emitting an error without a msg
# hubot boom throw- try to crash Hubot with a thr... | # Description
# Trys to crash Hubot on purpose
#
# Commands:
# hubot boom [other text]- try to crash Hubot
# hubot boom emit with msg - try to crash Hubot by emitting an error with a msg
# hubot boom emit without msg - try to crash Hubot by emitting an error without a msg
boomError = (boom, string) ->
new Er... |
Send all bug info in one irc line | # Description:
# In which Hubot gives you bugzilla information
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot bug <number> - Shows bug summary
#
# Author:
# greenb
QS = require 'querystring'
Cheerio = require 'cheerio'
module.exports = (robot) ->
domain = 'http://bugs.sfola... | # Description:
# In which Hubot gives you bugzilla information
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot bug <number> - Shows bug summary
#
# Author:
# greenb
QS = require 'querystring'
Cheerio = require 'cheerio'
module.exports = (robot) ->
domain = 'http://bugs.sfola... |
Allow you to say "hubot bug xxx" anywhere | # Description:
# In which Hubot gives you bugzilla information
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot bug <number> - Shows bug summary
#
# Author:
# greenb
QS = require 'querystring'
Cheerio = require 'cheerio'
module.exports = (robot) ->
domain = 'http://bugs.sfola... | # Description:
# In which Hubot gives you bugzilla information
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot bug <number> - Shows bug summary
#
# Author:
# greenb
QS = require 'querystring'
Cheerio = require 'cheerio'
module.exports = (robot) ->
domain = 'http://bugs.sfola... |
Handle underscores in capitalize function | window.rglossaUtils =
capitalize: (str) ->
if str.length then str[0].toUpperCase() + str.slice(1) else ''
# From http://davidwalsh.name/javascript-debounce-function
# Returns a function, that, as long as it continues to be invoked, will not
# be triggered. The function will be called after it stops being... | window.rglossaUtils =
capitalize: (str) ->
return '' unless str.length
(str.split('_').map (part) -> part[0].toUpperCase() + part.slice(1)).join('')
# From http://davidwalsh.name/javascript-debounce-function
# Returns a function, that, as long as it continues to be invoked, will not
# be triggered. T... |
Use fetchAccount util for getting message owner | remote = require('../remote').getInstance()
module.exports = (message, callback) ->
{constructorName, _id} = message.account
remote.cacheable constructorName, _id, (err, owner) ->
return callback err if err
return callback { message: "Account not found", name: "NotFound" } unless owner
callback null, ... | remote = require('../remote').getInstance()
fetchAccount = require './fetchAccount'
module.exports = (message, callback) ->
fetchAccount message.account, (err, owner) ->
return callback err if err
return callback { message: "Account not found", name: "NotFound" } unless owner
callback null, owner
|
Use new Express 4 format for bodyParser | express = require 'express'
cookieParser = require 'cookie-parser'
bodyParser = require 'body-parser'
session = require 'cookie-session'
colors = require 'colors'
passport = require './lib/auth'
util = require './lib/util'
config = require './config'
module.exports = app = express()
app.set 'views', 'public/'
app.se... | express = require 'express'
cookieParser = require 'cookie-parser'
bodyParser = require 'body-parser'
session = require 'cookie-session'
colors = require 'colors'
passport = require './lib/auth'
util = require './lib/util'
config = require './config'
module.exports = app = express()
app.set 'views', 'public/'
app.se... |
Update the shell command to make travis happy. | module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
shell:
clean:
command: '[ -e gametime.db ] && rm gametime.db'
init_db:
command: 'sqlite3 gametime.db < db.sql'
nointro:
command: 'coffee nointro.... | module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
shell:
clean:
command: '[ ! -e gametime.db ] || rm gametime.db'
init_db:
command: 'sqlite3 gametime.db < db.sql'
nointro:
command: 'coffee nointr... |
Move beautify config above compress config | module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
clean:
lib: './lib/'
coffee:
src:
options:
bare: true
expand: true
cwd: './src/'
src: ['**/*.coffee']
dest: './lib/'
ext: '.js'
uglify:
opti... | module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
clean:
lib: './lib/'
coffee:
src:
options:
bare: true
expand: true
cwd: './src/'
src: ['**/*.coffee']
dest: './lib/'
ext: '.js'
uglify:
opti... |
Check for linkd to exist | ###
Working with Junction Point(s)
###
module.exports = exports = (id = 'none')->
run 0, true, (bin = file install2, 'linkd.exe'), link, '/D'
if false == id
return
bat id
run 0, true, bin, link, folder install2, id
return
# Path to link
exports.$ =
link =
folder install2, 'this'
| ###
Working with Junction Point(s)
###
module.exports = exports = (id = 'none')->
unless (bin = file install2, 'linkd.exe').y()
throw Error "File not found: #{bin}"
run 0, true, bin, link, '/D'
if false == id
return
bat id
run 0, true, bin, link, folder install2, id
return
# Path to link
exports.$... |
Implement ConceptInfo.ui property for element access post-render | define [
'../core'
'tpl!templates/concept/info.html'
], (c, templates...) ->
templates = c._.object ['info'], templates
class ConceptInfo extends c.Marionette.ItemView
className: 'concept-info'
template: templates.info
serializeData: ->
data = @model.toJSON()
... | define [
'../core'
'tpl!templates/concept/info.html'
], (c, templates...) ->
templates = c._.object ['info'], templates
class ConceptInfo extends c.Marionette.ItemView
className: 'concept-info'
template: templates.info
# Shorthand references to primary UI elements. After the... |
Use alt rather than ctrl | # DOCUMENT: link to keymap documentation
'.editor':
'ctrl-up': 'line-jumper:move-up'
'ctrl-down': 'line-jumper:move-down'
'ctrl-shift-up': 'line-jumper:select-up'
'ctrl-shift-down': 'line-jumper:select-down'
| # DOCUMENT: link to keymap documentation
'.editor':
'alt-up': 'line-jumper:move-up'
'alt-down': 'line-jumper:move-down'
'alt-shift-up': 'line-jumper:select-up'
'alt-shift-down': 'line-jumper:select-down'
|
Exclude ignored files from search etc. | "*":
Zen:
width: 100
"atom-ternjs":
useSnippets: false
documentation: false
urls: false
lint: false
guess: false
inlineFnCompletion: false
"autocomplete-plus":
confirmCompletion: "tab always, enter when suggestion explicitly selected"
core:
excludeVcsIgnoredPaths: false
d... | "*":
Zen:
width: 100
"atom-ternjs":
useSnippets: false
documentation: false
urls: false
lint: false
guess: false
inlineFnCompletion: false
"autocomplete-plus":
confirmCompletion: "tab always, enter when suggestion explicitly selected"
core:
disabledPackages: [
"autocomp... |
Handle keyboard navigation with hidden selections better | $ ->
$(document).on 'keydown', (event) ->
active = $(document.activeElement)
if active.is('.group-dropdown-search, .selector-link')
switch event.which
when 40 # select next group with down arrow
target = active.parent().next('.group-item').find('.selector-link')
target = $('#... | $ ->
$(document).on 'keydown', (event) ->
active = $(document.activeElement)
if active.is('.group-dropdown-search, .selector-link')
switch event.which
when 40 # select next group with down arrow
target = active.parent().next('.group-item:visible').find('.selector-link')
targe... |
Add test to ensure cert bundle only gets loaded once | # Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | # Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... |
Remove old unused function (refactor only) | # 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/
roundUpBy = (value, round_to) ->
return round_to * Math.ceil(value / round_to)
formatNumber = (number) ->... | # 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/
formatNumber = (number) ->
Math.ceil(number).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
animateNumb... |
Disable Atom linter by default | "*":
"atom-ctags": {}
"autocomplete-plus":
enableAutoActivation: false
core:
audioBeep: false
disabledPackages: [
"exception-reporting"
]
ignoredNames: [
".bundle"
".git"
"log"
"repositories"
"tmp"
]
themes: [
"atom-dark-ui"
"solarized-da... | "*":
"atom-ctags": {}
"autocomplete-plus":
enableAutoActivation: false
core:
audioBeep: false
disabledPackages: [
"exception-reporting"
"linter"
]
ignoredNames: [
".bundle"
".git"
"log"
"repositories"
"tmp"
]
themes: [
"atom-dark-ui"
... |
Use ? to test for existence | React = require 'react'
{ReferenceBookExerciseActions, ReferenceBookExerciseStore} = require '../../flux/reference-book-exercise'
Question = require '../question'
LoadableItem = require '../loadable-item'
ReferenceBookMissingExercise = React.createClass
displayName: 'ReferenceBookMissingExercise'
render: ->
... | React = require 'react'
{ReferenceBookExerciseActions, ReferenceBookExerciseStore} = require '../../flux/reference-book-exercise'
Question = require '../question'
LoadableItem = require '../loadable-item'
ReferenceBookMissingExercise = React.createClass
displayName: 'ReferenceBookMissingExercise'
render: ->
... |
Move to regular class based views | `import Ember from 'ember'`
`import ENV from 'irene/config/environment';`
updateState = ->
return true
xvpInit = ->
return true
ConnectorRFB = Ember.Object.extend
rfb: null
constructor: (@canvasEl, @deviceToken) ->
console.log "ConnectorRFB - constructor"
console.log @canvasEl, @deviceToken
@r... | `import ENV from 'irene/config/environment';`
updateState = ->
return true
xvpInit = ->
return true
class ConnectorRFB
rfb: null
constructor: (@canvasEl, @deviceToken) ->
@rfb = new RFB
'target': @canvasEl
'encrypt': ENV.deviceFarmSsl
'repeaterID': ''
'true_color': true
'... |
Select a tool when we check a box. | RadioTask = require './radio'
class DrawingTask extends RadioTask
@type: 'drawing'
value = []
tools:
point: require '../drawing-tools/point'
ellipse: require 'marking-surface/lib/tools/ellipse'
rect: require 'marking-surface/lib/tools/rectangle'
text: require 'marking-surface/lib/tools/transc... | RadioTask = require './radio'
class DrawingTask extends RadioTask
@type: 'drawing'
value = []
tools:
point: require '../drawing-tools/point'
ellipse: require 'marking-surface/lib/tools/ellipse'
rect: require 'marking-surface/lib/tools/rectangle'
text: require 'marking-surface/lib/tools/transc... |
Replace single space with double for readability. | # Description:
# ASCII art
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot ascii me <text> - Show text in ascii art
#
# Author:
# atmos
module.exports = (robot) ->
robot.respond /ascii( me)? (.+)/i, (msg) ->
msg
.http("http://asciime.heroku.com/generate_ascii")
.que... | # Description:
# ASCII art
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot ascii me <text> - Show text in ascii art
#
# Author:
# atmos
module.exports = (robot) ->
robot.respond /ascii( me)? (.+)/i, (msg) ->
msg
.http("http://asciime.heroku.com/generate_ascii")
.que... |
Use Map instead of object | 'use strict'
dirTable =
'^': { x: 0, y: -1 }
'<': { x: -1, y: 0 }
'v': { x: 0, y: 1 }
'>': { x: 1, y: 0 }
Pointer = (@x, @y, dir, @space) ->
@_updateDir dir
return
Pointer::_updateDir = (dir) ->
@dir = dir
@ax = dirTable[dir].x
@ay = dirTable[dir].y
Pointer::turn = (dir) ->
if dirTable[dir]? and... | 'use strict'
dirTable = new Map [
['^', { x: 0, y: -1 }]
['<', { x: -1, y: 0 }]
['v', { x: 0, y: 1 }]
['>', { x: 1, y: 0 }]
]
Pointer = (@x, @y, dir, @space) ->
@_updateDir dir
return
Pointer::_updateDir = (dir) ->
@dir = dir
entry = dirTable.get dir
@ax = entry.x
@ay = entry.y
Pointer::turn = (... |
Remove editor class, fixes autosave error | {$$, ScrollView, View} = require 'atom'
module.exports =
class GitLogView extends ScrollView
@content: ->
@div class: 'git-log editor editor-colors native-key-bindings', tabindex: -1, =>
@div class: 'panels', =>
@subview 'graph', new ColumnView('Graph', 'graph')
... | {$$, ScrollView, View} = require 'atom'
module.exports =
class GitLogView extends ScrollView
@content: ->
@div class: 'git-log native-key-bindings', tabindex: -1, =>
@div class: 'panels', =>
@subview 'graph', new ColumnView('Graph', 'graph')
@subview 'comments',... |
Fix spec: Handle multiple scopes. | slick = require 'atom-slick'
EscapeCharacterRegex = /[-!"#$%&'*+,/:;=?@|^~()<>{}[\]]/g
parseScopeChain = (scopeChain) ->
scopeChain = scopeChain.replace EscapeCharacterRegex, (match) -> "\\#{match[0]}"
scope for scope in slick.parse(scopeChain)[0] ? []
selectorForScopeChain = (selectors, scopeChain) ->
scopes ... | slick = require 'atom-slick'
EscapeCharacterRegex = /[-!"#$%&'*+,/:;=?@|^~()<>{}[\]]/g
parseScopeChain = (scopeChain) ->
scopeChain = scopeChain.replace EscapeCharacterRegex, (match) -> "\\#{match[0]}"
scope for scope in slick.parse(scopeChain)[0] ? []
selectorForScopeChain = (selectors, scopeChain) ->
for sel... |
Allow silenceOutput to spy without silencing output | auth = require '../lib/auth'
global.silenceOutput = ->
spyOn(console, 'log')
spyOn(console, 'error')
spyOn(process.stdout, 'write')
spyOn(process.stderr, 'write')
global.spyOnToken = ->
spyOn(auth, 'getToken').andCallFake (callback) -> callback(null, 'token')
| auth = require '../lib/auth'
global.silenceOutput = (callThrough = false) ->
spyOn(console, 'log')
spyOn(console, 'error')
spyOn(process.stdout, 'write')
spyOn(process.stderr, 'write')
if callThrough
spy.andCallThrough() for spy in [
console.log,
console.error,
process.stdout.write,
... |
Add a Single Blank Line | class Quality
constructor: (@id, @name, @description, @defaultValue,
@defaultProgress, @maxProgress, @progressEscalation,
@visible) ->
Object.freeze @
increase: (whole, partial = 0) ->
levelUp = () =>
@value++
@maxProgress += @maxProgress * @progressEscalation
... | class Quality
constructor: (@id, @name, @description, @defaultValue,
@defaultProgress, @maxProgress, @progressEscalation,
@visible) ->
Object.freeze @
increase: (whole, partial = 0) ->
levelUp = () =>
@value++
@maxProgress += @maxProgress * @progressEscalation
... |
Fix survey deletion - add reference to Survey class | Template.delete_survey_modal.onCreated ->
@deleting = new ReactiveVar false
Template.delete_survey_modal.onRendered ->
$('#delete-survey-modal').on 'show.bs.modal', (event) =>
@surveyId = $(event.relatedTarget).data 'id'
Template.delete_survey_modal.helpers
deleting: ->
Template.instance().deleting.get(... | {Survey} = require '../../imports/models'
Template.delete_survey_modal.onCreated ->
@deleting = new ReactiveVar false
Template.delete_survey_modal.onRendered ->
$('#delete-survey-modal').on 'show.bs.modal', (event) =>
@surveyId = $(event.relatedTarget).data 'id'
Template.delete_survey_modal.helpers
deletin... |
Update the SVG image on frame change | React = require 'react'
# React.DOM doesn't include an SVG <image> tag
# (because of its namespaced `xlink:href` attribute, I think),
# so this fakes one by wrapping it in a <g>.
module.exports = React.createClass
displayName: 'SVGImage'
getDefaultProps: ->
src: ''
width: 0
height: 0
render: ->
... | React = require 'react'
# React.DOM doesn't include an SVG <image> tag
# (because of its namespaced `xlink:href` attribute, I think),
# so this fakes one by wrapping it in a <g>.
module.exports = React.createClass
displayName: 'SVGImage'
getDefaultProps: ->
src: ''
width: 0
height: 0
render: ->
... |
Use body parser middleware to make content accessible in POST requests | express = require 'express'
stylus = require 'stylus'
assets = require 'connect-assets'
app = express.createServer()
app.use assets()
app.set 'view engine', 'jade'
app.get '/', (req, resp) -> resp.render 'index'
app.get '/:filename.:extension', (req, resp) ->
content = req.param['content']
if (content and conten... | express = require 'express'
stylus = require 'stylus'
assets = require 'connect-assets'
app = express.createServer()
app.use assets()
app.use express.bodyParser()
app.set 'view engine', 'jade'
app.get '/', (req, resp) -> resp.render 'index'
app.get '/:filename.:extension', (req, resp) ->
content = req.param['conte... |
Add regression test for Navigator push and replace with nested dispatch | QUnit.module 'Batman.Navigator'
setup: ->
test "normalizePath(segments...) joins the segments with slashes, prepends a slash if necessary, and removes final trailing slashes", ->
equal Batman.Navigator.normalizePath(''), '/'
equal Batman.Navigator.normalizePath('','foo','','bar'), '/foo/bar'
equal Batman.Navi... | QUnit.module 'Batman.Navigator'
setup: ->
test "normalizePath(segments...) joins the segments with slashes, prepends a slash if necessary, and removes final trailing slashes", ->
equal Batman.Navigator.normalizePath(''), '/'
equal Batman.Navigator.normalizePath('','foo','','bar'), '/foo/bar'
equal Batman.Navig... |
Use `isBrowser` check for tests | noflo = require 'noflo'
if typeof process is 'object' and process.title is 'node'
chai = require 'chai' unless chai
Parse = require '../components/Parse.coffee'
else
Parse = require 'noflo-adapters/components/Parse.js'
describe 'Parse component', ->
c = null
ins = null
out = null
encoding = null
befor... | noflo = require 'noflo'
unless noflo.isBrowser()
chai = require 'chai' unless chai
Parse = require '../components/Parse.coffee'
else
Parse = require 'noflo-adapters/components/Parse.js'
describe 'Parse component', ->
c = null
ins = null
out = null
encoding = null
beforeEach ->
c = Parse.getCompone... |
Add a new error for the outcomes service | class ConsumerError extends Error
constructor: ->
super
class StoreError extends Error
constructor: ->
super
class ParameterError extends Error
constructor: ->
super
class SignatureError extends Error
constructor: ->
super
class NonceError extends Error
constructor: ->
super
module.export... | class ConsumerError extends Error
constructor: ->
super
class StoreError extends Error
constructor: ->
super
class ParameterError extends Error
constructor: ->
super
class SignatureError extends Error
constructor: ->
super
class NonceError extends Error
constructor: ->
super
class OutcomeR... |
Fix issue where loading screen would stay stuck. | #= require libraries
#= require_tree .
$ ->
$('.alert').delay(4000).fadeOut('slow')
$('.chosen').chosen()
$('.timeago').timeago()
# Have a loading screen when turbolinks is working it's magic
document.addEventListener 'page:fetch', ->
html = "<div id='loading'><div><i class='icon-spinner icon-spin icon-4x'></... | #= require libraries
#= require_tree .
$ ->
$('.alert').delay(4000).fadeOut('slow')
$('.chosen').chosen()
$('.timeago').timeago()
# Have a loading screen when turbolinks is working it's magic
document.addEventListener 'page:fetch', ->
html = "<div id='loading'><div><i class='icon-spinner icon-spin icon-4x'></... |
Use native keybindings in Readme preview | {$, $$$, View} = require 'atom-space-pen-views'
roaster = require 'roaster'
fs = require 'fs'
cheerio = require 'cheerio'
# Displays the readme for a package, if it has one
# TODO Decide to keep this or current button-to-new-tab view
module.exports =
class PackageReadmeView extends View
@content: ->
@section cla... | {$, $$$, View} = require 'atom-space-pen-views'
roaster = require 'roaster'
fs = require 'fs'
cheerio = require 'cheerio'
# Displays the readme for a package, if it has one
# TODO Decide to keep this or current button-to-new-tab view
module.exports =
class PackageReadmeView extends View
@content: ->
@section cla... |
Verify call count increasing in spec | {WorkspaceView} = require 'atom'
Reporter = require '../lib/reporter'
describe "Metrics", ->
beforeEach ->
atom.workspaceView = new WorkspaceView
spyOn(Reporter, 'request')
it "reports event", ->
waitsForPromise ->
atom.packages.activatePackage('metrics')
waitsFor ->
Reporter.request.... | {WorkspaceView} = require 'atom'
Reporter = require '../lib/reporter'
describe "Metrics", ->
beforeEach ->
atom.workspaceView = new WorkspaceView
spyOn(Reporter, 'request')
it "reports event", ->
waitsForPromise ->
atom.packages.activatePackage('metrics')
waitsFor ->
Reporter.request.... |
Change angular interpolate provider to not conflict with Blade | $ ->
window.chartColors = ['#3498DB', '#2ECC71', '#9B59B6', '#E74C3C', '#1ABC9C', '#F39C12', '#95A5A6']
$('#tabs a').click(
(e) ->
e.preventDefault()
$(this).tab 'show'
)
angular.module("main", ["ngResource", "ngRoute"])
| $ ->
window.chartColors = ['#3498DB', '#2ECC71', '#9B59B6', '#E74C3C', '#1ABC9C', '#F39C12', '#95A5A6']
$('#tabs a').click(
(e) ->
e.preventDefault()
$(this).tab 'show'
)
angular.module("main", ["ngResource", "ngRoute"])
.config(($interpolateProvider) ->
$interpolateProvider.startSymbol('<%').e... |
Add no-cache headers on Ajax GET calls. | ###!
Copyright (c) 2002-2014 "Neo Technology,"
Network Engine for Objects in Lund AB [http://neotechnology.com]
This file is part of Neo4j.
Neo4j is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... | ###!
Copyright (c) 2002-2014 "Neo Technology,"
Network Engine for Objects in Lund AB [http://neotechnology.com]
This file is part of Neo4j.
Neo4j is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... |
Use setting instead of hard-coding port | module.exports =
internal:
chat:
host: process.env['LISTEN_ADDRESS'] or "localhost"
port: 3010
apis:
web:
url: "http://#{process.env['WEB_HOST'] || "localhost"}:3000"
user: "sharelatex"
pass: "password"
mongo:
url : "mongodb://#{process.env['MONGO_HOST'] || "localhost"}/sharelatex"
redis... | module.exports =
internal:
chat:
host: process.env['LISTEN_ADDRESS'] or "localhost"
port: 3010
apis:
web:
url: "http://#{process.env['WEB_HOST'] || "localhost"}:#{process.env['WEB_PORT'] or 3000}"
user: "sharelatex"
pass: "password"
mongo:
url : "mongodb://#{process.env['MONGO_HOST'] || "l... |
Fix blurry partner profile cover image. | module.exports =
'''
fragment partner on Partner {
id
name
initials
locations(size:15) {
city
}
profile {
id
href
image {
cropped(width:400, height:300) {
url
}
}
}
}
''' | module.exports =
'''
fragment partner on Partner {
id
name
initials
locations(size:15) {
city
}
profile {
id
href
image {
cropped(width:400, height:300, version: ["wide", "large", "featured", "larger"]) {
url
}
}
}
}
'''
|
Allow Clearing the Save from the Console in a Pinch | angular.module 'qbn.save', ['qbn.quality']
.factory 'savedGame', (qualities) ->
storageName = 'qbnSave'
api =
load: () ->
save = JSON.parse localStorage.getItem storageName
return undefined if not save?
for savedQuality in save.qualities
quality = qualities.lookup saved... | angular.module 'qbn.save', ['qbn.quality']
.factory 'savedGame', (qualities) ->
storageName = 'qbnSave'
api =
load: () ->
save = JSON.parse localStorage.getItem storageName
return undefined if not save?
for savedQuality in save.qualities
quality = qualities.lookup saved... |
Split store checks to separate tests to get better output from CI | describe 'NoFlo UI initialization', ->
win = null
doc = null
db = null
before (done) ->
@timeout 20000
iframe = document.getElementById 'app'
iframe.src = '../app.html'
iframe.onload = ->
win = iframe.contentWindow
doc = iframe.contentDocument
setTimeout ->
done()
... | describe 'NoFlo UI initialization', ->
win = null
doc = null
db = null
before (done) ->
@timeout 20000
iframe = document.getElementById 'app'
iframe.src = '../app.html'
iframe.onload = ->
win = iframe.contentWindow
doc = iframe.contentDocument
setTimeout ->
done()
... |
Update indicator when first attached to status bar | {View} = require 'atom'
# Status bar view for the soft wrap indicator.
module.exports =
class SoftWrapIndicatorView extends View
@content: ->
@div class: 'inline-block', =>
@a 'Wrap', class: 'soft-wrap-indicator', outlet: 'light'
# Initializes the view by subscribing to various events.
#
# statusBar... | {View} = require 'atom'
# Status bar view for the soft wrap indicator.
module.exports =
class SoftWrapIndicatorView extends View
@content: ->
@div class: 'inline-block', =>
@a 'Wrap', class: 'soft-wrap-indicator', outlet: 'light'
# Initializes the view by subscribing to various events.
#
# statusBar... |
Add a Basic API Structure | Path = require 'path'
{CompositeDisposable, Emitter} = require 'atom'
{LinterTrace, LinterMessage, LinterError, LinterWarning} = require './messages'
class Linter
constructor: ->
@Emitter = new Emitter
@SubRegular = new CompositeDisposable
@SubFly = new CompositeDisposable
| Path = require 'path'
{CompositeDisposable, Emitter} = require 'atom'
{LinterTrace, LinterMessage, LinterError, LinterWarning} = require './messages'
class Linter
constructor: ->
@Emitter = new Emitter
@Subscriptions = new CompositeDisposable
@SubscriptionsFly = new CompositeDisposable # Fly needs to b... |
Simplify getting command dispatch target | {CompositeDisposable} = require 'atom'
{View, $} = require 'atom-space-pen-views'
module.exports =
class ToolbarButtonView extends View
@content: ->
@div class: 'icon'
initialize: (icon, callback, tooltip = null, iconset = null) ->
@subscriptions = new CompositeDisposable
iconClass = if !iconset then... | {CompositeDisposable} = require 'atom'
{View} = require 'atom-space-pen-views'
module.exports =
class ToolbarButtonView extends View
@content: ->
@div class: 'icon'
initialize: (icon, callback, tooltip = null, iconset = null) ->
@subscriptions = new CompositeDisposable
iconClass = if !iconset then 'i... |
Include verbose details about error/warning. | {exec, child} = require('child_process')
fs = require('fs')
Linter = require(atom.packages.getLoadedPackage('linter').path + '/lib/linter')
class LinterScalac extends Linter
@syntax: ['source.scala']
classpath: null
cmd: 'scalac'
linterName: 'scalac'
regex: 'scala:(?<line>\\d+): ((?<error>error)|(?<warning>wa... | {exec, child} = require('child_process')
fs = require('fs')
Linter = require(atom.packages.getLoadedPackage('linter').path + '/lib/linter')
class LinterScalac extends Linter
@syntax: ['source.scala']
classpath: null
cmd: 'scalac'
linterName: 'scalac'
regex: 'scala:(?<line>\\d+): ((?<error>error)|(?<warning>wa... |
Fix FF bug: parsing the mid date was wrong. cc: @urielster @ofri | mid = new Date('02/25/14 00:00:00')
Template.agenda.day1 = ->
_.sortBy(@items.filter((i) -> i.time < mid), (i) -> i.time)
Template.agenda.day2 = ->
_.sortBy(@items.filter((i) -> i.time > mid), (i) -> i.time)
Template.agenda.canSee = -> true
# u = User.current()
# u and (u.admin() or u.moderator())
Template.a... | mid = new Date('02/25/2014 00:00:00')
Template.agenda.day1 = ->
_.sortBy(@items.filter((i) -> i.time < mid), (i) -> i.time)
Template.agenda.day2 = ->
_.sortBy(@items.filter((i) -> i.time > mid), (i) -> i.time)
Template.agenda.canSee = -> true
# u = User.current()
# u and (u.admin() or u.moderator())
Template... |
Work on RequireJS Jasmine test. | describe "RequireJS", ->
beforeEach ->
@addMatchers
requirejsTobeUndefined: ->
typeof requirejs is "undefined"
requireTobeUndefined: ->
typeof require is "undefined"
defineTobeUndefined: ->
typeof define is "undefined"
it "check that the RequireJS object is present ... | describe "RequireJS namespacing", ->
beforeEach ->
@addMatchers
requirejsTobeUndefined: ->
typeof requirejs is "undefined"
requireTobeUndefined: ->
typeof require is "undefined"
defineTobeUndefined: ->
typeof define is "undefined"
it "check that the RequireJS object... |
Make home page trackable by sidebar | template = require 'views/templates/home'
PageView = require 'views/base/page_view'
module.exports = class HomePageView extends PageView
template: template
className: 'home-page'
| template = require 'views/templates/home'
PageView = require 'views/base/page_view'
module.exports = class HomePageView extends PageView
template: template
className: 'home-page'
id: 'home-page'
|
Adjust pop-up window as a variable | {React, ReactBootstrap} = window
{Button} = ReactBootstrap
remote = require 'remote'
BrowserWindow = remote.require 'browser-window'
module.exports =
name: 'OwnedList'
priority: 50
displayName: '详细信息'
description: '提供已有舰娘和已有装备详细信息查看'
reactClass: React.createClass
shipInfoWindow: new BrowserWindow
... | {React, ReactBootstrap} = window
{Button} = ReactBootstrap
remote = require 'remote'
BrowserWindow = remote.require 'browser-window'
shipInfoWindow = null
initialShipInfoWindow = ->
shipInfoWindow = new BrowserWindow
#Use cconfig
x: 0
y: 0
width: 800
height: 600
show: false
shipInfoWindow... |
Reposition *after* you add to the DOM. | {View, $} = require 'atom'
module.exports =
class SideView extends View
@content: (side) ->
@div class: "side #{side.klass()} ui-site-#{side.site()}", =>
@div class: 'controls', =>
@label class: 'text-highlight', side.ref
@span class: 'text-subtle', "// #{side.description()}"
@butto... | {View, $} = require 'atom'
module.exports =
class SideView extends View
@content: (side) ->
@div class: "side #{side.klass()} ui-site-#{side.site()}", =>
@div class: 'controls', =>
@label class: 'text-highlight', side.ref
@span class: 'text-subtle', "// #{side.description()}"
@butto... |
Add finder to terms chooser | SHARED_COLLECTION = new Skr.Models.PaymentTerm.Collection
class Skr.Components.TermsChooser extends Lanes.React.Component
propTypes:
model: Lanes.PropTypes.Model.isRequired
label: React.PropTypes.string
name: React.PropTypes.string
getDefaultProps: ->
label: 'Payment Terms', ... | SHARED_COLLECTION = new Skr.Models.PaymentTerm.Collection
class Skr.Components.TermsChooser extends Lanes.React.Component
propTypes:
model: Lanes.PropTypes.Model.isRequired
label: React.PropTypes.string
name: React.PropTypes.string
useFinder: React.PropTypes.bool
getDefaultPr... |
Fix deprecated selector in keymap | '.workspace':
'alt-g o': 'open-on-github:file'
'alt-g b': 'open-on-github:blame'
'alt-g h': 'open-on-github:history'
'alt-g c': 'open-on-github:copy-url'
'alt-g r': 'open-on-github:branch-compare'
| 'atom-workspace':
'alt-g o': 'open-on-github:file'
'alt-g b': 'open-on-github:blame'
'alt-g h': 'open-on-github:history'
'alt-g c': 'open-on-github:copy-url'
'alt-g r': 'open-on-github:branch-compare'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.