Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add more logging since we don't seem to be getting issue events | # Notifies about Crashlytics crashes via a Crashlytics web hook
#
# Dependencies:
# "url": ""
# "querystring": ""
#
# Configuration:
# Just put this url <HUBOT_URL>:<PORT>/hubot/jenkins-notify?room=<room> to your Jenkins
# Notification config. See here: https://wiki.jenkins-ci.org/display/JENKINS/Notification+P... | # Notifies about Crashlytics crashes via a Crashlytics web hook
#
# Dependencies:
# "url": ""
# "querystring": ""
#
# Configuration:
# Just put this url <HUBOT_URL>:<PORT>/hubot/jenkins-notify?room=<room> to your Jenkins
# Notification config. See here: https://wiki.jenkins-ci.org/display/JENKINS/Notification+P... |
Revert "Add --atom-child_process-fork if running from Atom Helper" | child_process = require 'child_process'
module.exports =
class Command
spawn: (command, args, remaining...) ->
options = remaining.shift() if remaining.length >= 2
callback = remaining.shift()
spawned = child_process.spawn(command, args, options)
errorChunks = []
outputChunks = []
spawned.s... | child_process = require 'child_process'
module.exports =
class Command
spawn: (command, args, remaining...) ->
options = remaining.shift() if remaining.length >= 2
callback = remaining.shift()
spawned = child_process.spawn(command, args, options)
errorChunks = []
outputChunks = []
spawned.s... |
Drop dailycute.net, add reddit /r/aww | # Description:
# Cute me is a way to get pictures of cute things
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot cute me - Receive a cute thing
# unicorn chaser - Receieve a cute thing
module.exports = (robot) ->
robot.respond /cute me/, (msg) ->
cuteMe(msg)
robot.hear /unico... | # Description:
# Cute me is a way to get pictures of cute things
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot cute me - Receive a cute thing
# unicorn chaser - Receieve a cute thing
module.exports = (robot) ->
robot.respond /cute me/, (msg) ->
cuteMe(msg)
robot.hear /unico... |
Remove backside visibility by default, it was giving blurry output on Safari | exports.addStyle = (css) ->
styleSheet = document.createElement "style"
styleSheet.innerHTML = css
document.head.appendChild styleSheet
exports.addStyle "
.framer {
display: block;
visibility: visible;
position: absolute;
top:auto; right:auto; bottom:auto; left:auto;
width:auto; height:auto;
overflow: vi... | exports.addStyle = (css) ->
styleSheet = document.createElement "style"
styleSheet.innerHTML = css
document.head.appendChild styleSheet
exports.addStyle "
.framer {
display: block;
visibility: visible;
position: absolute;
top:auto; right:auto; bottom:auto; left:auto;
width:auto; height:auto;
overflow: vi... |
Fix updating tags multiple times | $ ->
$("div.tag-form li.cancel a").click ->
$("div.tags").show()
$("div.tag-form").hide()
return
$("a[rel='edit-tags']").click ->
$("div.tags").hide()
$("div.tag-form").show()
return
$("form.edit-tags").on "ajax:success", (event) ->
data = event.detail[0];
$("div.tags-panel").rep... | $ ->
setupTags = ->
$("div.tag-form").hide()
$("div.tag-form li.cancel a").click ->
$("div.tags").show()
$("div.tag-form").hide()
return
$("a[rel='edit-tags']").click ->
$("div.tags").hide()
$("div.tag-form").show()
return
$("form.edit-tags").on "ajax:success", (e... |
Fix deprecated selectors in keymap | '.editor':
'ctrl-space': 'autocomplete:toggle'
'.autocomplete .mini.editor':
'enter': 'core:confirm'
'tab': 'core:confirm'
| 'atom-text-editor':
'ctrl-space': 'autocomplete:toggle'
'.autocomplete atom-text-editor[mini]':
'enter': 'core:confirm'
'tab': 'core:confirm'
|
Use config for directory paths | fs = require 'fs'
path = require 'path'
temp = require 'temp'
_ = require 'underscore'
temp.track()
module.exports = (grunt) ->
grunt.registerTask 'create-windows-installer', 'Create the Windows installer', ->
@requiresConfig("#{@name}.appDirectory")
done = @async()
{appDirectory, outputDirectory} = @... | fs = require 'fs'
path = require 'path'
temp = require 'temp'
_ = require 'underscore'
temp.track()
module.exports = (grunt) ->
grunt.registerTask 'create-windows-installer', 'Create the Windows installer', ->
@requiresConfig("#{@name}.appDirectory")
done = @async()
{appDirectory, outputDirectory} = g... |
Refresh all ratings on successful event reaction update. | $ ->
# Refresh if a page is loaded directly
pageLoad()
# Refresh if a page is loaded via turbolinks
$(document).on "page:load", pageLoad
pageLoad = ->
# Steps to do on a page load (with turbolinks)
# Refresh all ratings on the current page
refreshRatings()
# Refresh for the new event divs that... | $ ->
# Refresh if a page is loaded directly
pageLoad()
# Refresh if a page is loaded via turbolinks
$(document).on "page:load", pageLoad
pageLoad = ->
# Steps to do on a page load (with turbolinks)
# Refresh all ratings on the current page
refreshRatings()
# Refresh for the new event divs that... |
Set loaded attr to true after fetching results | define (require) ->
Backbone = require('backbone')
SEARCH_URI = "#{location.protocol}//#{location.hostname}:6543/search"
return class SearchResults extends Backbone.Model
url: () -> "#{SEARCH_URI}#{@query}"
defaults:
query:
limits: []
sort: []
results:
items: []
... | define (require) ->
Backbone = require('backbone')
SEARCH_URI = "#{location.protocol}//#{location.hostname}:6543/search"
return class SearchResults extends Backbone.Model
url: () -> "#{SEARCH_URI}#{@query}"
defaults:
query:
limits: []
sort: []
results:
items: []
... |
Fix the Unwrap node exception | _ = require "underscore"
errors = require "../helper/errors"
Binding = require "../core/lib/Binding"
BasicAuthentication = require "../core/lib/Authentication/BasicAuthentication"
class FreshdeskBinding extends Binding
constructor: (options) ->
_.defaults options,
api: "Freshdesk"
super
request: (op... | _ = require "underscore"
errors = require "../helper/errors"
Binding = require "../core/lib/Binding"
BasicAuthentication = require "../core/lib/Authentication/BasicAuthentication"
class FreshdeskBinding extends Binding
constructor: (options) ->
_.defaults options,
api: "Freshdesk"
super
request: (op... |
Add native-key-bindings class to table | {$$, $$$, _, View} = require 'atom'
# Displays the keybindings for a package namespace
module.exports =
class PackageKeymapView extends View
@content: ->
@section class: 'package-keymap', =>
@div class: 'section-heading package-keymap-heading icon icon-keyboard', 'Keybindings'
@table outlet: 'keymapT... | {$$, $$$, _, View} = require 'atom'
# Displays the keybindings for a package namespace
module.exports =
class PackageKeymapView extends View
@content: ->
@section class: 'package-keymap', =>
@div class: 'section-heading package-keymap-heading icon icon-keyboard', 'Keybindings'
@table outlet: 'keymapT... |
Throw error if trying to beautify Perl without setting Perl Tidy path | ###
// Requires [perltidy](http://perltidy.sourceforge.net)
###
"use strict"
getCmd = (inputPath, outputPath, options) ->
# console.debug "[perl-beautify] options: " + JSON.stringify(options)
args = [
'"' + options.perltidy_path + '"'
'--standard-output'
'--standard-error-output'
'--quiet'
]
i... | ###
// Requires [perltidy](http://perltidy.sourceforge.net)
###
"use strict"
getCmd = (inputPath, outputPath, options) ->
# console.debug "[perl-beautify] options: " + JSON.stringify(options)
if not options.perltidy_path?
return new Error("'Perl Perltidy Path' not set!" +
" Please set this in the Atom B... |
Add cookie storge for saving status filter over multiple sessions. | Wheelmap.ToolbarController = Ember.Controller.extend
needs: 'map'
statusFilters: ['yes', 'limited', 'no', 'unknown']
map: Ember.computed.alias('controllers.map')
_extraFilter: false # Flag for executing special status filter behavior only once
actions:
toggleFilter: (wheelchair)->
statusFilters = @... | Wheelmap.ToolbarController = Ember.Controller.extend
needs: 'map'
statusFilters: ['yes', 'limited', 'no', 'unknown']
map: Ember.computed.alias('controllers.map')
_extraFilter: false # Flag for executing special status filter behavior only once
init: ()->
@_super()
if $.cookie('last_status_filters')
... |
Fix image sizing in FF | #= require trix/views/attachment_view
class Trix.ImageAttachmentView extends Trix.AttachmentView
render: ->
@image = document.createElement("img")
@loadFile() if @attachment.isPending()
@updateAttributes()
@image
loadFile: ->
reader = new FileReader
reader.onload = (event) =>
if @att... | #= require trix/views/attachment_view
#= require trix/lib/helpers
{defer} = Trix.Helpers
class Trix.ImageAttachmentView extends Trix.AttachmentView
render: ->
@image = document.createElement("img")
@loadFile() if @attachment.isPending()
@updateAttributes()
@image
loadFile: ->
reader = new Fil... |
Remove redudant routes to support the new "overview" section | class @Router extends Backbone.Router
routes:
"demand/:sidebar(/:slide)" : "demand"
"costs/:sidebar(/:slide)" : "costs"
"overview/:sidebar(/:slide)": "overview"
"supply/:sidebar(/:slide)" : "supply"
"flexibility/:sidebar(/:slide)" : "flexibility"
"data/:sidebar(/:slide)" : "data"
"report"... | class @Router extends Backbone.Router
routes:
"report" : "report"
":tab/:sidebar(/:slide)" : "load_slides"
"" : "load_default_slides"
report: =>
# pass
load_slides: (tab, sidebar, slide) ->
url = "/scenario/#{_.compact([tab, sidebar, slide]).join('/')}"
$.ajax
url: url
da... |
Fix error raised when minimap is not toggled | {View} = require 'atom'
module.exports = ->
highlightSelectedPackage = atom.packages.getLoadedPackage('highlight-selected')
highlightSelected = require (highlightSelectedPackage.path)
HighlightedAreaView = require (highlightSelectedPackage.path + '/lib/highlighted-area-view')
class FakeEditor
constructor... | {View} = require 'atom'
module.exports = ->
highlightSelectedPackage = atom.packages.getLoadedPackage('highlight-selected')
highlightSelected = require (highlightSelectedPackage.path)
HighlightedAreaView = require (highlightSelectedPackage.path + '/lib/highlighted-area-view')
class FakeEditor
constructor... |
Move pieces to exact position at end of move, to stop rounding error drift. | #= require roofpig/changers/TimedChanger
class @MoveExecution extends TimedChanger
constructor: (@pieces, @axis, @angle_to_turn, turn_time, animate) ->
super(turn_time)
unless animate
this.finish()
do_change: (completion_diff) ->
for piece in @pieces
this._rotateAroundWorldAxis(piece, com... | #= require roofpig/changers/TimedChanger
class @MoveExecution extends TimedChanger
constructor: (@pieces, @axis, @angle_to_turn, turn_time, animate) ->
super(turn_time)
unless animate
this.finish()
do_change: (completion_diff) ->
for piece in @pieces
this._rotateAroundWorldAxis(piece, com... |
Add another spec to the reference counter | RefCountedTokenList = require '../lib/ref-counted-token-list'
describe 'RefCountedTokenList', ->
[list] = []
beforeEach ->
list = new RefCountedTokenList
describe "when words are added and removed from the list", ->
it "maintains the word in the list until there are no more references", ->
expect(... | RefCountedTokenList = require '../lib/ref-counted-token-list'
describe 'RefCountedTokenList', ->
[list] = []
beforeEach ->
list = new RefCountedTokenList
describe "when tokens are added to and removed from the list", ->
it "maintains the token in the list until there are no more references", ->
ex... |
Use `getMachines` to pass MoreVMsModal. | SidebarMachineList = require './sidebarmachinelist'
MoreVMsModal = require 'app/activity/sidebar/morevmsmodal'
ComputeHelpers = require '../../providers/computehelpers'
Machine = require 'app/providers/machine'
module.exports = class SidebarOwnMachinesList extends SidebarMachineList
constructor: (options = {}, dat... | SidebarMachineList = require './sidebarmachinelist'
MoreVMsModal = require 'app/activity/sidebar/morevmsmodal'
ComputeHelpers = require '../../providers/computehelpers'
Machine = require 'app/providers/machine'
module.exports = class SidebarOwnMachinesList extends SidebarMachineList
constructor: (options = {}, dat... |
Fix app initialization on old browsers | #= require_tree ./vendor
#= require lib/license
#= require_tree ./lib
#= require app/app
#= require app/config
#= require_tree ./app
#= require collections/collection
#= require_tree ./collections
#= require models/model
#= require_tree ./models
#= require views/view
#= require_tree ./views
#= require_tree ./temp... | #= require_tree ./vendor
#= require lib/license
#= require_tree ./lib
#= require app/app
#= require app/config
#= require_tree ./app
#= require collections/collection
#= require_tree ./collections
#= require models/model
#= require_tree ./models
#= require views/view
#= require_tree ./views
#= require_tree ./temp... |
Replace jquery deprecated .live with .on | class CommitsList
@data =
ref: null
limit: 0
offset: 0
@disable = false
@showProgress: ->
$('.loading').show()
@hideProgress: ->
$('.loading').hide()
@init: (ref, limit) ->
$(".day-commits-table li.commit").live 'click', (event) ->
if event.target.nodeName != "A"
locat... | class CommitsList
@data =
ref: null
limit: 0
offset: 0
@disable = false
@showProgress: ->
$('.loading').show()
@hideProgress: ->
$('.loading').hide()
@init: (ref, limit) ->
$("body").on "click", ".day-commits-table li.commit", (event) ->
if event.target.nodeName != "A"
... |
Allow selecting all columns in a column family |
module.exports = class Get
constructor: (@row) ->
@tr =
from: null
to: null
@familyMap = {}
@maxVersions = 1
addColumn: (cf, qualifier) =>
@familyMap[cf] ?= []
@familyMap[cf].push qualifier
@
setMaxVersions: (maxVersions) =>
maxVersions = 1 if maxVersions <= 0
@maxVersions = maxVersions
... |
module.exports = class Get
constructor: (@row) ->
@tr =
from: null
to: null
@familyMap = {}
@maxVersions = 1
addColumn: (cf, qualifier) =>
@familyMap[cf] ?= []
@familyMap[cf].push qualifier if qualifier
@
setMaxVersions: (maxVersions) =>
maxVersions = 1 if maxVersions <= 0
@maxVersions = ... |
Remove ajax loader bar when click on submit form | #= require vendor/modernizr
#= require jquery
#= require jquery_ujs
#= require foundation/foundation
#= require foundation
#= require turbolinks
#= require nprogress
#= require nprogress-turbolinks
#= require rails.validations
#= require rails.validations.simple_form
#= require rails.validations.simple_form.fix
#= requ... | #= require vendor/modernizr
#= require jquery
#= require jquery_ujs
#= require foundation/foundation
#= require foundation
#= require turbolinks
#= require nprogress
#= require nprogress-turbolinks
#= require rails.validations
#= require rails.validations.simple_form
#= require rails.validations.simple_form.fix
#= requ... |
Use setStrokeWidth to change stroke width from ReactGUI | createSetStateOnEventMixin = require '../reactGUI/createSetStateOnEventMixin'
{classSet} = require '../core/util'
module.exports = React.createClass
displayName: 'StrokeWidthPicker'
getState: -> {strokeWidth: @props.tool.strokeWidth}
getInitialState: -> @getState()
mixins: [createSetStateOnEventMixin('toolCha... | createSetStateOnEventMixin = require '../reactGUI/createSetStateOnEventMixin'
{classSet} = require '../core/util'
module.exports = React.createClass
displayName: 'StrokeWidthPicker'
getState: -> {strokeWidth: @props.tool.strokeWidth}
getInitialState: -> @getState()
mixins: [createSetStateOnEventMixin('toolCha... |
Make data converter parse floats, not ints | CONVERTERS =
percentage:
decimal: (value) ->
parseInt(value, 10) / 100
date:
epoch: (value) ->
new Date(value).getTime()
exports.convert = (fromType, toType, value) ->
throw "DataConverter can't convert null or undefined values" unless value?
converter = CONVERTERS[fromType]?[toType]
unl... | CONVERTERS =
percentage:
decimal: (value) ->
parseFloat(value, 10) / 100
date:
epoch: (value) ->
new Date(value).getTime()
exports.convert = (fromType, toType, value) ->
throw "DataConverter can't convert null or undefined values" unless value?
converter = CONVERTERS[fromType]?[toType]
u... |
Fix incorrect keyword for exclusion if => when | define [
'../core'
'./base'
], (c, base) ->
class ExporterModel extends base.Model
class ExporterCollection extends base.Collection
model: ExporterModel
# Versions greater than or equal to this version are considered to
# support notification on completion.
minSerran... | define [
'../core'
'./base'
], (c, base) ->
class ExporterModel extends base.Model
class ExporterCollection extends base.Collection
model: ExporterModel
# Versions greater than or equal to this version are considered to
# support notification on completion.
minSerran... |
Revert "Handle both bzipped and non-bzipped data in DataUnpacker" | class AsciiIo.DataUnpacker
unpack: (base64BzippedData, callback) ->
data = atob base64BzippedData
if data[0] == 'B' and data[1] == 'Z'
if window.Worker
worker = new Worker(window.unpackWorkerPath)
worker.onmessage = (event) => callback event.data
worker.postMessage data
el... | class AsciiIo.DataUnpacker
unpack: (base64BzippedData, callback) ->
bzippedData = atob base64BzippedData
if window.Worker
worker = new Worker(window.unpackWorkerPath)
worker.onmessage = (event) => callback event.data
worker.postMessage bzippedData
else
data = ArchUtils.bz2.decode ... |
Handle empty string as content. | class EditorPane extends Pane
constructor: (options = {}, data) ->
options.cssClass = KD.utils.curry "editor-pane", options.cssClass
super options, data
@createEditor()
createEditor: ->
{file, content} = @getOptions()
unless file instanceof FSFile
throw new TypeError "File must be an... | class EditorPane extends Pane
constructor: (options = {}, data) ->
options.cssClass = KD.utils.curry "editor-pane", options.cssClass
super options, data
@createEditor()
createEditor: ->
{file, content} = @getOptions()
unless file instanceof FSFile
throw new TypeError "File must be an... |
Use fsUtils.readObject() to read theme metadata | fsUtils = require 'fs-utils'
Theme = require 'theme'
CSON = require 'cson'
# Internal: Represents a theme that Atom can use.
module.exports =
class AtomTheme extends Theme
# Internal: Given a path, this loads it as a stylesheet.
#
# stylesheetPath - A {String} to a stylesheet
loadStylesheet: (stylesheetPath)-... | fsUtils = require 'fs-utils'
Theme = require 'theme'
# Internal: Represents a theme that Atom can use.
module.exports =
class AtomTheme extends Theme
# Internal: Given a path, this loads it as a stylesheet.
#
# stylesheetPath - A {String} to a stylesheet
loadStylesheet: (stylesheetPath)->
@stylesheets[sty... |
Remove puts statement in client code | import ember from 'ember'
import config from 'totem-config/config'
import m_unauth_route from 'ember-simple-auth/mixins/unauthenticated-route-mixin'
export default ember.Route.extend m_unauth_route,
# The ember-simple-auth 'unauthenticated-route-mixin' adds a beforeModel hook.
# If the session is already authent... | import ember from 'ember'
import config from 'totem-config/config'
import m_unauth_route from 'ember-simple-auth/mixins/unauthenticated-route-mixin'
export default ember.Route.extend m_unauth_route,
# The ember-simple-auth 'unauthenticated-route-mixin' adds a beforeModel hook.
# If the session is already authent... |
Fix param name for debugging routes | express = require 'express'
routes = require './routes'
app = module.exports = express()
app.set 'views', __dirname + '/templates'
app.set 'view engine', 'jade'
app.get '/inquiry/development', routes.development
app.get '/inquiry/debug/:id', routes.index
app.get '/inquiry/debug/:id/*', routes.index
app.get '/inquiry/... | express = require 'express'
routes = require './routes'
app = module.exports = express()
app.set 'views', __dirname + '/templates'
app.set 'view engine', 'jade'
app.get '/inquiry/development', routes.development
app.get '/inquiry/debug/:artwork_id', routes.index
app.get '/inquiry/debug/:artwork_id/*', routes.index
ap... |
Add mouseout if solution has focus so it's easier to select issue and twitter | $ ->
$(".chzn-select").chosen disable_search_threshold: 25
$("#problem_body").charCount
allowed: 250
warning: 20
counterText: " characters remaining"
$("#problem_solution_body").charCount
allowed: 250
warning: 20
counterText: " characters remaining"
charCounter = $("span.counter")
ch... | $ ->
$(".chzn-select").chosen disable_search_threshold: 25
$("#problem_body").charCount
allowed: 250
warning: 20
counterText: " characters remaining"
$("#problem_solution_body").charCount
allowed: 250
warning: 20
counterText: " characters remaining"
charCounter = $("span.counter")
ch... |
Update jQuery selectors to be compatible with ember | $ ->
$body = $('body')
$('#container2')
.on 'mouseenter', '.box', (e)->
$(this).addClass 'hover'
$body.addClass 'box_hover'
.on 'mouseleave', '.box', (e)->
$(this).removeClass 'hover'
$body.removeClass 'box_hover'
| $ ->
$body = $('body')
$body.on 'mouseenter', '.box', (e)->
$(this).addClass 'hover'
$body.addClass 'box_hover'
$body.on 'mouseleave', '.box', (e)->
$(this).removeClass 'hover'
$body.removeClass 'box_hover'
|
Fix usage of deprecated size() method | jQuery ->
if $('#pagination').size() > 0
$('#pagination').hide()
loading_posts = false
$('#load-more-btn').show().click ->
unless loading_posts
loading_posts = true
more_posts_url = $('#pagination .pagination .next a').attr('href')
$this = $(this)
$this.html('<i clas... | jQuery ->
if $('#pagination').length > 0
$('#pagination').hide()
loading_posts = false
$('#load-more-btn').show().click ->
unless loading_posts
loading_posts = true
more_posts_url = $('#pagination .pagination .next a').attr('href')
$this = $(this)
$this.html('<i clas... |
Use directional light for sun instead of point light. |
THREE = require 'three'
IsometricCamera = require './isometric_camera.coffee'
class Renderer
constructor: ->
window.THREE = THREE
rad = 0.0174532925
@scene = new THREE.Scene
@renderer = new THREE.WebGLRenderer {
alpha: true
}
@renderer.setSize window.innerWidth, window.innerHeight
@renderer.se... |
THREE = require 'three'
IsometricCamera = require './isometric_camera.coffee'
class Renderer
constructor: ->
window.THREE = THREE
rad = 0.0174532925
@scene = new THREE.Scene
@renderer = new THREE.WebGLRenderer {
alpha: true
}
@renderer.setSize window.innerWidth, window.innerHeight
@renderer.se... |
Fix Open Latest RPT File command - Atom 1.7.0 compatibility | {CompositeDisposable} = require 'atom'
buildProject = require './lib/build-project'
openLatestRptFile = require './lib/open-latest-rpt-file'
module.exports =
subscriptions: null
config:
buildDevScript:
title: "Development Build Script",
description: "Location of the Development Build Script (requ... | {CompositeDisposable} = require 'atom'
buildProject = require './lib/build-project'
openLatestRptFile = require './lib/open-latest-rpt-file'
module.exports =
subscriptions: null
config:
buildDevScript:
title: "Development Build Script",
description: "Location of the Development Build Script (requ... |
Add CLI Help, More Lazy Data Retrieval | yaml = require('js-yaml')
argv = require('optimist').argv
books = require './books.yml'
retrieve = require('./src/retrieve')
do ->
console.log "Using books.yml with #{books.books.length} ISBNs"
r = retrieve(books.books)
if argv.table
output = require('./src/tableOutput')
output r
out = argv.o or ar... | optimist = require('optimist')
.usage('Amazon Trade In Price Check')
.alias('o', 'out')
.describe('o', 'Write data to JSON file. Usage: "-o data.json"')
.alias('t', 'table')
.describe('t', 'Output results as CLI table')
argv = optimist.argv
yaml = require('js-yaml')
books = require('./books.yml')
retrieve... |
Update view when title changes | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!collections/content'
'cs!views/workspace/sidebar/toc-branch'
'hbs!templates/workspace/sidebar/toc'
], ($, _, Backbone, Marionette, content, TocBranchView, tocTemplate) ->
return Marionette.CompositeView.extend
template: tocTemplate
item... | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!collections/content'
'cs!views/workspace/sidebar/toc-branch'
'hbs!templates/workspace/sidebar/toc'
], ($, _, Backbone, Marionette, content, TocBranchView, tocTemplate) ->
return Marionette.CompositeView.extend
template: tocTemplate
item... |
Use ENV.config instead of injected config | require 'routes/route'
TravisRoute = Travis.Route
Route = TravisRoute.extend
renderTemplate: ->
$('body').attr('id', 'home')
@_super.apply this, arguments
@render 'repos', outlet: 'left', into: 'main'
setupController: (controller)->
# TODO: this is redundant with repositories and recent route... | require 'routes/route'
TravisRoute = Travis.Route
config = ENV.config
Route = TravisRoute.extend
renderTemplate: ->
$('body').attr('id', 'home')
@_super.apply this, arguments
@render 'repos', outlet: 'left', into: 'main'
setupController: (controller)->
# TODO: this is redundant with repositor... |
Convert authors in results.items to author objects | define (require) ->
Backbone = require('backbone')
settings = require('cs!settings')
SEARCH_URI = "#{location.protocol}//#{settings.cnxarchive.host}:#{settings.cnxarchive.port}/search"
return class SearchResults extends Backbone.Model
url: () -> "#{SEARCH_URI}#{@query}"
defaults:
query:
... | define (require) ->
Backbone = require('backbone')
settings = require('cs!settings')
SEARCH_URI = "#{location.protocol}//#{settings.cnxarchive.host}:#{settings.cnxarchive.port}/search"
return class SearchResults extends Backbone.Model
url: () -> "#{SEARCH_URI}#{@query}"
defaults:
query:
... |
Add .webp to image extensions | path = require 'path'
_ = require 'underscore-plus'
ImageEditor = require './image-editor'
module.exports =
activate: ->
atom.workspace.registerOpener(openUri)
atom.packages.once('activated', createImageStatusView)
deactivate: ->
atom.workspace.unregisterOpener(openUri)
createImageStatusView = ->
{... | path = require 'path'
_ = require 'underscore-plus'
ImageEditor = require './image-editor'
module.exports =
activate: ->
atom.workspace.registerOpener(openUri)
atom.packages.once('activated', createImageStatusView)
deactivate: ->
atom.workspace.unregisterOpener(openUri)
createImageStatusView = ->
{... |
Access status bar via element | IncompatiblePackagesView = null
viewUri = 'atom://incompatible-packages'
createView = (state) ->
IncompatiblePackagesView ?= require './incompatible-packages-view'
new IncompatiblePackagesView(state)
atom.deserializers.add
name: 'IncompatiblePackagesView'
deserialize: (state) -> createView(state)
incompatibl... | IncompatiblePackagesView = null
viewUri = 'atom://incompatible-packages'
createView = (state) ->
IncompatiblePackagesView ?= require './incompatible-packages-view'
new IncompatiblePackagesView(state)
atom.deserializers.add
name: 'IncompatiblePackagesView'
deserialize: (state) -> createView(state)
incompatibl... |
Fix screen-row vs buffer-row error in indent operators | {Operator} = require './general-operators'
#
# It indents everything selected by the following motion.
#
class Indent extends Operator
# Public: Indents the text selected by the given motion.
#
# count - The number of times to execute.
#
# Returns nothing.
execute: (count=1) ->
@indent(count)
# Prote... | {Operator} = require './general-operators'
class AdjustIndentation extends Operator
execute: (count=1) ->
mode = @vimState.mode
@motion.select(count)
{start} = @editor.getSelectedBufferRange()
@indent()
if mode isnt 'visual'
@editor.setCursorBufferPosition([start.row, 0])
@editor.mo... |
Fix selection handle position when start column is not 0 | React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports = React.createClass
render: ->
{parentView} = @props
{top, left, width, height} = parentView.selectionScrollRect()
div className: 'selection-box-handle', style: {
top: (top + height) + 'px'
left: (left ... | React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports = React.createClass
render: ->
{parentView} = @props
{top, left, width, height} = parentView.selectionScrollRect()
div className: 'selection-box-handle', style: {
top: (top + height) + 'px'
left: width ... |
Switch to using gutil for proper formatting | # default - message + brief help
gulp = require "gulp"
runSequence = require "run-sequence"
gulp.task "default", (cb) ->
console.log('Building BokehJS for developer mode ...')
runSequence("build", "install", "watch", cb)
| # default - message + brief help
gulp = require "gulp"
gutil = require "gulp-util"
runSequence = require "run-sequence"
gulp.task "default", (cb) ->
gutil.log('Building BokehJS for developer mode ...')
runSequence("build", "install", "watch", cb)
|
Fix for deprecation of context menu | # See https://atom.io/docs/latest/creating-a-package#menus for more details
'context-menu':
'.overlayer':
'Git add file': 'git-plus:add'
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Git Plus'
'submenu': [
{ 'label': 'Add', 'command': 'git-plus:add' }
{ 'label': 'Ad... | # See https://atom.io/docs/latest/creating-a-package#menus for more details
'context-menu':
'atom-text-editor': [
{
'label': 'Git add file',
'command': 'git-plus:add'
}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Git Plus'
'submenu': [
{ 'label': 'Add'... |
Add support for CS@2 when looking up local CS | configManager = require '../config-manager'
resolve = require 'resolve'
path = require 'path'
getCompiler = (editor) ->
filepath = editor.getPath()
coffee = if filepath then maybeGetLocalCoffeescript(filepath)
if coffee? then return coffee
coffeescriptVersion = configManager.get('coffeescriptV... | configManager = require '../config-manager'
resolve = require 'resolve'
path = require 'path'
getCompiler = (editor) ->
filepath = editor.getPath()
coffee = if filepath then maybeGetLocalCoffeescript(filepath)
if coffee? then return coffee
coffeescriptVersion = configManager.get('coffeescriptV... |
Use helper methods instead of reading asyncStatus | # coffeelint: disable=no_empty_functions
_ = require 'underscore'
flux = require 'flux-react'
{CourseActions, CourseStore} = require './course'
LOADING = 'loading'
LOADED = 'loaded'
FAILED = 'failed'
CourseListingActions = flux.createActions [
'load'
'loaded'
'reset'
'FAILED'
]
CourseListingStore = flux.c... | # coffeelint: disable=no_empty_functions
_ = require 'underscore'
flux = require 'flux-react'
{CourseActions, CourseStore} = require './course'
LOADING = 'loading'
LOADED = 'loaded'
FAILED = 'failed'
CourseListingActions = flux.createActions [
'load'
'loaded'
'reset'
'FAILED'
]
CourseListingStore = flux.c... |
Revert "Fix test according to changes in smtp mailer." | mailer = null
describe "Salad.Mailer", ->
before ->
mailer = new App.WelcomeMailer
describe "#render", ->
it "should render templates", ->
content = mailer.render "rendering/test"
content.should.equal "<h1>Hello World!</h1>"
describe "#mail", ->
todo = null
beforeEach (done) ->
... | mailer = null
describe "Salad.Mailer", ->
before ->
mailer = new App.WelcomeMailer
describe "#render", ->
it "should render templates", ->
content = mailer.render "rendering/test"
content.should.equal "<h1>Hello World!</h1>"
describe "#mail", ->
todo = null
beforeEach (done) ->
... |
Use late binding to break circular dependency | AS = ORBEON.xforms.server.AjaxServer
Document = ORBEON.xforms.Document
Events = ORBEON.xforms.Events
# Returns a deferred object that gets resolved when the next Ajax response arrives
AS.nextAjaxResponse = (formId) ->
deferred = $.Deferred()
seqNo = -> parseInt Document.getFromClientState formId, 'sequence'
... | AS = -> ORBEON.xforms.server.AjaxServer
Document = -> ORBEON.xforms.Document
Events = -> ORBEON.xforms.Events
# Returns a deferred object that gets resolved when the next Ajax response arrives
AS().nextAjaxResponse = (formId) ->
deferred = $.Deferred()
seqNo = -> parseInt Document().getFromClientState ... |
Fix Crash in Storylet Resolution | class Storylet
constructor: (@id, @title, @text, @choices) ->
Object.freeze @
angular.module 'qbn.storylet', ['qbn.state']
.factory 'storylets', (makeGameState) ->
library = {}
api =
register: (args...) ->
storylet = new Storylet args...
library[storylet.id] = storylet # Storylets... | class Storylet
constructor: (@id, @title, @text, @choices) ->
Object.freeze @
angular.module 'qbn.storylet', ['qbn.state']
.factory 'storylets', (makeGameState) ->
library = {}
api =
register: (args...) ->
storylet = new Storylet args...
library[storylet.id] = storylet # Storylets... |
Reset milliseconds as well when resetting seconds | # Miscellanious date support code.
class DateSupport
@stripSeconds: (date) ->
date.setSeconds 0
date
module.exports = DateSupport
| # Miscellanious date support code.
class DateSupport
@stripSeconds: (date) ->
date.setSeconds 0
date.setMilliseconds 0
date
module.exports = DateSupport
|
Fix bug with missing fat arrow | define [
'settings'
'promise'
'helpers/browser_helper'
'helpers/url_helper'
], (Settings, Promise, BrowserHelper, URLHelper)->
unique_id = 1
class Reporter
constructor: (options)->
@base = Settings.url.base
@queue = []
@transport = 'img'
@_determineTransport().then @_enableProp... | define [
'settings'
'promise'
'helpers/browser_helper'
'helpers/url_helper'
], (Settings, Promise, BrowserHelper, URLHelper)->
unique_id = 1
class Reporter
constructor: (options)->
@base = Settings.url.base
@queue = []
@transport = 'img'
@_determineTransport().then @_enableProp... |
Fix incorrent enforcement of tabs to spaces conversion in typescript | "use strict"
Beautifier = require('./beautifier')
module.exports = class TypeScriptFormatter extends Beautifier
name: "TypeScript Formatter"
options: {
TypeScript: true
}
beautify: (text, language, options) ->
return new @Promise((resolve, reject) =>
try
format = require("typescript-for... | "use strict"
Beautifier = require('./beautifier')
module.exports = class TypeScriptFormatter extends Beautifier
name: "TypeScript Formatter"
options: {
TypeScript: true
}
beautify: (text, language, options) ->
return new @Promise((resolve, reject) =>
try
format = require("typescript-for... |
Rollback any data changes on cancel. | define ['lodash'], (L) -> Array '$scope', '$log', '$modal', (scope, log, modalFactory) ->
InputEditCtrl = Array '$scope', '$modalInstance', 'history', 'step', (scope, modal, history, step, index) ->
scope.data = L.clone step.data
delete scope.data.service # Not editable
scope.ok = -> modal.close histor... | define ['lodash'], (L) -> Array '$scope', '$log', '$modal', (scope, log, modalFactory) ->
InputEditCtrl = Array '$scope', '$modalInstance', 'history', 'step', (scope, modal, history, step, index) ->
scope.data = L.clone step.data, true
delete scope.data.service # Not editable
scope.ok = ->
modal.... |
Remove assumption and reference of global data | define [
'underscore'
'marionette'
'../core'
'../base'
'../concept'
'../context'
'tpl!templates/workflows/query.html'
], (_, Marionette, c, base, concept, context, templates...) ->
templates = _.object ['query'], templates
class QueryWorkflow extends Marionette.Layout
clas... | define [
'underscore'
'marionette'
'../core'
'../base'
'../concept'
'../context'
'tpl!templates/workflows/query.html'
], (_, Marionette, c, base, concept, context, templates...) ->
templates = _.object ['query'], templates
###
The QueryWorkflow provides an interface for navigat... |
Fix document ready with TurboLinks. | #= require jquery
#= require jquery_ujs
#= require turbolinks
#= require bootstrap
#= require_tree .
$(->
$('#job_date_type').change(->
switch $(@).val()
when 'agreement', ''
$('.job_start_date').slideUp()
$('.job_end_date').slideUp()
when 'date'
$('.job_start_date').slideDown... | #= require jquery
#= require jquery_ujs
#= require turbolinks
#= require bootstrap
#= require_tree .
ready = ->
$('#job_date_type').change(->
switch $(@).val()
when 'agreement', ''
$('.job_start_date').slideUp()
$('.job_end_date').slideUp()
when 'date'
$('.job_start_date').sli... |
Tweak behavior when running lines or selections. | {BufferedProcess} = require 'atom'
module.exports =
activate: ->
atom.workspaceView.command "execute-as-ruby:execute", => @execute()
execute: ->
# This assumes the active pane item is an editor
editor = atom.workspace.activePaneItem
cursor = editor.getCursor()
selection = editor.getSelectedTex... | {BufferedProcess} = require 'atom'
module.exports =
activate: ->
atom.workspaceView.command "execute-as-ruby:execute", => @execute()
execute: ->
# This assumes the active pane item is an editor
editor = atom.workspace.activePaneItem
cursor = editor.getCursor()
selection = editor.getSelectedTex... |
Add Object.assign from react if missing, transferPropsTo -> {...@props} | React = require 'react'
Button = require 'react-bootstrap/Button'
RouteToMixin = require './RouteToMixin'
ADDITIONAL_RESERVED_PROPS =
key: true
ref: true
ButtonLink = React.createClass
displayName: 'ButtonLink'
mixins: [ RouteToMixin ]
additionalReservedProps: ADDITIONAL_RESERVED_PROPS
render: ->
@tra... | React = require 'react'
Button = require 'react-bootstrap/Button'
RouteToMixin = require './RouteToMixin'
assign = require 'react/lib/Object.assign'
if ! Object.assign
Object.assign = assign;
ADDITIONAL_RESERVED_PROPS =
key: true
ref: true
ButtonLink = React.createClass
displayName: 'ButtonLink'
mixins: [ ... |
Use closest instead of parent() | class @Activities
constructor: ->
Pager.init 20, true
$(".event-filter a").bind "click", (event) =>
event.preventDefault()
@toggleFilter($(event.currentTarget))
@reloadActivities()
reloadActivities: ->
$(".content_list").html ''
Pager.init 20, true
toggleFilter: (sender) ->
... | class @Activities
constructor: ->
Pager.init 20, true
$(".event-filter a").bind "click", (event) =>
event.preventDefault()
@toggleFilter($(event.currentTarget))
@reloadActivities()
reloadActivities: ->
$(".content_list").html ''
Pager.init 20, true
toggleFilter: (sender) ->
... |
Save text-search condition if location.search exists | $ ->
saveTextSearchCondition = (selectTag) ->
cond =
selectedValue: selectTag.find(':selected').val()
query: $('input#q').val()
localStorage.setItem('textSearch', JSON.stringify(cond))
$('form').on "submit", (e) ->
e.preventDefault()
selectTag = $('select#category')
searchTarge... | $ ->
saveTextSearchCondition = ->
cond =
selectedValue: $('select#category').find(':selected').val()
query: $('input#q').val()
localStorage.setItem('textSearch', JSON.stringify(cond))
$('form').on "submit", (e) ->
e.preventDefault()
selectTag = $('select#category')
searchTarget... |
Add default grunt task for testing | module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-release'
grunt.loadNpmTasks 'grunt-exec'
grunt.loadNpmTasks 'grunt-gh-pages'
grunt.initConfig
release:
options:
bump: false
add: false
push: false
tagName: "v<%= version %>"
exec:
test:
command: "... | module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-release'
grunt.loadNpmTasks 'grunt-exec'
grunt.loadNpmTasks 'grunt-gh-pages'
grunt.initConfig
release:
options:
bump: false
add: false
push: false
tagName: "v<%= version %>"
exec:
test:
command: "... |
Simplify event handling using jquery | # 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/
$ ->
$('select#r').change(window.secondnav_goto)
$('select#r option').click(window.secondnav_goto)
$('... | # 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/
$ ->
$('select#r').change ->
window.location = $('select#r').val()
$('select#r2').change ->
wind... |
Fix adding new gists in firefox |
#editor = ace.edit("editor")
#editor.getSession().setMode("ace/mode/markdown")
jQuery ->
jQuery('.editor').ace({ theme: 'github', lang: 'markdown', width: '100%', indent: 2 })
jQuery('.editor-meta select').change event, ->
ace = jQuery(event.srcElement)
.closest('.editor-container')
.find('.editor... |
#editor = ace.edit("editor")
#editor.getSession().setMode("ace/mode/markdown")
jQuery ->
jQuery('.editor').ace({ theme: 'github', lang: 'markdown', width: '100%', indent: 2 })
jQuery('.editor-meta select').change (event) ->
ace = jQuery(event.srcElement)
.closest('.editor-container')
.find('.edito... |
Add World/Screen coordinate conversion utilities to SceneView class. |
class SceneView
constructor: (@canvas) ->
@id = _.uniqueId 'view'
throw new Error "A Canvas is required" if not @canvas
@context = @canvas.getContext("2d")
throw new Error "Could not retrieve Canvas context" if not @context
@camera = new Rect(0,0,100,100)
render: (object) ->
|
class SceneView
constructor: (@canvas) ->
@id = _.uniqueId 'view'
throw new Error "A Canvas is required" if not @canvas
@context = @canvas.getContext("2d")
throw new Error "Could not retrieve Canvas context" if not @context
@context.webkitImageSmoothingEnabled = false
@context.mozImageSmoothi... |
Use uic:domchange instead of document.ready | $ ->
margin_top = $('.navbar-fixed-top, .navbar-static-top').height()
$('table[data-toggle=sticky-header]').floatThead
useAbsolutePositioning: false
scrollingTop: margin_top
| $(document).on 'uic:domchange', ->
margin_top = $('.navbar-fixed-top, .navbar-static-top').height()
$('table[data-toggle=sticky-header]').floatThead
useAbsolutePositioning: false
scrollingTop: margin_top
|
Revert "Disable use_bl for /top request" | define [
"chaplin"
"models/posts"
"views/posts"
], (Chaplin, Posts, PostsView) ->
"use strict"
class PostsController extends Chaplin.Controller
show: (params) ->
# Unescape matched parts of url.
# Why the hell chaplin doesn't do it by himself?
# XXX: Seems like what we should use encod... | define [
"chaplin"
"models/posts"
"views/posts"
], (Chaplin, Posts, PostsView) ->
"use strict"
class PostsController extends Chaplin.Controller
show: (params) ->
# Unescape matched parts of url.
# Why the hell chaplin doesn't do it by himself?
# XXX: Seems like what we should use encod... |
Fix bug with returning wrong response in `findContent` | angular.module('Sprangular.StaticContent').service 'StaticContent', ($q, $http) ->
service =
findContent: (id) ->
$http.get "/api/pages/#{id}.json"
service
| angular.module('Sprangular.StaticContent').service 'StaticContent', ($q, $http) ->
service =
findContent: (id) ->
$http.get("/api/pages/#{id}.json")
.success (response) -> response.data
service
|
Fix issue with message to 'all' | Meteor.publish 'projects', ->
Projects.find {members: this.userId}
Meteor.publish 'projectMessages', (projectId) ->
check projectId, String
# Find all messages for the current project which have our user as sender or recipient
Messages.find {$and: [{$or: [{recipients: {$in: [this.userId]}}, {sender: th... | Meteor.publish 'projects', ->
Projects.find {members: this.userId}
Meteor.publish 'projectMessages', (projectId) ->
check projectId, String
# Find all messages for the current project which have our user as sender or recipient
Messages.find({$and: [{$or: [{recipients: {$in: [this.userId]}}, {recipients... |
Improve detecting @element in the DOM | class Trix.SelectionObserver
events = ["DOMFocusIn", "DOMFocusOut", "mousedown", "keydown"]
constructor: (@element) ->
@element.addEventListener(event, @start) for event in events
@range = getRange()
start: =>
return if @running
@running = true
requestAnimationFrame(@tick)
stop: ->
de... | class Trix.SelectionObserver
events = ["DOMFocusIn", "DOMFocusOut", "mousedown", "keydown"]
constructor: (@element) ->
@element.addEventListener(event, @start) for event in events
@range = getRange()
start: =>
return if @running
@running = true
requestAnimationFrame(@tick)
stop: ->
de... |
Remove unused gulp-util dependencies from error.coffee | # Error handling setup
# See: http://www.artandlogic.com/blog/2014/05/error-handling-in-gulp/
gutil = require 'gulp-util'
fatalLevel = require('yargs').argv.fatal
ERROR_LEVELS = ['error', 'warning']
module.exports =
# Convenience handlers to be used in gulp .on('error', callback)
onError: (error) -> handleE... | # Error handling setup
# See: http://www.artandlogic.com/blog/2014/05/error-handling-in-gulp/
fatalLevel = require('yargs').argv.fatal
ERROR_LEVELS = ['error', 'warning']
module.exports =
# Convenience handlers to be used in gulp .on('error', callback)
onError: (error) -> handleError.call(this, 'error', error)
... |
Replace student dashboard redirect with delay page | React = require 'react'
{CourseStore} = require '../../flux/course'
{StudentDashboardStore, StudentDashboardActions} = require '../../flux/student-dashboard'
LoadableItem = require '../loadable-item'
isStepComplete = (step) -> step.is_completed
StudentDashboard = require './dashboard'
WindowHelpers = require '../../hel... | React = require 'react'
{CourseStore} = require '../../flux/course'
{StudentDashboardStore, StudentDashboardActions} = require '../../flux/student-dashboard'
LoadableItem = require '../loadable-item'
isStepComplete = (step) -> step.is_completed
StudentDashboard = require './dashboard'
WindowHelpers = require '../../hel... |
Fix cursor issues around images | #= require trix/views/attachment_view
#= require trix/utilities/dom
#= require trix/utilities/helpers
{defer} = Trix.Helpers
class Trix.ImageAttachmentView extends Trix.AttachmentView
render: ->
@image = document.createElement("img")
@image.setAttribute("contenteditable", false)
@image.setAttribute("dat... | #= require trix/views/attachment_view
#= require trix/utilities/dom
#= require trix/utilities/helpers
{defer} = Trix.Helpers
class Trix.ImageAttachmentView extends Trix.AttachmentView
render: ->
@image = document.createElement("img")
@image.setAttribute("data-trix-identifier", @attachmentPiece.getIdentifier... |
Use existential operator to check if row was found | #query = require("pg-query")
#oreList = query("select itemName from Ore order by itemName", (err, rows, result) ->
# alert rows )
#alert oreList
#alert "3333"
refiningTable = null
refineMe = []
#accepts optional array of values as 2nd parameter for parameterized queries
AddNewRefiningElement = ->
Quantity = pa... | #query = require("pg-query")
#oreList = query("select itemName from Ore order by itemName", (err, rows, result) ->
# alert rows )
#alert oreList
#alert "3333"
refiningTable = null
refineMe = []
#accepts optional array of values as 2nd parameter for parameterized queries
AddNewRefiningElement = ->
Quantity = pa... |
Fix errors when files don’t exist. | # Installs/updates latest version of the Tâmia Stylus framework.
# Also installs jQuery.
# https://github.com/sapegin/tamia
'use strict'
fs = require 'fs'
util = require 'util'
path = require 'path'
base = require '../base'
module.exports = class Generator extends base
Generator::checkUpdate = ->
@update = fs.exis... | # Installs/updates latest version of the Tâmia Stylus framework.
# Also installs jQuery.
# https://github.com/sapegin/tamia
'use strict'
fs = require 'fs'
util = require 'util'
path = require 'path'
base = require '../base'
module.exports = class Generator extends base
Generator::checkUpdate = ->
@update = fs.exis... |
Fix bug when voting where local had been mis-named | $(".polls").fadeOut 500, ->
$(".polls[data-id='<%= @poll.id %>']").replaceWith("<%= escape_javascript(render :partial => "polls/poll", :locals => {:previous_poll => @poll}) %>")
$(".polls").show()
| $(".polls").fadeOut 500, ->
$(".polls[data-id='<%= @poll.id %>']").replaceWith("<%= escape_javascript(render :partial => "polls/poll", :locals => {:last_completed_poll => @poll}) %>")
$(".polls").show()
|
Replace composition of PulsarApiRest with inheritance from RestlerService. | restler = require('restler')
class PulsarApiRest
constructor: (url, token) ->
restService = restler.service((url, token) ->
if token
@defaults.username = token
@defaults.password = 'x-oauth-basic'
return
,
baseURL: url
)
return new restService(url, token)
module.ex... | RestlerService = require('restler').Service
class PulsarApiRest extends RestlerService
constructor: (url, token) ->
defaults = {}
defaults.baseURL = url
if token
defaults.username = token
defaults.password = 'x-oauth-basic'
super(defaults)
module.exports = PulsarApiRest
|
Enable / disable clear filter button. | FilterCtrl = ($scope) ->
$scope.clear = ->
@value = null
angular.module('MongoBrowser', [])
# Handles ESC key
.directive 'onEsc', ->
(scope, element, attrs) ->
element.bind 'keyup', (event) ->
EscapeCode = 27
return unless event.keyCode is EscapeCode
scope.$apply(attrs.onEsc... | FilterCtrl = ($scope) ->
$scope.value = ""
$scope.clear = ->
@value = ""
angular.module('MongoBrowser', [])
# Handles ESC key
.directive 'onEsc', ->
(scope, element, attrs) ->
element.bind 'keyup', (event) ->
EscapeCode = 27
return unless event.keyCode is EscapeCode
scope.... |
Fix actual auction/sale interface display | module.exports = """
fragment auction on Artwork {
is_acquireable
is_in_auction
auction: sale {
id
name
is_open
is_preview
is_closed
is_auction
is_auction_promo
is_with_buyers_premium
sale_artwork(id: $id) {
id
reserve_message
e... | module.exports = """
fragment auction on Artwork {
is_acquireable
is_in_auction
sale {
id
name
is_open
is_preview
is_closed
is_auction
is_auction_promo
is_with_buyers_premium
sale_artwork(id: $id) {
id
reserve_message
estimate
... |
Make other tests more consistent. | {BattleQueue} = require '../server/queue'
describe 'BattleQueue', ->
it 'should be empty by default', ->
new BattleQueue().queue.should.be.empty
describe '#add', ->
it 'queues a new player', ->
queue = new BattleQueue()
queue.add({})
queue.queue.should.have.length 1
describe '#remove'... | {BattleQueue} = require '../server/queue'
describe 'BattleQueue', ->
it 'should be empty by default', ->
new BattleQueue().queue.should.be.empty
describe '#add', ->
it 'queues a new player', ->
queue = new BattleQueue()
queue.add({})
queue.queue.should.have.length 1
describe '#remove'... |
Revert "and another quick fix, my bad this time -.-" | # 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/
# Tooltips for Contract Balance
$ ->
$('.contracts').on('mouseenter', 'a[data-toggle=tooltip]', ->
$(t... | # 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/
# Tooltips for Contract Balance
$ ->
$('.contracts').on('mouseenter', 'a[data-toggle=tooltip]', ->
$(t... |
Add context menu on the tree-view to toggle the Finder. | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
'context-menu':
'atom-text-editor': [
{
'label': 'Toggle tree-view-finder'
'command': 'tree-view-finder:toggle'
}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'tree-view-finder'
... | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
'context-menu':
'.tree-view': [
{
'label': 'Toggle tree-view-finder'
'command': 'tree-view-finder:toggle'
}
{'type': 'separator'}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': '... |
Add snippet for inserting hashbangs | ".source.apl":
Function:
prefix: "fn"
body: "∇${2:R ←} ${3:X} ${1:NAME} ${4:Y}\n\t$0\n∇"
Operator:
prefix: "op"
body: "∇${2:R ←} ${3:X} (${4:LOP} ${1:NAME} ${5:ROP}) ${6:Y}\n\t$0\n∇"
Assignment:
prefix: "a"
body: "${1:⎕ }← ${2:VALUE}"
# GNU APL extensions
"GNU Heredoc: Plain":
prefix:... | ".source.apl":
Function:
prefix: "fn"
body: "∇${2:R ←} ${3:X} ${1:NAME} ${4:Y}\n\t$0\n∇"
Operator:
prefix: "op"
body: "∇${2:R ←} ${3:X} (${4:LOP} ${1:NAME} ${5:ROP}) ${6:Y}\n\t$0\n∇"
Assignment:
prefix: "a"
body: "${1:⎕ }← ${2:VALUE}"
Hashbang:
prefix: "#"
body: "#!/usr/${3:local/bin/a... |
Change text to refer to stations | #= require underscore
strings =
loading: "Loading…"
noData: "No data"
logger:
title: "Workbench Logger"
"api-endpoint": "API Endpoint"
metadata:
title: "Sensor Metadata"
name: "Sensor Name"
description: "Sensor Description"
datastreams: "Datastreams"
owner: "Owner"
contact: "O... | #= require underscore
strings =
loading: "Loading…"
noData: "No data"
logger:
title: "Workbench Logger"
"api-endpoint": "API Endpoint"
metadata:
title: "Sensor Metadata"
name: "Sensor Name"
description: "Sensor Description"
datastreams: "Datastreams"
owner: "Owner"
contact: "O... |
Add "default" task for grunt | module.exports = (grunt) ->
PATHS =
"Windows_NT" : "bin\\nw.exe\\nw.exe"
"Darwin" : "bin/node-webkit.app/Contents/MacOS/node-webkit"
os = require("os")
path = require("path")
spawn = require("child_process").spawn
debug = ->
DS = path.sep
bi... | module.exports = (grunt) ->
PATHS =
"Windows_NT" : "bin\\nw.exe\\nw.exe"
"Darwin" : "bin/node-webkit.app/Contents/MacOS/node-webkit"
os = require("os")
path = require("path")
spawn = require("child_process").spawn
debug = ->
DS = path.sep
bi... |
Fix typo that used the wrong function to reset the buffer range | isCurrentLineEmpty = (editor) ->
# save the current buffer range, so that we can
# reset the state in the end
bufferRange = editor.getSelectedBufferRange()
editor.moveToBeginningOfLine()
editor.selectToEndOfLine()
selectedText = editor.getSelectedText()
# reset the selection to what it was before callin... | isCurrentLineEmpty = (editor) ->
# save the current buffer range, so that we can
# reset the state in the end
bufferRange = editor.getSelectedBufferRange()
editor.moveToBeginningOfLine()
editor.selectToEndOfLine()
selectedText = editor.getSelectedText()
# reset the selection to what it was before callin... |
Update to new fbp-spec multi-suite format | noflo = require 'noflo'
fbpSpec = require 'fbp-spec'
exports.getComponent = ->
c = new noflo.Component
c.inPorts.add 'in',
datatype: 'object'
description: 'Project'
c.inPorts.add 'runtime',
datatype: 'object'
required: yes
c.outPorts.add 'context',
datatype: 'object'
c.outPorts.add 'error... | noflo = require 'noflo'
fbpSpec = require 'fbp-spec'
exports.getComponent = ->
c = new noflo.Component
c.inPorts.add 'in',
datatype: 'object'
description: 'Project'
c.inPorts.add 'runtime',
datatype: 'object'
required: yes
c.outPorts.add 'context',
datatype: 'object'
c.outPorts.add 'error... |
Remove mini class to give id enough room | {View} = require 'space-pen'
Editor = require 'editor'
$ = require 'jquery'
Point = require 'point'
_ = require 'underscore'
module.exports =
class Prompt extends View
@activate: -> new Prompt
@content: ->
@div class: 'overlay from-top mini', =>
@subview 'miniEditor', new Editor(mini: true)
@div c... | {View} = require 'space-pen'
Editor = require 'editor'
$ = require 'jquery'
Point = require 'point'
_ = require 'underscore'
module.exports =
class Prompt extends View
@activate: -> new Prompt
@content: ->
@div class: 'overlay from-top', =>
@subview 'miniEditor', new Editor(mini: true)
@div class:... |
Remove unused ConceptSearch subclass for ConceptPanel | define [
'../core'
'./index'
'./search'
'tpl!templates/concept/panel.html'
], (c, index, search, templates...) ->
templates = c._.object ['panel'], templates
class ConceptSearch extends search.ConceptSearch
events:
'typeahead:autocompleted input': 'autocomplete'
a... | define [
'../core'
'./index'
'./search'
'tpl!templates/concept/panel.html'
], (c, index, search, templates...) ->
templates = c._.object ['panel'], templates
# Takes a collection of c.models.ConceptModel objects
class ConceptPanel extends c.Marionette.Layout
className: 'concept-pa... |
Reset scroll position to top of window when navigating to new view | TentAdmin.Routers.main = new class MainRouter extends Marbles.Router
routes: {
"" : "root"
"profile" : "profile"
"apps" : "apps"
}
root: =>
@navigate('/profile', { replace: true, trigger: true })
profile: =>
new Marbles.Views.Profile container: TentAdmin.config.container
apps:... | TentAdmin.Routers.main = new class MainRouter extends Marbles.Router
routes: {
"" : "root"
"profile" : "profile"
"apps" : "apps"
}
root: =>
@navigate('/profile', { replace: true, trigger: true })
profile: =>
window.scrollTo(0, 0)
new Marbles.Views.Profile container: TentAdmin... |
Work on RequireJS Jasmine test. | 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... | 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... |
Use subscribe instead of on | {View} = require 'space-pen'
$ = require 'jquery'
Git = require 'git'
fs = require 'fs'
module.exports =
class FileView extends View
@content: ({file} = {}) ->
@li class: 'file entry', =>
@span file.getBaseName(), class: 'name', outlet: 'fileName'
@span '', class: 'highlight'
file: null
initia... | {View} = require 'space-pen'
$ = require 'jquery'
Git = require 'git'
fs = require 'fs'
module.exports =
class FileView extends View
@content: ({file} = {}) ->
@li class: 'file entry', =>
@span file.getBaseName(), class: 'name', outlet: 'fileName'
@span '', class: 'highlight'
file: null
initia... |
Add jquery_ui/mouse to jqrangeslider's dependencies | require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handso... | require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handso... |
Set in-async to null instead of undefined, As it didn't trigger property changes properly. | `import {ArrayProxy, run} from 'ember';`
`import Modal from './modal'`
###*
# A flavour of a {{#crossLink "Modal}}Modal{{/crossLink}} that handles form submission right.
# @class ModalForm
###
ModalForm = Modal.extend
tagName: 'form'
attributeBindings: ['in-async']
'in-async': undefined
'close-if-err... | `import {ArrayProxy, run} from 'ember';`
`import Modal from './modal'`
###*
# A flavour of a {{#crossLink "Modal}}Modal{{/crossLink}} that handles form submission right.
# @class ModalForm
###
ModalForm = Modal.extend
tagName: 'form'
attributeBindings: ['in-async']
'in-async': null
'close-if-error': ... |
Add whitespace for test readability | should = require 'should'
bus = require '../lib/bus'
log = require '../lib/core/log'
tests = [
topic: 'debug'
data: 'hello, debug'
,
topic: 'error'
data: 'hello, error'
,
topic: 'info'
data: 'hello, info'
]
describe 'log', ->
for test in tests
do (test) ->
it "should log on #{test.topic}", ... | should = require 'should'
bus = require '../lib/bus'
log = require '../lib/core/log'
tests = [
topic: 'debug'
data: 'hello, debug'
,
topic: 'error'
data: 'hello, error'
,
topic: 'info'
data: 'hello, info'
]
describe 'log', ->
for test in tests
do (test) ->
it "should log on #{test.topic}", ... |
Delete overlay node from hash before removing | module.exports =
class OverlayManager
constructor: (@container) ->
@overlayNodesById = {}
render: (presenter) ->
for decorationId, {pixelPosition, item} of presenter.state.content.overlays
@renderOverlay(presenter, decorationId, item, pixelPosition)
for id, overlayNode of @overlayNodesById
... | module.exports =
class OverlayManager
constructor: (@container) ->
@overlayNodesById = {}
render: (presenter) ->
for decorationId, {pixelPosition, item} of presenter.state.content.overlays
@renderOverlay(presenter, decorationId, item, pixelPosition)
for id, overlayNode of @overlayNodesById
... |
Set Push.enabled and set push sendInterval to 1000ms and sendBatchSize to 10 | Meteor.methods
log: ->
console.log.apply console, arguments
Meteor.startup ->
Push.debug = RocketChat.settings.get 'Push_debug'
if RocketChat.settings.get('Push_enable') is true
Push.allow
send: (userId, notification) ->
return Meteor.users.findOne({_id: userId})?.admin is true
Push.Configure
apn... | Meteor.methods
log: ->
console.log.apply console, arguments
Meteor.startup ->
Push.debug = RocketChat.settings.get 'Push_debug'
if RocketChat.settings.get('Push_enable') is true
Push.enabled = true
Push.allow
send: (userId, notification) ->
return Meteor.users.findOne({_id: userId})?.admin is true
... |
Allow our alert id to be in milliseconds as it lowers the chance of duplicates | class Flash
add: (message, type) ->
alertId = Math.floor(Date.now() / 1000);
$('body').prepend(
'<div class="alert alert-' + type + ' alert-dismissible notification" role="alert" data-alert-id="' + alertId + '">' +
' <div class="container">' +
' <button type="button" class="close" ... | class Flash
add: (message, type) ->
alertId = Date.now();
$('body').prepend(
'<div class="alert alert-' + type + ' alert-dismissible notification" role="alert" data-alert-id="' + alertId + '">' +
' <div class="container">' +
' <button type="button" class="close" data-dismiss="alert... |
Raise test timeout to 120 seconds | module.exports = (grunt) ->
grunt.initConfig
clean:
package: ['tasks/gyp.js']
test: ['test/support/build']
coffee:
task:
options:
bare: true
files:
'tasks/gyp.js': 'tasks/gyp.coffee'
mochacli:
options:
bail: true
compilers: ['coffee:coffee-script/register']
# Compiling t... | module.exports = (grunt) ->
grunt.initConfig
clean:
package: ['tasks/gyp.js']
test: ['test/support/build']
coffee:
task:
options:
bare: true
files:
'tasks/gyp.js': 'tasks/gyp.coffee'
mochacli:
options:
bail: true
compilers: ['coffee:coffee-script/register']
# Compiling t... |
Fix grunt test task to first compile files | module.exports = (grunt) ->
'use strict'
# Project configuration.
grunt.initConfig
watch:
coffee:
tasks: ['coffee:compile']
files: [
'spec/*.coffee'
]
buildRunner:
tasks: ['jasmine:src:build... | module.exports = (grunt) ->
'use strict'
# Project configuration.
grunt.initConfig
watch:
coffee:
tasks: ['coffee:compile']
files: [
'spec/*.coffee'
]
buildRunner:
tasks: ['jasmine:src:build... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.