Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Document hidden feature to switch between javascript and coffeescript. | Command = require('../command')
Range = require('../range')
Compiler = require('../compiler')
class Xecute extends Command
name: ''
last_error: null
args: new Range(1, Infinity)
constructor: ->
super
@compiler = new Compiler({@scope})
execute: (input, chain) ->
return @switch_mode(chain) if ... | Command = require('../command')
Range = require('../range')
Compiler = require('../compiler')
class Xecute extends Command
name: 'mode'
definition: 'Switched between CoffeeScript and JavaScript execution.'
help: 'Type `mode` to switch between using JavaScript or CoffeeScript.'
last_error: null
args: new R... |
Update SearchSubscription to support basic multiaccount search... seems to work? | _ = require 'underscore'
Rx = require 'rx-lite'
NylasAPI = require './flux/nylas-api'
DatabaseStore = require './flux/stores/database-store'
Thread = require './flux/models/thread'
MutableQuerySubscription = require './flux/models/mutable-query-subscription'
class SearchSubscription extends MutableQuerySubscription
... | _ = require 'underscore'
Rx = require 'rx-lite'
NylasAPI = require './flux/nylas-api'
DatabaseStore = require './flux/stores/database-store'
Thread = require './flux/models/thread'
MutableQuerySubscription = require './flux/models/mutable-query-subscription'
class SearchSubscription extends MutableQuerySubscription
... |
Remove ng-resource include (keep the bower component for now) | #= require es5-shim/es5-shim.js
#= require spin.js/dist/spin
#= require jquery/jquery
#= require angular/angular
#= require angular-bootstrap/ui-bootstrap-tpls
#= require angular-bootstrap-colorpicker/js/bootstrap-colorpicker-module
#= require angular-file-upload/angular-file-upload
#= require angular-resource/angular-... | #= require es5-shim/es5-shim.js
#= require spin.js/dist/spin
#= require jquery/jquery
#= require angular/angular
#= require angular-bootstrap/ui-bootstrap-tpls
#= require angular-bootstrap-colorpicker/js/bootstrap-colorpicker-module
#= require angular-file-upload/angular-file-upload
#= require angularjs-rails-resource/... |
Fix FastClick for webpack compatibility | $ = require('jquery')
attachFastClick = require('fastclick')
app = require('./app')
$ ->
app.start()
attachFastClick(document.body)
# Stretch main container height so it's not resized when the viewport is
# resized. This happens on Android when the keyboard pops up.
setTimeout ->
... | $ = require('jquery')
FastClick = require('fastclick')
app = require('./app')
$ ->
app.start()
FastClick.attach(document.body)
# Stretch main container height so it's not resized when the viewport is
# resized. This happens on Android when the keyboard pops up.
setTimeout ->
... |
Drop the minimum Serrano version to >= 2.0.18 | define [
'./cilantro/core'
'./cilantro/changelog'
'./cilantro/models'
'./cilantro/structs'
'./cilantro/ui'
], (c, changelog, models, structs, ui) ->
c.changelog = changelog
c.models = models
c.structs = structs
c.ui = ui
# Defines the minimum version of Serrano that this versio... | define [
'./cilantro/core'
'./cilantro/changelog'
'./cilantro/models'
'./cilantro/structs'
'./cilantro/ui'
], (c, changelog, models, structs, ui) ->
c.changelog = changelog
c.models = models
c.structs = structs
c.ui = ui
# Defines the minimum version of Serrano that this versio... |
Return book instead of ecosystem | _ = require 'underscore'
flux = require 'flux-react'
LOADING = 'loading'
FAILED = 'failed'
EcosystemsActions = flux.createActions [
'load'
'loaded'
'FAILED'
]
EcosystemsStore = flux.createStore
actions: _.values(EcosystemsActions)
_asyncStatus: null
load: -> # Used by API
@_asyncStatus = LOADING
... | _ = require 'underscore'
flux = require 'flux-react'
LOADING = 'loading'
FAILED = 'failed'
EcosystemsActions = flux.createActions [
'load'
'loaded'
'FAILED'
]
EcosystemsStore = flux.createStore
actions: _.values(EcosystemsActions)
_asyncStatus: null
load: -> # Used by API
@_asyncStatus = LOADING
... |
Use property instead of non-existent method in OverlayManager | module.exports =
class OverlayManager
constructor: (@container) ->
@overlayNodesById = {}
render: (props) ->
{presenter} = props
for decorationId, {pixelPosition, item} of presenter.state.content.overlays
@renderOverlay(presenter, decorationId, item, pixelPosition)
for id, overlayNode of @o... | module.exports =
class OverlayManager
constructor: (@container) ->
@overlayNodesById = {}
render: (props) ->
{presenter} = props
for decorationId, {pixelPosition, item} of presenter.state.content.overlays
@renderOverlay(presenter, decorationId, item, pixelPosition)
for id, overlayNode of @o... |
Move all the JS under one .ready() call. Not sure if correct. | # Toggle the administration system.
($ document).keypress (e) ->
($ '.administration').toggleClass 'visible' if (e.keyCode || e.which) == 96
# "Hero" image fade-in.
window.onload = ->
($ '.hero-image img').animate({opacity: 1}, 300)
# Search field highlighting.
($ document).ready ->
($ '#id_q').focus ->
($ ... | # Toggle the administration system.
($ document).keypress (e) ->
($ '.administration').toggleClass 'visible' if (e.keyCode || e.which) == 96
# "Hero" image fade-in.
window.onload = ->
($ '.hero-image img').animate({opacity: 1}, 300)
($ document).ready ->
# Search field highlighting.
($ '#id_q').focus ->
(... |
Remove evidence when it is removed from an underlying collection | class window.EvidenceCollection extends Backbone.Factlink.Collection
initialize: (models, options) ->
@fact = options.fact
@_supportingCollection = new OneSidedEvidenceCollection null, fact: @fact, type: 'supporting'
@_weakeningCollection = new OneSidedEvidenceCollection null, fact: @fact, type: 'weaken... | class window.EvidenceCollection extends Backbone.Factlink.Collection
initialize: (models, options) ->
@fact = options.fact
@_supportingCollection = new OneSidedEvidenceCollection null, fact: @fact, type: 'supporting'
@_weakeningCollection = new OneSidedEvidenceCollection null, fact: @fact, type: 'weaken... |
Fix line numbering of source files | #= require data/ViewData.coffee
#= require gui/GuiBase.coffee
class SourceFileMarkup extends GuiBase
constructor: (@filename, @id, @uri, @sourceFile) ->
@formatted_code = null
@element = $("<li>#{@filename}</li>", id: @id)
super()
# Create HTML code to represent a source file
getFormattedCode: ->
... | #= require data/ViewData.coffee
#= require gui/GuiBase.coffee
class SourceFileMarkup extends GuiBase
constructor: (@filename, @id, @uri, @sourceFile) ->
@formatted_code = null
@element = $("<li>#{@filename}</li>", id: @id)
super()
# Create HTML code to represent a source file
getFormattedCode: ->
... |
Use ISO8601 format for timestamps | Handlebars.registerHelper "selected", (selected) ->
return if selected then "checked" else ""
Handlebars.registerHelper "truncate", (text, length) ->
truncated = text.substring(0, length)
if text.length > length
truncated = truncated + "..."
return truncated
Handlebars.registerHelper "strip", (text) ->
... | Handlebars.registerHelper "selected", (selected) ->
return if selected then "checked" else ""
Handlebars.registerHelper "truncate", (text, length) ->
truncated = text.substring(0, length)
if text.length > length
truncated = truncated + "..."
return truncated
Handlebars.registerHelper "strip", (text) ->
... |
Add a standard authorization response | @mockEventStreamResponse = ->
@server.respondWith 'GET', '/event_stream', [
400
'Content-Type': 'application/json'
JSON.stringify {}
]
@mockAuthorizedRouteReponse = ->
@server.respondWith 'GET', '/admin/journals', [
403
'Tahi-Authorization-Check': 'true'
JSON.stringify {}
]
# papers/... | @mockEventStreamResponse = ->
@server.respondWith 'GET', '/event_stream', [
400
'Content-Type': 'application/json'
JSON.stringify {}
]
@mockAuthorizedRouteReponse = ->
@server.respondWith 'GET', '/admin/journals/authorization', [
204
'Tahi-Authorization-Check': 'true'
'Content-Type': 'app... |
Document fetch-mock issue workarounds so we can remove them later | _ = require('lodash')
Promise = require('bluebird')
IS_BROWSER = window?
if (IS_BROWSER)
# The browser mock assumes global fetch prototypes exist
realFetchModule = require('fetch-ponyfill')({ Promise })
global.Promise = Promise
global.Headers = realFetchModule.Headers
global.Request = realFetchModule.Request
gl... | _ = require('lodash')
Promise = require('bluebird')
IS_BROWSER = window?
if (IS_BROWSER)
# The browser mock assumes global fetch prototypes exist
# Can improve after https://github.com/wheresrhys/fetch-mock/issues/158
realFetchModule = require('fetch-ponyfill')({ Promise })
global.Headers = realFetchModule.Header... |
Use fadeTo instead of css | class @CommitsList
@timer = null
@init: (ref, limit) ->
$("body").on "click", ".day-commits-table li.commit", (event) ->
if event.target.nodeName != "A"
location.href = $(this).attr("url")
e.stopPropagation()
return false
Pager.init limit, false
@content = $("#commits-li... | class @CommitsList
@timer = null
@init: (ref, limit) ->
$("body").on "click", ".day-commits-table li.commit", (event) ->
if event.target.nodeName != "A"
location.href = $(this).attr("url")
e.stopPropagation()
return false
Pager.init limit, false
@content = $("#commits-li... |
Allow for a plurality of ass. | # Description:
# Taunt dat ass
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# butt name
#
# Author:
# sshirokov
insult = [
(opt) -> "#{opt.name} has a big butt.",
(opt) -> "And their big butt smells.",
(opt) -> "#{opt.name} likes to smell their big butt."
]
module.exports = (robot) ... | # Description:
# Taunt dat ass
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# butt name
#
# Author:
# sshirokov
insult = [
(opt) -> "#{opt.name} has a big butt.",
(opt) -> "And their big butt smells.",
(opt) -> "#{opt.name} likes to smell their big butt."
]
module.exports = (robot) ... |
Add Emmet plugin to Atom. | packages: [
"atom-beautify"
"atom-ide-ui"
"atom-python-virtualenv"
"autocomplete-python"
"autocomplete-robot-framework"
"build-gradle"
"busy-signal"
"editorconfig"
"file-icons"
"highlight-selected"
"hyperclick"
"hyperclick-robot-framework"
"ide-flowtype"
"ide-java"
"ide-php"
"ide-python"... | packages: [
"atom-beautify"
"atom-ide-ui"
"atom-python-virtualenv"
"autocomplete-python"
"autocomplete-robot-framework"
"build-gradle"
"busy-signal"
"editorconfig"
"emmet"
"file-icons"
"highlight-selected"
"hyperclick"
"hyperclick-robot-framework"
"ide-flowtype"
"ide-java"
"ide-php"
"i... |
Fix tests that'd give false positives | humanizeDuration = require ".."
assert = require "assert"
fs = require "fs"
path = require "path"
parseCSV = require "csv-parse"
options = (language) ->
return {
language: language
delimiter: "+"
units: [
"year"
"month"
"week"
"day"
"hour"
"minute"
"second"
... | humanizeDuration = require ".."
assert = require "assert"
fs = require "fs"
path = require "path"
parseCSV = require "csv-parse"
options = (language) ->
return {
language: language
delimiter: "+"
units: [
"year"
"month"
"week"
"day"
"hour"
"minute"
"second"
... |
Add code to enable native menu and fix copy-n-paste | _ = require "underscore"
$ = require "jquery"
net = require "net"
{AppDispatcher} = require "./dispatchers"
setupGlobals = (g, win) ->
g = _.extend g,
window: win.window
document: win.window.document
navigator: win.window.navigator
configureReload = (document) ->
client = net.connect {port: 35729}, ->... | _ = require "underscore"
$ = require "jquery"
net = require "net"
{AppDispatcher} = require "./dispatchers"
setupGlobals = (g, win) ->
g = _.extend g,
window: win.window
document: win.window.document
navigator: win.window.navigator
configureReload = (document) ->
client = net.connect {port: 35729}, ->... |
Use angular locale for credit card months | Sprangular.directive 'creditCardForm', ->
restrict: 'E'
templateUrl: 'credit_cards/form.html'
scope:
creditCard: '='
controller: ($scope) ->
$scope.months = [
{index: 1, name: 'January'},
{index: 2, name: 'February'},
{index: 3, name: 'March'},
{index: 4, name: 'April'},
{i... | Sprangular.directive 'creditCardForm', ->
restrict: 'E'
templateUrl: 'credit_cards/form.html'
scope:
creditCard: '='
controller: ($scope, $locale) ->
$scope.months = _.map $locale.DATETIME_FORMATS.MONTH, (month, index) ->
{"index": index, "name": month}
currentYear = (new Date).getFullYear()
... |
Add human readable file size in progress | {registerOrUpdateElement, SpacePenDSL} = require 'atom-utils'
module.exports =
class CSVProgressElement extends HTMLElement
SpacePenDSL.includeInto(this)
@content: ->
@div class: 'wrapper', =>
@label class: 'bytes', outlet: 'bytesLabel', '---'
@label class: 'lines', outlet: 'linesLabel', '---'
... | {registerOrUpdateElement, SpacePenDSL} = require 'atom-utils'
byteUnits = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
module.exports =
class CSVProgressElement extends HTMLElement
SpacePenDSL.includeInto(this)
@content: ->
@div class: 'wrapper', =>
@label class: 'bytes', outlet: 'bytesLabel',... |
Change header sooner on homepage | nav = document.querySelectorAll('header.page-header')[0]
window.onscroll = ->
if window.pageYOffset > 400
nav.classList.add 'start'
else
nav.classList.remove 'start'
return
| nav = document.querySelectorAll('header.page-header')[0]
window.onscroll = ->
if window.pageYOffset > 150
nav.classList.add 'start'
else
nav.classList.remove 'start'
return
|
Use spec test reporter, so we can debug with output | path = require('path')
gulp = require('gulp')
coffee = require('gulp-coffee')
inlinesource = require('gulp-inline-source')
mocha = require('gulp-mocha')
shell = require('gulp-shell')
packageJSON = require('./package.json')
OPTIONS =
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
app: 'lib/**/*.coffee'
... | path = require('path')
gulp = require('gulp')
coffee = require('gulp-coffee')
inlinesource = require('gulp-inline-source')
mocha = require('gulp-mocha')
shell = require('gulp-shell')
packageJSON = require('./package.json')
OPTIONS =
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
app: 'lib/**/*.coffee'
... |
Add support for anchors in the browser impl | 'use strict'
[utils, Model] = ['utils', 'model'].map require
exports.Request = require('./request.coffee')()
exports.Response = require('./response.coffee')()
exports.init = ->
uri = location.pathname
uid = utils.uid()
res = @onRequest
uid: uid
method: @constructor.GET
uri: uri.slice 1
data: null
expo... | 'use strict'
[utils, Model] = ['utils', 'model'].map require
exports.Request = require('./request.coffee')()
exports.Response = require('./response.coffee')()
exports.init = ->
# Send internal request to change the page based on the URI
changePage = (uri) =>
# change browser URI in the history
history.pushSt... |
Set 'name' on editor view based on field key | module.exports =
build: (options) =>
field = options.field
fieldClass = require "./#{field.get 'as'}"
new fieldClass
controller: options.controller
presenter: field
fieldStyle: options.fieldStyle
| module.exports =
build: (options) =>
field = options.field
fieldClass = require "./#{field.get 'as'}"
new fieldClass
controller: options.controller
presenter: field
name: field.get 'key'
fieldStyle: options.fieldStyle
|
Use mainController's feature check to enable video | checkFlag = require './checkFlag'
module.exports = isVideoFeatureEnabled = ->
return yes
# for now we are only allowing super-admins to start video chat.
# After we release it publicly, we only need to change the logic here. ~Umut
# checkFlag 'super-admin'
| kd = require 'kd'
module.exports = isVideoFeatureEnabled = ->
not kd.singletons.mainController.isFeatureDisabled 'video-collaboration'
|
Change API host to zooniverse.org | DEFAULT_ENV = 'staging'
API_HOSTS =
production: 'https://panoptes.zooniverse.org'
staging: 'https://panoptes-staging.zooniverse.org'
API_APPLICATION_IDS =
production: 'f79cf5ea821bb161d8cbb52d061ab9a2321d7cb169007003af66b43f7b79ce2a'
staging: '535759b966935c297be11913acee7a9ca17c025f9f15520e7504728e71110a27'
... | DEFAULT_ENV = 'staging'
API_HOSTS =
production: 'https://www.zooniverse.org'
staging: 'https://panoptes-staging.zooniverse.org'
API_APPLICATION_IDS =
production: 'f79cf5ea821bb161d8cbb52d061ab9a2321d7cb169007003af66b43f7b79ce2a'
staging: '535759b966935c297be11913acee7a9ca17c025f9f15520e7504728e71110a27'
host... |
Make text carousel pick up where it left off | class Dashing.Textcarousel extends Dashing.Widget
ready: ->
@currentIndex = 0
@textElem = $(@node).find('p')
@nextComment()
@startCarousel()
onData: (data) ->
@currentIndex = 0
startCarousel: ->
setInterval(@nextComment, 8000)
nextComment: =>
texts = @get('texts')
if texts
... | class Dashing.Textcarousel extends Dashing.Widget
ready: ->
@currentIndex = 0
@textElem = $(@node).find('p')
@nextComment()
@startCarousel()
onData: (data) ->
# attempt to pick up where we left off, but default to starting over
@currentIndex = Math.max(0, @get('texts').indexOf(@get('curren... |
Add support for bigint and character varying | class PgHoffTypes
@Type:
1184:
name: 'Timestamp'
format: (value) ->
return new Date(value).toLocaleString(atom.config.get('pg-hoff.locale'))
compare: (left, right) ->
return Date.parse(left) - Date.parse(right)
23:
name:... | class PgHoffTypes
@Type:
1184:
name: 'Timestamp'
format: (value) ->
return new Date(value).toLocaleString(atom.config.get('pg-hoff.locale'))
compare: (left, right) ->
return Date.parse(left) - Date.parse(right)
23:
name:... |
Change split to ignore tutorial | translate = require 'lib/translate'
Classification = require 'models/classification'
User = require 'zooniverse/lib/models/user'
userCount = -> User.count or 0
none = -> ''
social = -> translate('classify.splits.social').replace '###', userCount()
task = -> translate 'classify.splits.task'
science = -> translate 'cla... | translate = require 'lib/translate'
Classification = require 'models/classification'
User = require 'zooniverse/lib/models/user'
userCount = -> User.count or 0
none = -> ''
social = -> translate('classify.splits.social').replace '###', userCount()
task = -> translate 'classify.splits.task'
science = -> translate 'cla... |
Add specs for element-icons service | DefaultFileIcons = require '../lib/default-file-icons'
getIconServices = require '../lib/get-icon-services'
describe 'IconServices', ->
describe 'FileIcons', ->
afterEach ->
getIconServices().resetFileIcons()
getIconServices().resetElementIcons()
it 'provides a default', ->
expect(getIconS... | # vim: ts=2
DefaultFileIcons = require '../lib/default-file-icons'
getIconServices = require '../lib/get-icon-services'
{Disposable} = require 'atom'
describe 'IconServices', ->
afterEach ->
getIconServices().resetFileIcons()
getIconServices().resetElementIcons()
describe 'FileIcons', ->
it 'provides ... |
Handle list of data objects | jQuery.fn.render = (data) ->
data = [data] unless jQuery.isArray(data)
context = this
template = this.clone()
# Iterate over data objects
jQuery.each data, (index, object) ->
tmp = template.clone()
# Iterate over keys in the data object
jQuery.each object, (key, value) ->
[klass, att... | jQuery.fn.render = (data) ->
data = [data] unless jQuery.isArray(data)
context = this
template = this.clone()
# Iterate over data objects
jQuery.each data, (index, object) ->
tmp = template.clone()
# Iterate over keys in the data object
jQuery.each object, (key, value) ->
[klass, att... |
Sort by received_at for merging unified collection results | TentStatus.UnifiedCollection = class UnifiedCollection extends Marbles.UnifiedCollection
fetchNext: (options = {}) =>
collections = _.select @collections(), (c) => !!c.pagination.next
next_params = null
for collection in collections
continue unless collection.pagination.next
next_params ?= {}... | TentStatus.UnifiedCollection = class UnifiedCollection extends Marbles.UnifiedCollection
sortModelsBy: (model) =>
model.get('received_at') * -1
fetchNext: (options = {}) =>
collections = _.select @collections(), (c) => !!c.pagination.next
next_params = null
for collection in collections
cont... |
Call constructor to initialize @cwd | linterPath = atom.packages.getLoadedPackage("linter").path
Linter = require "#{linterPath}/lib/linter"
class LinterPyflakes extends Linter
# The syntax that the linter handles. May be a string or
# list/tuple of strings. Names should be all lowercase.
@syntax: 'source.python'
# A string, list, tuple or callab... | linterPath = atom.packages.getLoadedPackage("linter").path
Linter = require "#{linterPath}/lib/linter"
class LinterPyflakes extends Linter
# The syntax that the linter handles. May be a string or
# list/tuple of strings. Names should be all lowercase.
@syntax: 'source.python'
# A string, list, tuple or callab... |
Update canvases when a bulb is pressed | # 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/
$ ->
$('.update').on 'input', (event) ->
$(this).parent().find('.update').val(this.value)
$... | # 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/
$ ->
$('.update').on 'input', (event) ->
$(this).parent().find('.update').val(this.value)
$... |
Make finalizedquantity optional in the ofn-on-hand directive and extract avaiable quantity to a separate method for clarity | Darkswarm.directive "ofnOnHand", ->
restrict: 'A'
require: "ngModel"
link: (scope, elem, attr, ngModel) ->
# In cases where this field gets its value from the HTML element rather than the model,
# initialise the model with the HTML value.
if scope.$eval(attr.ngModel) == undefined
# Don't dirty ... | Darkswarm.directive "ofnOnHand", ->
restrict: 'A'
require: "ngModel"
link: (scope, elem, attr, ngModel) ->
# In cases where this field gets its value from the HTML element rather than the model,
# initialise the model with the HTML value.
if scope.$eval(attr.ngModel) == undefined
# Don't dirty ... |
Remove fix for a weird browserify issue in Chrome Canary | # WTF: Why aren't these being resolved?
require 'zooniverse/views/zooniverse-logo-svg'
require 'zooniverse/views/group-icon-svg'
require 'zooniverse/views/language-icon-svg'
require 'zooniverse/views/mail-icon-svg'
window.jQuery = require 'jquery'
Project = require '../../src/project'
window.zooniverseProject = new ... | window.jQuery = require 'jquery'
Project = require '../../src/project'
window.zooniverseProject = new Project window.zooniverseProjectConfig
|
Update string scoring to be case insensitive | String::score = (abbreviation) ->
string = @
return 1 if string == abbreviation
index = string.indexOf(abbreviation)
# only allow substrings to match
return 0 if index == -1
return 1 if index == 0
abbreviation.length / string.length
| String::score = (abbreviation) ->
string = @toLowerCase()
abbreviation = abbreviation.toLowerCase()
return 1 if string == abbreviation
index = string.indexOf(abbreviation)
# only allow substrings to match
return 0 if index == -1
return 1 if index == 0
abbreviation.length / string.length
|
Initialize tips in the channel route | { USER } = require("sharify").data
User = require '../../../models/user.coffee'
PathView = require '../../../components/path/client/path_view.coffee'
setupChannelsView = require '../components/channels/index.coffee'
MetaEditableAttributeView = require '../../../components/editable_attribute/client/meta_editable_attribu... | { USER } = require("sharify").data
User = require '../../../models/user.coffee'
initTips = require '../../../components/tips/index.coffee'
PathView = require '../../../components/path/client/path_view.coffee'
setupChannelsView = require '../components/channels/index.coffee'
MetaEditableAttributeView = require '../../..... |
Load vex config inside a partial | #= require active_admin/base
#= require activeadmin-sortable
#= require jquery-ui
#= require chosen-jquery
#= require admin/form_translation
#= require admin/froala_editor
#= require admin/settings
#= require admin/chosen
#= require admin/newsletters_preview
#= require gmaps.js
#= require globals/_functions
#= require ... | #= require active_admin/base
#= require activeadmin-sortable
#= require jquery-ui
#= require chosen-jquery
#= require admin/form_translation
#= require admin/froala_editor
#= require admin/settings
#= require admin/chosen
#= require admin/newsletters_preview
#= require gmaps.js
#= require globals/_functions
#= require ... |
Fix sort JS module crash | Neighborly.Admin ?= {} if Neighborly.Admin is undefined
Neighborly.Admin.Modules ?= {} if Neighborly.Admin.Modules is undefined
Neighborly.Admin.Modules.Sort = Backbone.View.extend
el: ".admin"
events:
"click [data-sort]": "sort"
initialize: ->
@form = @$("form")
@table = @$(".data-table")
@sel... | Neighborly.Admin ?= {} if Neighborly.Admin is undefined
Neighborly.Admin.Modules ?= {} if Neighborly.Admin.Modules is undefined
Neighborly.Admin.Modules.Sort = Backbone.View.extend
el: ".admin"
events:
"click [data-sort]": "sort"
initialize: ->
@form = @$("form")
@table = @$(".data-table")
@sel... |
Remove logging line from UsersNewController | App.UsersNewController = Em.Controller.extend
needs: ["application"]
currentUser: Ember.computed.alias("controllers.application.currentUser")
validRoles: ["member", "admin"]
actions:
save: ->
userAttributes = @getProperties(["firstName", "lastName", "role", "password", "email"])
user = @store... | App.UsersNewController = Em.Controller.extend
needs: ["application"]
currentUser: Ember.computed.alias("controllers.application.currentUser")
validRoles: ["member", "admin"]
actions:
save: ->
userAttributes = @getProperties(["firstName", "lastName", "role", "password", "email"])
user = @store... |
Use CoffeeScript syntax for rowData check | #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 deprecation warning and fix indentation | # For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'.editor.python':
'ctrl-alt-s': 'python-isort:sortImports'
| # For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'atom-text-editor[data-grammar="source python"]':
'ctrl-alt-s': 'python-isort:sortImports'
|
Add oxygen-sans to the font list (for kde5) | module.exports =
config:
fontFamily:
description: 'Experimental: set to gtk-3 to load the font settings from ~/.config/gtk-3.0/settings.ini'
type: 'string'
default: 'Cantarell'
enum: [
'Cantarell',
'Sans Serif',
'DejaVu Sans',
'gtk-3'
]
fontSize:
... | module.exports =
config:
fontFamily:
description: 'Experimental: set to gtk-3 to load the font settings from ~/.config/gtk-3.0/settings.ini'
type: 'string'
default: 'Cantarell'
enum: [
'Cantarell',
'Sans Serif',
'DejaVu Sans',
'Oxygen-Sans',
'gtk-3'... |
Check for fair profile type before fair info app | Fair = require '../../models/fair'
@assignFair = (req, res, next) ->
return next() unless res.locals.profile
fair = new Fair id: res.locals.profile.get('owner').id
fair.fetch
cache: true
error: res.backboneError
success: ->
res.locals.fair = fair
res.locals.sd.FAIR = fair.toJSON()
... | Fair = require '../../models/fair'
@assignFair = (req, res, next) ->
return next() unless res.locals.profile?.isFair()
fair = new Fair id: res.locals.profile.get('owner').id
fair.fetch
cache: true
error: res.backboneError
success: ->
res.locals.fair = fair
res.locals.sd.FAIR = fair.toJSO... |
Fix Urban to use the Urban Dictionary API | # Description:
# Define terms via Urban Dictionary
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot urban me <term> - Searches Urban Dictionary and returns definition
# hubot urban define me <term> - Searches Urban Dictionary and returns definition
# hubot urban example me <... | # Description:
# Define terms via Urban Dictionary
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot urban me <term> - Searches Urban Dictionary and returns definition
# hubot urban define me <term> - Searches Urban Dictionary and returns definition
# hubot urban example me <... |
Remove deprecation warning about Batman.View.prototype.prefix. | class Batman.ViewStore extends Batman.Object
@prefix: 'views'
constructor: ->
super
@_viewContents = {}
@_requestedPaths = new Batman.SimpleSet
propertyClass: Batman.Property
fetchView: (path) ->
Batman.developer.do ->
unless typeof Batman.View::prefix is 'undefined'
Batman.deve... | class Batman.ViewStore extends Batman.Object
@prefix: 'views'
constructor: ->
super
@_viewContents = {}
@_requestedPaths = new Batman.SimpleSet
propertyClass: Batman.Property
fetchView: (path) ->
new Batman.Request
url: Batman.Navigator.normalizePath(@constructor.prefix, "#{path}.html")... |
Create dummy admin user in test mode. | util = require 'util'
module.exports = (app, mongoose, options) ->
models = require('./models')(mongoose)
controllers = require('./controllers')(models)
auth = require('./authentication')(app, models, options)
require('./routes')(app, auth, controllers)
auth | util = require 'util'
module.exports = (app, mongoose, options) ->
models = require('./models')(mongoose)
controllers = require('./controllers')(models)
auth = require('./authentication')(app, models, options)
require('./routes')(app, auth, controllers)
app.configure 'test', ->
console.log 'injecti... |
Add . after build command | module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
glob_to_multiple:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'lib'
ext: '.js'
shell:
rebuild:
command: 'npm build'
options:
std... | module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
glob_to_multiple:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'lib'
ext: '.js'
shell:
rebuild:
command: 'npm build .'
options:
s... |
Create @wrapper in adapter constructor | # Your Adapter SHOULD define:
# * @QueryDefaults - The default parameters if no others are passed in.
class Embeditor.Adapter
className: "Adapter"
@QueryDefaults = {}
constructor: (@element, @options={}) ->
@adapter = Embeditor.Adapters[@className]
@href = @element.attr('... | # Your Adapter SHOULD define:
# * @QueryDefaults - The default parameters if no others are passed in.
class Embeditor.Adapter
className: "Adapter"
@QueryDefaults = {}
constructor: (@element, @options={}) ->
@adapter = Embeditor.Adapters[@className]
@href = @element.attr('... |
Add support for sending cross-origin requests with credentials | define [
'jquery'
], ($) ->
# Relies on the jquery-ajax-queue plugin to supply this method.
# This ensures data is not silently lost
$(window).on 'beforeunload', ->
if $.hasPendingRequest()
return "Wow, you're quick! Your data is being saved. " +
"It will only take a m... | define [
'jquery'
], ($) ->
# Relies on the jquery-ajax-queue plugin to supply this method.
# This ensures data is not silently lost
$(window).on 'beforeunload', ->
if $.hasPendingRequest()
return "Wow, you're quick! Your data is being saved. " +
"It will only take a m... |
Fix ajax pre-filter to define the xhrFields for CORS support | define [
'jquery'
], ($) ->
# Relies on the jquery-ajax-queue plugin to supply this method.
# This ensures data is not silently lost
$(window).on 'beforeunload', ->
if $.hasPendingRequest()
return "Wow, you're quick! Your data is being saved. " +
"It will only take a m... | define [
'jquery'
], ($) ->
# Relies on the jquery-ajax-queue plugin to supply this method.
# This ensures data is not silently lost
$(window).on 'beforeunload', ->
if $.hasPendingRequest()
return "Wow, you're quick! Your data is being saved. " +
"It will only take a m... |
Implement the vector based version of the compute method. | _ = require "underscore"
Transform = require "./transform"
class Jitter extends Transform.Model
initialize: (attrs, options) ->
super(attrs, options)
defaults: ->
return _.extend({}, super(), {
interval: 1
})
compute: (x) ->
# Apply the transform to a single value
return(x + ((Math.ra... | _ = require "underscore"
Transform = require "./transform"
class Jitter extends Transform.Model
initialize: (attrs, options) ->
super(attrs, options)
defaults: ->
return _.extend({}, super(), {
interval: 1
})
compute: (x) ->
# Apply the transform to a single value
return(x + ((Math.ra... |
Fix app router when there are no analytics. | @AppRouter = Backbone.Router.extend
routes:
"reload": "reload"
"": "categories"
"about": "about"
"contribute": "contribute"
"pods/:filter": "pods"
"pods/:filter/:sort_by": "pods"
"pods/:filter/:sort_by/:idx": "pods"
contribute: () ->
@pageview '/contribute'
@appController.display... | @AppRouter = Backbone.Router.extend
routes:
"reload": "reload"
"": "categories"
"about": "about"
"contribute": "contribute"
"pods/:filter": "pods"
"pods/:filter/:sort_by": "pods"
"pods/:filter/:sort_by/:idx": "pods"
contribute: () ->
@pageview '/contribute'
@appController.display... |
Remove switch tutorial from student tutorial list | angular.module('doubtfire.projects.states.tutorials', [])
#
# Tasks state for projects
#
.config(($stateProvider) ->
$stateProvider.state 'projects/tutorials', {
parent: 'projects/index'
url: '/tutorials'
controller: 'ProjectsTutorialsStateCtrl'
templateUrl: 'projects/states/tutorials/tutorials.tpl.h... | angular.module('doubtfire.projects.states.tutorials', [])
#
# Tasks state for projects
#
.config(($stateProvider) ->
$stateProvider.state 'projects/tutorials', {
parent: 'projects/index'
url: '/tutorials'
controller: 'ProjectsTutorialsStateCtrl'
templateUrl: 'projects/states/tutorials/tutorials.tpl.h... |
Fix a browser global bug. | if $mate.environmentType == "browser"
global.$mate = $mate
else if $mate.environmentType == "node"
module.exports = $mate
else
throw new Error()
| if $mate.environmentType == "browser"
window.$mate = $mate
else if $mate.environmentType == "node"
module.exports = $mate
else
throw new Error()
|
Remove console log from o change method | $ ->
console.log 'iniciou'
$('.reminder_active').on 'change', ->
$('.reminder_days_before').prop "disabled", !@.checked
| $ ->
$('.reminder_active').on 'change', ->
$('.reminder_days_before').prop "disabled", !@.checked
|
Hide forgot failure messages on submit | class ForgotPasswordController
constructor: (AuthenticatorService, $routeParams) ->
@AuthenticatorService = AuthenticatorService
@callbackUrl = $routeParams.callback ? 'https://app.octoblu.com/api/session'
@loginPath = "/?" + $.param(callback: @callbackUrl)
forgotPassword: (email) =>
@Authenticator... | class ForgotPasswordController
constructor: (AuthenticatorService, $routeParams) ->
@AuthenticatorService = AuthenticatorService
@callbackUrl = $routeParams.callback ? 'https://app.octoblu.com/api/session'
@loginPath = "/?" + $.param(callback: @callbackUrl)
forgotPassword: (email) =>
delete @messag... |
Convert instance variable to scoped variable | helpers = require '../spec-helpers'
LatexmkBuilder = require '../../lib/builders/latexmk'
describe "LatexmkBuilder", ->
[builder] = []
beforeEach ->
builder = new LatexmkBuilder()
describe "constructArgs", ->
beforeEach ->
@filePath = 'foo.tex'
it "produces default arguments when package has... | helpers = require '../spec-helpers'
LatexmkBuilder = require '../../lib/builders/latexmk'
describe "LatexmkBuilder", ->
[builder] = []
beforeEach ->
builder = new LatexmkBuilder()
describe "constructArgs", ->
[filePath] = []
beforeEach ->
filePath = 'foo.tex'
it "produces default argume... |
Use the `ember-data` initializer as a target instead of the soon to be deprecated `store` initializer | # Takes two parameters: container and app
`import YoutubeAdapter from '../adapters/youtube'`
`import YoutubeSerializer from '../serializers/youtube'`
`import DS from 'ember-data'`
initialize = (ctn, app) ->
app.register('adapter:-youtube', YoutubeAdapter)
app.register('serializer:-youtube', YoutubeSerializer)
DS... | # Takes two parameters: container and app
`import YoutubeAdapter from '../adapters/youtube'`
`import YoutubeSerializer from '../serializers/youtube'`
`import DS from 'ember-data'`
initialize = (ctn, app) ->
app.register('adapter:-youtube', YoutubeAdapter)
app.register('serializer:-youtube', YoutubeSerializer)
DS... |
Use method instead of instance var per @markijbema's comment | class window.SubCommentsListView extends Backbone.Marionette.CompositeView
className: 'evidence-sub-comments-list'
itemView: SubCommentView
itemViewContainer: '.js-region-sub-comments-collection'
template: 'sub_comments/sub_comments_list'
addView: SubCommentsAddView
initialize: ->
@collection.fetch ... | class window.SubCommentsListView extends Backbone.Marionette.CompositeView
className: 'evidence-sub-comments-list'
itemView: SubCommentView
itemViewContainer: '.js-region-sub-comments-collection'
template: 'sub_comments/sub_comments_list'
initialize: ->
@collection.fetch update: true # only fires 'add'... |
Add callback to request invocation | request = require 'request'
module.exports =
class Reporter
constructor: ->
@request = request
send: (eventType, data) ->
params = timestamp: ((new Date().getTime()) / 1000)
params.dimensions = data
@request
method: 'POST'
url: "https://collector.githubapp.com/atom/#... | request = require 'request'
module.exports =
class Reporter
constructor: ->
@request = request
send: (eventType, data) ->
params =
timestamp: new Date().getTime() / 1000
dimensions: data
requestOptions =
method: 'POST'
url: "https://collector.githubapp.com/... |
Add variation column to benchmark table | ###
Functions to build the benchmark table
###
benchmark_id = (data, type, row) ->
"#{row.num}#{row.variations}.#{row.revisions.version}"
get_columns = ->
### Get the column data for the table
Returns:
list of columns
###
[
{
title:'ID'
render:benchmark_id
}
{
data:'num'
... | ###
Functions to build the benchmark table
###
benchmark_id = (data, type, row) ->
"#{row.num}#{row.variations}.#{row.revisions.version}"
get_columns = ->
### Get the column data for the table
Returns:
list of columns
###
[
{
title:'ID'
render:benchmark_id
}
{
data:'num'... |
Fix event bindings for variable-length keypaths. | #= require ./abstract_attribute_binding
class Batman.DOM.EventBinding extends Batman.DOM.AbstractAttributeBinding
onlyObserve: Batman.BindingDefinitionOnlyObserve.Data
constructor: ->
super
callback = =>
target = @view.targetForKeypathBase(@key)
@get('filteredValue')?.apply(target, arguments)... | #= require ./abstract_attribute_binding
class Batman.DOM.EventBinding extends Batman.DOM.AbstractAttributeBinding
onlyObserve: Batman.BindingDefinitionOnlyObserve.Data
bindImmediately: false
constructor: ->
super
callback = =>
func = @get('filteredValue')
target = @view.targetForKeypathBase... |
Add resetpassword route, fix alert box always being shown on reset password page | express = require 'express'
router = express.Router()
router.get '/admin', (req, res) ->
if req.user
res.redirect '/admin/cc'
else
res.render 'login', error: req.flash 'error'
router.get '/admin/:page?', (req, res) ->
res.render 'index', error: req.flash 'error'
router.get "/partials/cc", (req, res) ->... | express = require 'express'
router = express.Router()
router.get '/resetPassword', (req, res) ->
if !req.user or !req.user.data.needsReset
return res.redirect "/"
res.render 'resetpassword',
error: req.flash 'error'
username: req.user.data.username
router.use (req, res, next) ->
if req.user and req... |
Make multiple loads of strut pick up latest ppt data properly. | loadPpt = ->
pptData = StrutBuilder.build(JSON.parse(localStorage.regions))
#[
#{ #slide 1
#start: 0,
#end: 2.5,
#texts: [
#{text: 'Hum', position: 1.2},
#{text: 'bewafaa', position: 1.7}
#]
#},
#{ #slide 2
#start: ... | loadPpt = ->
pptData = StrutBuilder.build(JSON.parse(localStorage.regions))
#[
#{ #slide 1
#start: 0,
#end: 2.5,
#texts: [
#{text: 'Hum', position: 1.2},
#{text: 'bewafaa', position: 1.7}
#]
#},
#{ #slide 2
#start: ... |
Set start panel with flight.launch() | class AppRouter extends Backbone.Router
routes:
'': 'homePage'
'panel/:id': 'goToPanel'
homePage: ->
@view = new app.Views.Home
@view.render()
goToPanel: (id) ->
@view = new app.Views["Panel_" + id]
@view.render(id)
@app = window.app ? {}
@app.Routers.AppRout... | class AppRouter extends Backbone.Router
routes:
'': 'homePage'
'panel/:id': 'goToPanel'
initialize: ->
flight.launch("#panel-1")
homePage: ->
@view = new app.Views.Home
@view.render()
goToPanel: (id) ->
@view = new app.Views["Panel_" + id]
@view.render(id)
... |
Replace invalid use of _.map() with a for-loop | import * as _ from "underscore"
import * as p from "../../core/properties"
import {InputWidget, InputWidgetView} from "./input_widget"
import multiselecttemplate from "./multiselecttemplate"
export class MultiSelectView extends InputWidgetView
tagName: "div"
template: multiselecttemplate
events:
"change ... | import * as _ from "underscore"
import * as p from "../../core/properties"
import {InputWidget, InputWidgetView} from "./input_widget"
import multiselecttemplate from "./multiselecttemplate"
export class MultiSelectView extends InputWidgetView
tagName: "div"
template: multiselecttemplate
events:
"change ... |
Fix replace all under plugin command | 'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] messag... | 'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] messag... |
Copy allowedHosts and destroy browser on every render. | Browser = require 'zombie'
fs = require 'fs'
path = require 'path'
URL = require 'url'
createBrowser = (options = {}) ->
browser = new Browser
headers:
"X-Otter-No-Render": "true"
browser.resources.addHandler (request, next) ->
if not options.allowedHosts
options.allowedHosts = []
# Always ... | Browser = require 'zombie'
fs = require 'fs'
path = require 'path'
URL = require 'url'
createBrowser = (options = {}) ->
browser = new Browser
headers:
"X-Otter-No-Render": "true"
browser.resources.addHandler (request, next) ->
allowedHosts = []
if options.allowedHosts
allowedHosts = allowe... |
Save all pane items before window is closed | module.exports =
configDefaults:
enabled: false
activate: (state) ->
@migrateOldAutosaveConfig()
rootView.on 'focusout', ".editor:not(.mini)", (event) =>
editSession = event.targetView()?.getModel()
@autosave(editSession)
rootView.on 'pane:before-item-destroyed', (event, paneItem) =>
... | {$} = require 'atom'
module.exports =
configDefaults:
enabled: false
activate: (state) ->
@migrateOldAutosaveConfig()
rootView.on 'focusout', ".editor:not(.mini)", (event) =>
editSession = event.targetView()?.getModel()
@autosave(editSession)
rootView.on 'pane:before-item-destroyed',... |
Disable the autopoll for now. | # galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity.
# Copyright (C) 2013 Matthew Farmer
#
# This program 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, ... | # galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity.
# Copyright (C) 2013 Matthew Farmer
#
# This program 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, ... |
Change the sidebar to use Flexbox for container | _ = require 'underscore'
React = require 'react'
{OutlineView, ScrollRegion} = require 'nylas-component-kit'
AccountSwitcher = require './account-switcher'
SidebarStore = require '../sidebar-store'
class AccountSidebar extends React.Component
@displayName: 'AccountSidebar'
@containerRequired: false
@containerS... | _ = require 'underscore'
React = require 'react'
{OutlineView, ScrollRegion, Flexbox} = require 'nylas-component-kit'
AccountSwitcher = require './account-switcher'
SidebarStore = require '../sidebar-store'
class AccountSidebar extends React.Component
@displayName: 'AccountSidebar'
@containerRequired: false
@c... |
Change error formatter to red | color = require('colors')
module.exports = (failure) ->
return format(failure)
format = (failure) ->
message = shorten(failure, 5)
colorFirstLine(message)
shorten = (message, numlines) ->
message.split('\n').splice(0, numlines).join('\n')
colorFirstLine = (message) ->
split = message.split('\n')
split[0]... | color = require('colors')
module.exports = (failure) ->
return format(failure)
format = (failure) ->
message = shorten(failure, 5)
colorFirstLine(message)
shorten = (message, numlines) ->
message.split('\n').splice(0, numlines).join('\n')
colorFirstLine = (message) ->
split = message.split('\n')
split[0]... |
Use fs.resolveOnLoadPath() to find ctags executable | Point = require 'point'
$ = require 'jquery'
BufferedProcess = require 'buffered-process'
module.exports =
class TagGenerator
constructor: (@path) ->
parseTagLine: (line) ->
sections = line.split('\t')
if sections.length > 3
position: new Point(parseInt(sections[2]) - 1)
name: sections[0]
... | Point = require 'point'
$ = require 'jquery'
BufferedProcess = require 'buffered-process'
fs = require 'fs-utils'
module.exports =
class TagGenerator
constructor: (@path) ->
parseTagLine: (line) ->
sections = line.split('\t')
if sections.length > 3
position: new Point(parseInt(sections[2]) - 1)
... |
Change default star size to 250px | 'use strict'
### @ngInject ###
module.exports = ($scope) ->
$scope.star = {
corners: 5,
spokeRatio: 0.5,
fill: '#f0c039',
stroke: '#e4a91a',
skew: 0,
randomness: 0,
size: 100
}
$scope.updateBoxStyle = ->
$scope.boxStyle = {
display: 'inline-block',
width: $scope.sta... | 'use strict'
### @ngInject ###
module.exports = ($scope) ->
$scope.star = {
corners: 5,
spokeRatio: 0.5,
fill: '#f0c039',
stroke: '#e4a91a',
skew: 0,
randomness: 0,
size: 250
}
$scope.updateBoxStyle = ->
$scope.boxStyle = {
display: 'inline-block',
width: $scope.sta... |
Handle undefined result from parser | Logger = require '../logger'
module.exports =
class ConsoleLogger extends Logger
error: (statusCode, result, builder) ->
console.group('LaTeX errors')
switch statusCode
when 127
executable = 'latexmk' # TODO: Read from Builder::executable in the future.
console.log(
"""
... | Logger = require '../logger'
module.exports =
class ConsoleLogger extends Logger
error: (statusCode, result, builder) ->
console.group('LaTeX errors')
switch statusCode
when 127
executable = 'latexmk' # TODO: Read from Builder::executable in the future.
console.log(
"""
... |
Remove Correct Spelling from mini editor context menu | 'context-menu':
'atom-text-editor': [
{label: 'Correct Spelling', command: 'spell-check:correct-misspelling'}
]
| 'context-menu':
'atom-text-editor:not([mini])': [
{label: 'Correct Spelling', command: 'spell-check:correct-misspelling'}
]
|
Select input field's content on select event. | define ['jquery', 'underscore', 'backbone', 'bootstrap', 'plugins/select_range'], ($, _, Backbone) ->
class SearchInputView extends Backbone.View
initialize: () ->
@$el.typeahead
source: @getTypeaheadAddresses
updater: (item) =>
_.defer @afterTypeahead
item
minLe... | define ['jquery', 'underscore', 'backbone', 'bootstrap', 'plugins/select_range'], ($, _, Backbone) ->
class SearchInputView extends Backbone.View
initialize: () ->
@$el.typeahead
source: @getTypeaheadAddresses
updater: (item) =>
_.defer @afterTypeahead
item
minLe... |
Update HeaderCtrl to use `keywords` param instead of `search` | Sprangular.controller "HeaderCtrl", (
$scope,
$location,
Cart,
Account,
Catalog,
Env,
Flash,
Status,
Angularytics,
$translate
) ->
$scope.cart = Cart
Catalog.taxonomies().then (taxonomies) ->
$scope.taxonomies = taxonomies
$scope.account = Account
$scope.env = Env
$scope.search = {tex... | Sprangular.controller "HeaderCtrl", (
$scope,
$location,
Cart,
Account,
Catalog,
Env,
Flash,
Status,
Angularytics,
$translate
) ->
$scope.cart = Cart
Catalog.taxonomies().then (taxonomies) ->
$scope.taxonomies = taxonomies
$scope.account = Account
$scope.env = Env
$scope.search = {tex... |
Set Arnie to reply 100% of the time (for now). Update a few Arnie quotes. | # Description:
# Listens for words and sometimes replies with an Arnie quote
#
# Dependencies:
# None
#
# Commands:
# None
#
# Author:
# Casey Lawrence <cjlaw@users.noreply.github.com>
#
odds = [1...100]
arnie_quotes = [
'GET TO THE CHOPPA!',
'Your clothes, give them to me, now!',
'Hasta La Vista... | # Description:
# Listens for words and sometimes replies with an Arnie quote
#
# Dependencies:
# None
#
# Commands:
# None
#
# Author:
# Casey Lawrence <casey.j.lawrence@gmail.com>
#
odds = [1...100]
arnie_quotes = [
'GET TO THE CHOPPA!',
'Your clothes, give them to me, NOW!',
'Hasta La Vista, Ba... |
Stop server and test cases on SIGINT | w = require('when')
express = require('express')
Config = require('./config')
Project = require('./project')
TestCase = require('./test_case')
module.exports = () ->
app = express()
modules = []
servers = []
start: ->
app.use express.static(Project.publicPath)
w.all Config.ports.map (port) ->
... | w = require('when')
express = require('express')
Config = require('./config')
Project = require('./project')
TestCase = require('./test_case')
module.exports = () ->
app = express()
modules = []
servers = []
testCases = []
stop = ->
promises = []
servers.forEach (server) ->
promises.push w.... |
Reset the whole model when the status is changed | @CodequestManager.module "Entities", (Entities, App, Backbone, Marionette, $, _) ->
Entities.Order = Backbone.Model.extend
urlRoot: ->
"/orders"
parse: (data) ->
data.dishes = new Entities.Dishes data.dishes
data.dishes.order = this
data
currentUserOrdered: ->
@get('dishes... | @CodequestManager.module "Entities", (Entities, App, Backbone, Marionette, $, _) ->
Entities.Order = Backbone.Model.extend
urlRoot: ->
"/orders"
parse: (data) ->
data.dishes = new Entities.Dishes data.dishes
data.dishes.order = this
data
currentUserOrdered: ->
@get('dishes... |
Fix for kublogPath, it must have a path separator. | # Global helpers should be used in comments as well
window.setErrors = (model, errors) ->
for attribute, error of errors
$label = $("label[for=#{model}_#{attribute}]")
$field = $("##{model}_#{attribute}")
unless $label.size() is 0
$label.addClass('error')
$(errorTemplate(error[0])).insertAfter... | # Global helpers should be used in comments as well
window.setErrors = (model, errors) ->
for attribute, error of errors
$label = $("label[for=#{model}_#{attribute}]")
$field = $("##{model}_#{attribute}")
unless $label.size() is 0
$label.addClass('error')
$(errorTemplate(error[0])).insertAfter... |
Sort grammars by name in select list | SelectList = require 'select-list'
{$$} = require 'space-pen'
module.exports =
class GrammarView extends SelectList
@viewClass: -> "#{super} grammar-view from-top overlay mini"
filterKey: 'name'
initialize: (@editor) ->
@currentGrammar = @editor.getGrammar()
@path = @editor.getPath()
@autoDetect =... | SelectList = require 'select-list'
{$$} = require 'space-pen'
module.exports =
class GrammarView extends SelectList
@viewClass: -> "#{super} grammar-view from-top overlay mini"
filterKey: 'name'
initialize: (@editor) ->
@currentGrammar = @editor.getGrammar()
@path = @editor.getPath()
@autoDetect =... |
Remove Scayt and enable auto spelling from CKEditor | window.Tahi ||= {}
class Tahi.RichEditableElement
constructor: (@element) ->
@instance = CKEDITOR.inline @element,
extraPlugins: 'sharedspace'
removePlugins: 'floatingspace,resize'
sharedSpaces:
top: 'toolbar'
toolbar: [
[ 'Format' ]
[ 'Bold', 'Italic', 'Underline'... | window.Tahi ||= {}
class Tahi.RichEditableElement
constructor: (@element) ->
@instance = CKEDITOR.inline @element,
extraPlugins: 'sharedspace'
removePlugins: 'floatingspace,resize'
sharedSpaces:
top: 'toolbar'
scayt_autoStartup: true
toolbar: [
[ 'Format' ]
[... |
Set an eccessor on AssociationSets so we can do data-hideif: asssociation.loaded | #= require ../../set/set_sort
class Batman.AssociationSet extends Batman.SetSort
constructor: (@foreignKeyValue, @association) ->
base = new Batman.Set
super(base, 'hashKey')
loaded: false
load: (callback) ->
return callback(undefined, @) unless @foreignKeyValue?
@association.getRelatedModel().lo... | #= require ../../set/set_sort
class Batman.AssociationSet extends Batman.SetSort
constructor: (@foreignKeyValue, @association) ->
base = new Batman.Set
super(base, 'hashKey')
loaded: false
load: (callback) ->
return callback(undefined, @) unless @foreignKeyValue?
@association.getRelatedModel().lo... |
Improve Names of Quality EDSL Parameters | angular.module 'qbn.edsl', ['qbn.quality', 'qbn.storylet', 'qbn.choice']
.factory 'qbnEdsl', (qualities, storylets, frontalChoices, choiceFactory) ->
api =
quality: (id, name, description, args = {}) ->
{defaultValue, defaultProgress, maxProgress, hasProgress, progressEscalation,
visible} =... | angular.module 'qbn.edsl', ['qbn.quality', 'qbn.storylet', 'qbn.choice']
.factory 'qbnEdsl', (qualities, storylets, frontalChoices, choiceFactory) ->
api =
quality: (id, name, description, args = {}) ->
{value, progress, maxProgress, hasProgress, progressEscalation,
visible} = args
... |
Fix missing close paren in variantAutocomplete | # variant autocompletion
variantTemplate = HandlebarsTemplates["variants/autocomplete"]
formatVariantResult = (variant) ->
variantTemplate(
variant: variant
)
$.fn.variantAutocomplete = (searchOptions = {}) ->
@select2
placeholder: Spree.translations.variant_placeholder
minimumInputLength: 3
in... | # variant autocompletion
variantTemplate = HandlebarsTemplates["variants/autocomplete"]
formatVariantResult = (variant) ->
variantTemplate(
variant: variant
)
$.fn.variantAutocomplete = (searchOptions = {}) ->
@select2
placeholder: Spree.translations.variant_placeholder
minimumInputLength: 3
in... |
Move tests next to their modules | #
# main.coffee
#
# Role: start the app
#
# Responsibility:
# * load top-level modules
# * initalize game based on query string
# * render and append to body of HTML
# * run tests if local
#
# Preamble
# TODO: server-side include underscore, underscore.string, jquery
{my} = require './my'
if my.online
_.mixin(_.str... | #
# main.coffee
#
# Role: start the app
#
# Responsibility:
# * load top-level modules
# * initalize game based on query string
# * render and append to body of HTML
# * run tests if local
#
# Preamble
# TODO: server-side include underscore, underscore.string, jquery
{my} = require './my'
if my.online
_.mixin(_.str... |
Fix URS redirect location in IE9 | do ($ = jQuery, config = @edsc.config) ->
$(document).on 'click', 'a[data-pulse]', ->
$dest = $($(this).attr('data-pulse'))
$dest.animate(color: '#00ffff').animate(color: 'inherit')
# Remove buttons in tables remove their rows
$(document).on 'click', 'tr a[title="remove"]', ->
$(this).closest('tr').... | do (document, window, $ = jQuery, config = @edsc.config) ->
$(document).on 'click', 'a[data-pulse]', ->
$dest = $($(this).attr('data-pulse'))
$dest.animate(color: '#00ffff').animate(color: 'inherit')
# Remove buttons in tables remove their rows
$(document).on 'click', 'tr a[title="remove"]', ->
$(th... |
Add POST request support to client proxy | Steam.Xhr = (_) ->
createResponse = (status, data, xhr) ->
status: status, data: data, xhr: xhr
link$ _.invokeH2O, (method, path, go) ->
$.getJSON path
.done (data, status, xhr) ->
go null, createResponse status, data, xhr
.fail (xhr, status, error) ->
go createResponse status, ... | Steam.Xhr = (_) ->
createResponse = (status, data, xhr) ->
status: status, data: data, xhr: xhr
handleResponse = (go, jqxhr) ->
jqxhr
.done (data, status, xhr) ->
go null, createResponse status, data, xhr
.fail (xhr, status, error) ->
go createResponse status, xhr.responseJSON, ... |
Fix full name computed property * There was a redundant space getting added when the middle initial is absent | a = DS.attr
ETahi.Author = DS.Model.extend
authorGroup: DS.belongsTo('authorGroup')
firstName: a('string')
middleInitial: a('string')
lastName: a('string')
fullName: (->
"#{@get('firstName')} #{@get('middleInitial') || ''} #{@get('lastName')}"
).property('firstName', 'middleInitial', 'lastName')
em... | a = DS.attr
ETahi.Author = DS.Model.extend
authorGroup: DS.belongsTo('authorGroup')
firstName: a('string')
middleInitial: a('string')
lastName: a('string')
fullName: (->
[@get('firstName'), @get('middleInitial'), @get('lastName')].compact().join(' ')
).property('firstName', 'middleInitial', 'lastName')... |
Add one extra failure handling for item checkin mode. | class @ItemCheckInMode extends ItemCheckoutMode
ModeSwitcher.registerEntryPoint("vendor_check_in", @)
glyph: -> "import"
title: -> "Vendor Check-In"
constructor: (args..., query) ->
super
@currentVendor = null
@itemIndex = 1
actions: -> [
['', (code) =>
code = fixToUppercase(code)
... | class @ItemCheckInMode extends ItemCheckoutMode
ModeSwitcher.registerEntryPoint("vendor_check_in", @)
glyph: -> "import"
title: -> "Vendor Check-In"
constructor: (args..., query) ->
super
@currentVendor = null
@itemIndex = 1
actions: -> [
['', (code) =>
code = fixToUppercase(code)
... |
Fix Manatee script: Heed location in redirect | # Description:
# Allows Hubot to pull down images from calmingmanatee.com
#
# Dependencies:
# "htmlparser": "1.7.6"
# "soupselect": "0.2.0"
#
# Configuration:
# None
#
# Commands:
# hubot manatee - outputs a random manatee
#
# Author:
# Danny Lockard
Select = require( "soupselect" ).select
HTMLParser = req... | # Description:
# Allows Hubot to pull down images from calmingmanatee.com
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot manatee - outputs a random manatee
#
# Author:
# Danny Lockard
module.exports = (robot) ->
robot.respond /manatee/i, (msg) ->
msg
... |
Add a FIXME for someone who wants a low hanging fruit | {expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
factors = ["foo", "bar", "baz"]
start = 20
end = 80
testMapping = (key, expected) ->
mapper = Collections("CategoricalMapper").create
source_range: Collections("FactorR... | {expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
# FIXME Would be nice to randomize the numbers
factors = ["foo", "bar", "baz"]
start = 20
end = 80
testMapping = (key, expected) ->
mapper = Collections("CategoricalMapper"... |
Make grade icon responsive to new input grades | angular.module('doubtfire.common.grade-icon', [])
.directive 'gradeIcon', ->
restrict: 'E'
replace: true
templateUrl: 'common/partials/templates/grade-icon.tpl.html'
scope:
inputGrade: '=?grade'
controller: ($scope, gradeService) ->
$scope.grade = if _.isString($scope.inputGrade) then gradeService.gr... | angular.module('doubtfire.common.grade-icon', [])
.directive 'gradeIcon', ->
restrict: 'E'
replace: true
templateUrl: 'common/partials/templates/grade-icon.tpl.html'
scope:
inputGrade: '=?grade'
controller: ($scope, gradeService) ->
$scope.$watch 'inputGrade', (newGrade) ->
return unless newGra... |
Add test for nested settings | Settings = require '../lib/settings.coffee'
describe "Settings", ->
describe ".load(settings)", ->
it "Loads the settings provided", ->
settings = new Settings()
settings.load({"foo.bar.baz": 42})
expect(atom.config.get("foo.bar.baz")).toBe 42
describe ".load(settings) with a 'scope' optio... | Settings = require '../lib/settings'
describe "Settings", ->
describe ".load(settings)", ->
it "Loads the settings provided if they are flat", ->
settings = new Settings()
settings.load({"foo.bar.baz": 42})
expect(atom.config.get("foo.bar.baz")).toBe 42
it "Loads the settings provided if... |
Fix missing key attribute for column header cell | React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports = React.createClass
getInitialState: ->
columnsWidths: []
columnsAligns: []
render: ->
{table, parentView} = @props
{columnsWidths, columnsAligns} = @state
cells = []
for column,index in table.getColu... | React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports = React.createClass
getInitialState: ->
columnsWidths: []
columnsAligns: []
render: ->
{table, parentView} = @props
{columnsWidths, columnsAligns} = @state
cells = []
for column,index in table.getColu... |
Remove obsolete month shortening function | jQuery = require 'jquery'
_ = require 'underscore'
exports.monthAbbr = (monthInt) ->
switch monthInt
when 0 then 'Jan'
when 1 then 'Feb'
when 2 then 'Mar'
when 3 then 'Apr'
when 4 then 'May'
when 5 then 'Jun'
when 6 then 'Jul'
when 7 then 'Aug'
... | jQuery = require 'jquery'
_ = require 'underscore'
exports.statusColor = (status) ->
switch status
when 'evaluating' then 'warning'
when 'approved' then 'info'
when 'paid' then 'success'
when 'incomplete', 'rejected' then 'danger'
else ''
exports.pageNumbers = (numPages, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.