Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Use jquery.ajax to perform state change on projects instead of auth.send | Dashboard.ProjectsTabController = Ember.ArrayController.extend Dashboard.SearchableBaseController, Dashboard.PaginableControllerMixin,
baseRouteName: 'projects'
defaultSearchFields:
query: null
between_created_at:
starts_at: null
ends_at: null
between_expires_at:
starts_at: null
... | Dashboard.ProjectsTabController = Ember.ArrayController.extend Dashboard.SearchableBaseController, Dashboard.PaginableControllerMixin,
baseRouteName: 'projects'
defaultSearchFields:
query: null
between_created_at:
starts_at: null
ends_at: null
between_expires_at:
starts_at: null
... |
Fix HTML injections in deploy output | # This is a manifest file that'll be compiled into application.js, which will include all the files
# listed below.
#
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
#
... | # This is a manifest file that'll be compiled into application.js, which will include all the files
# listed below.
#
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
#
... |
Simplify setting lastOpened serialized value | _ = require 'underscore'
module.exports =
projectPaths: null
fuzzyFinderView: null
loadPathsTask: null
activate: (state) ->
rootView.command 'fuzzy-finder:toggle-file-finder', =>
@createView().toggleFileFinder()
rootView.command 'fuzzy-finder:toggle-buffer-finder', =>
@createView().toggleB... | _ = require 'underscore'
module.exports =
projectPaths: null
fuzzyFinderView: null
loadPathsTask: null
activate: (state) ->
rootView.command 'fuzzy-finder:toggle-file-finder', =>
@createView().toggleFileFinder()
rootView.command 'fuzzy-finder:toggle-buffer-finder', =>
@createView().toggleB... |
Fix the hook for the source compile button | # Eventful code comes here
# Program state should not be manipulated outside events files
# Please note the following conventions:
#
# * Use jquery delegate in place of live
# http://jupiterjs.com/news/why-you-should-never-use-jquery-live
#
# Register document events
registerDOMEvents = () ->
state.viewport.do... | # Eventful code comes here
# Program state should not be manipulated outside events files
# Please note the following conventions:
#
# * Use jquery delegate in place of live
# http://jupiterjs.com/news/why-you-should-never-use-jquery-live
#
# Register document events
registerDOMEvents = () ->
state.viewport.do... |
Add workflow ID to tutorial subject | Subject = require 'models/subject'
module.exports = ->
Subject.create
id: '5077375154558fabd7000003'
zooniverseId: 'TUTORIAL_SUBJECT'
location: standard: [
'images/tutorial-subject/PICT0500.JPG'
'images/tutorial-subject/PICT0501.JPG'
'images/tutorial-subject/PICT0502.JPG'
]
co... | Subject = require 'models/subject'
module.exports = ->
Subject.create
id: '5077375154558fabd7000003'
zooniverseId: 'TUTORIAL_SUBJECT'
workflowId: '5077375154558fabd7000002'
location: standard: [
'images/tutorial-subject/PICT0500.JPG'
'images/tutorial-subject/PICT0501.JPG'
'images/t... |
Make keydownEvent helper method more realistic and add some :lipstick: | require 'coffee-cache'
beforeEach ->
document.querySelector('#jasmine-content').innerHTML = ""
exports.keydownEvent = (keyIdentifier, {ctrl, shift, alt, cmd, which, target}={}) ->
event = document.createEvent('KeyboardEvent')
bubbles = true
cancelable = true
view = null
keyIdentifier = keyIdentifier.toUpp... | require 'coffee-cache'
beforeEach ->
document.querySelector('#jasmine-content').innerHTML = ""
exports.keydownEvent = (key, {ctrl, shift, alt, cmd, which, target}={}) ->
event = document.createEvent('KeyboardEvent')
bubbles = true
cancelable = true
view = null
key = key.toUpperCase() if /^[a-z]$/.test(key... |
Allow duration to be configured | # This mess is probably going to get replaced with something like:
# http://ricostacruz.com/jquery.transit/
module.exports =
fade: ($el, options) ->
$el.
attr('data-state', 'fade-out').
one($.support.transition.end, ->
options.out() if options?.out?
$el.
attr('data-state', 'f... | module.exports =
fade: ($el, options = {}) ->
$el.
attr('data-state', 'fade-out').
one($.support.transition.end, ->
options.out() if options.out?
$el.
attr('data-state', 'fade-in').
one($.support.transition.end, ->
options.in() if options.in?
)... |
Rename unit test to update confusing test | ROOT = {}
sinon = require("sinon")
assert = require("assert")
require("../../src/environment").call(ROOT)
require("../../src/support/Widget").call(ROOT)
describe "widgets", ->
describe "el should be overideable", ->
before ->
this.OptionWidget = new ROOT.Widget(
el: "div"
)
this... | ROOT = {}
sinon = require("sinon")
assert = require("assert")
require("../../src/environment").call(ROOT)
require("../../src/support/Widget").call(ROOT)
describe "widgets", ->
describe "root should be overideable", ->
before ->
this.OptionWidget = new ROOT.Widget(
root: "div"
)
... |
Fix not passing broker address | msgflo = require 'msgflo'
path = require 'path'
chai = require 'chai' unless chai
heterogenous = require '../node_modules/msgflo/spec/heterogenous.coffee'
python = process.env.PYTHON or 'python'
participants =
'PythonRepeat': [python, path.join __dirname, '..', 'examples', 'repeat.py']
# Note: most require running ... | msgflo = require 'msgflo'
path = require 'path'
chai = require 'chai' unless chai
heterogenous = require '../node_modules/msgflo/spec/heterogenous.coffee'
python = process.env.PYTHON or 'python'
participants =
'PythonRepeat': [python, path.join __dirname, '..', 'examples', 'repeat.py']
# Note: most require running ... |
Use Script to load Sizzle.js | # Select document elements using Sizzle.js.
fs = require("fs")
sizzle = fs.readFileSync(__dirname + "/../../dep/sizzle.js", "utf8")
core = require("jsdom").dom.level3.core
close = core.HTMLDocument.prototype.close
core.HTMLDocument.prototype.close = ->
close.call this
window = @parentWindow
# Load Sizzle and ad... | # Select document elements using Sizzle.js.
fs = require("fs")
vm = process.binding("evals")
sizzle = new vm.Script(fs.readFileSync(__dirname + "/../../dep/sizzle.js", "utf8"), "sizzle.js")
core = require("jsdom").dom.level3.core
close = core.HTMLDocument.prototype.close
core.HTMLDocument.prototype.close = ->
close.... |
Update C++ custom header file type | "*":
Zen: {}
"atom-material-ui":
fonts: {}
"autocomplete-plus": {}
core:
disabledPackages: [
"markdown-preview"
]
themes: [
"atom-material-ui"
"solarized-dark-syntax"
]
editor:
invisibles: {}
softWrap: true
softWrapAtPreferredLineLength: true
tabLength: 4
... | "*":
Zen: {}
"atom-material-ui":
fonts: {}
"autocomplete-plus": {}
core:
customFileTypes:
"source.cpp": [
"h"
]
disabledPackages: [
"markdown-preview"
]
themes: [
"atom-material-ui"
"solarized-dark-syntax"
]
editor:
invisibles: {}
softWrap:... |
Add constructed instances to array | 'use strict'
class Route
ROUTES:
root:
title: 'Root'
url: '/'
partial: '#partial-home'
init: [Account]
notes:
title: 'Notes'
url: '/notes'
partial: '#partial-note'
init: [Note]
about:
title: 'About'
url: '/about'
partial: '#partial-home'
... | 'use strict'
class Route
ROUTES:
root:
title: 'Root'
url: '/'
partial: '#partial-home'
init: [Account]
notes:
title: 'Notes'
url: '/notes'
partial: '#partial-note'
init: [Note]
about:
title: 'About'
url: '/about'
partial: '#partial-home'
... |
Clean up dropdown binding click event code | define ['jquery', 'semantic', 'utils', 'charts'], ($, semantic, utils, charts) ->
currentCity = utils.getCookie('city')
availableCity = ['Guangzhou', 'Beijing', 'Shanghai', 'Chengdu', 'Shenyang']
currentCity = 'Guangzhou' if currentCity not in availableCity
charts.renderChart currentCity
# listen city click... | define ['jquery', 'semantic', 'utils', 'charts'], ($, semantic, utils, charts) ->
currentCity = utils.getCookie('city')
availableCity = ['Guangzhou', 'Beijing', 'Shanghai', 'Chengdu', 'Shenyang']
currentCity = 'Guangzhou' if currentCity not in availableCity
charts.renderChart currentCity
# listen city click... |
Call os kite from VM buttons. | class VirtualizationControls extends KDButtonGroupView
constructor:->
options =
cssClass : "virt-controls"
buttons :
"Start" :
callback : -> log "Start machine"
"Stop" :
callback : -> log "Stop machine"
"Turn Off" :
callback... | class VirtualizationControls extends KDButtonGroupView
constructor:->
options =
cssClass : "virt-controls"
buttons :
"Start" :
callback : ->
KD.singletons.kiteController.run
kiteName: 'os',
method: 'vm.start'
"Stop" ... |
Switch Atom to light theme | "*":
core:
telemetryConsent: "limited"
editor:
fontFamily: "Menlo"
invisibles: {}
softWrap: true
"exception-reporting":
userId: "0f9c4bca-c1e4-c885-1374-c2dd26290ade"
"spell-check": {}
tabs:
addNewTabsAtEnd: true
welcome:
showOnStartup: false
| "*":
core:
telemetryConsent: "limited"
themes: [
"one-light-ui"
"one-light-syntax"
]
editor:
fontFamily: "Menlo"
invisibles: {}
softWrap: true
"exception-reporting":
userId: "0f9c4bca-c1e4-c885-1374-c2dd26290ade"
"spell-check": {}
tabs:
addNewTabsAtEnd: true
welco... |
Use the req.user.id when making time entries | TimeEntriesController = require "#{__dirname}/../../controllers/time_entries"
TimeEntry = require "#{__dirname}/../../models/time_entry"
_ = require 'underscore'
handler = (app) ->
app.get '/time_entries', (req, res) ->
if typeof req.query.projectId isnt 'undefined'
TimeEntriesController.getForProject re... | TimeEntriesController = require "#{__dirname}/../../controllers/time_entries"
TimeEntry = require "#{__dirname}/../../models/time_entry"
_ = require 'underscore'
handler = (app) ->
app.get '/time_entries', (req, res) ->
if typeof req.query.projectId isnt 'undefined'
TimeEntriesController.getForProject re... |
Change urls for task view in FlowManager | ETahi.FlowManagerRoute = Ember.Route.extend
model: ->
@store.find("flow")
actions:
chooseNewFlowMangerColumn: ->
@render('chooseNewFlowManagerColumnOverlay',
into: 'application'
outlet: 'overlay'
controller: 'chooseNewFlowManagerColumnOverlay')
removeFlow: (flow) ->
... | ETahi.FlowManagerRoute = Ember.Route.extend
model: ->
@store.find("flow")
actions:
chooseNewFlowMangerColumn: ->
@render('chooseNewFlowManagerColumnOverlay',
into: 'application'
outlet: 'overlay'
controller: 'chooseNewFlowManagerColumnOverlay')
removeFlow: (flow) ->
... |
Include a setup method that only runs once on initialization | _ = require 'underscore'
Backbone = require 'backbone'
form = require '../../form/utilities.coffee'
module.exports = class StepView extends Backbone.View
__events__: null
events: ->
_.extend @__events__,
'click .js-nevermind': 'dismiss'
initialize: ({ @user, @state, @artwork }) -> #
template: ->
... | _ = require 'underscore'
Backbone = require 'backbone'
form = require '../../form/utilities.coffee'
module.exports = class StepView extends Backbone.View
__events__: null
events: ->
_.extend @__events__,
'click .js-nevermind': 'dismiss'
initialize: ({ @user, @state, @artwork }) ->
@__setup__()
... |
Add success alert messages on changing tutorial | 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 an initialization order goof. | #= require slickgrid
#= require SlickGrid/slick.dataview
#= require SlickGrid/slick.groupitemmetadataprovider
Pancakes.SearchResultsGrid = Ember.View.extend
columns: []
classNames: ['grid']
options: {}
# Build up the SlickGrid elements.
#
# The grid is the only visual element here; the rest are for groupi... | #= require slickgrid
#= require SlickGrid/slick.dataview
#= require SlickGrid/slick.groupitemmetadataprovider
Pancakes.SearchResultsGrid = Ember.View.extend
columns: []
classNames: ['grid']
options: {}
# Build up the SlickGrid elements.
#
# The grid is the only visual element here; the rest are for groupi... |
Set do not track to false if it doesn't exist | # Inject common project-wide [view locals](http://expressjs.com/api.html#app.locals).
{ parse, format } = require 'url'
_ = require 'underscore'
{ NODE_ENV } = require '../../config'
module.exports = (req, res, next) ->
res.locals.sd.CURRENT_URL = req.url
res.locals.sd.CURRENT_PATH = parse(req.url).pathname
res... | # Inject common project-wide [view locals](http://expressjs.com/api.html#app.locals).
{ parse, format } = require 'url'
_ = require 'underscore'
{ NODE_ENV } = require '../../config'
module.exports = (req, res, next) ->
res.locals.sd.CURRENT_URL = req.url
res.locals.sd.CURRENT_PATH = parse(req.url).pathname
res... |
Update handlebar snippets file type group |
# /////////////////////////////////////
# handlebars
# /////////////////////////////////////
'.text.handlebars':
'Ember: get':
'prefix': 'get'
'body': "{{get '${1}'}}"
'Ember: helper':
'prefix': 'helper'
'body': "{{${1:get} '${2}'}}"
'Ember: closure helper':
'prefix': 'chelper'
'body'... |
# /////////////////////////////////////
# handlebars
# /////////////////////////////////////
'.text.html.handlebars':
'Ember: get':
'prefix': 'get'
'body': "{{get '${1}'}}"
'Ember: helper':
'prefix': 'helper'
'body': "{{${1:get} '${2}'}}"
'Ember: closure helper':
'prefix': 'chelper'
'... |
Send room instead of roomId | App.IndexController = Ember.ArrayController.extend
needs: ["application"]
currentUser: Ember.computed.alias("controllers.application.currentUser")
itemController: "RoomUserStateItem"
detectMessageType: (msgTxt)->
if msgTxt.match("\n")
"paste"
else
"text"
actions:
postMessage: (msgT... | App.IndexController = Ember.ArrayController.extend
needs: ["application"]
currentUser: Ember.computed.alias("controllers.application.currentUser")
itemController: "RoomUserStateItem"
detectMessageType: (msgTxt)->
if msgTxt.match("\n")
"paste"
else
"text"
actions:
postMessage: (msgT... |
Add backUpBeforeSaving for Atom editor | "*":
core:
disabledPackages: [
"preview-tabs"
"script"
]
ignoredNames: [
".DS_Store"
".bundle"
".git"
]
projectHome: "/Users/justas/Projects"
editor:
fontFamily: "Menlo"
fontSize: 15
invisibles: {}
showIndentGuide: true
"exception-reporting":
u... | "*":
core:
disabledPackages: [
"preview-tabs"
"script"
]
ignoredNames: [
".DS_Store"
".bundle"
".git"
]
projectHome: "/Users/justas/Projects"
editor:
backUpBeforeSaving: true
fontFamily: "Menlo"
fontSize: 15
invisibles: {}
showIndentGuide: true
... |
Return an empty list of datasets if the xhr receives an error | class TimeSlider.Plugin.EOWCS
constructor: (@options = {})->
@formatDate = (date) ->
date = date.toISOString()
date = date.substring(0, date.length - 5)
date + "Z"
callback = (start, end, callback) =>
request = d3.xhr(WCS.EO.KVP.describeEOCoverageSet... | class TimeSlider.Plugin.EOWCS
constructor: (@options = {})->
@formatDate = (date) ->
date = date.toISOString()
date = date.substring(0, date.length - 5)
date + "Z"
callback = (start, end, callback) =>
request = d3.xhr(WCS.EO.KVP.describeEOCoverageSet... |
Fix overlay next / prev button positiono | $ ->
overlay = new Overlay('.js-open-overlay')
setCommentPaneHeight = (el) ->
overlay = $(el)
topRightHeight = overlay.find('.js-overlay-top-right').height()
commentPaneHeight = overlay.find('.js-overlay-right').innerHeight() - topRightHeight
commentList = overlay.find('.js-overlay-comments-container')
com... | $ ->
overlay = new Overlay('.js-open-overlay')
setCommentPaneHeight = (el) ->
overlay = $(el)
topRightHeight = overlay.find('.js-overlay-top-right').height()
commentPaneHeight = overlay.find('.js-overlay-right').innerHeight() - topRightHeight
commentList = overlay.find('.js-overlay-comments-container')
com... |
Update default crash report submission URL. | binding = process.atomBinding 'crash_reporter'
class CrashReporter
start: (options={}) ->
{productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
productName ?= 'Atom-Shell'
companyName ?= 'GitHub, Inc'
submitUrl ?= 'http://54.249.141.25'
autoSubmit ?= true
... | binding = process.atomBinding 'crash_reporter'
class CrashReporter
start: (options={}) ->
{productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
productName ?= 'atom-shell'
companyName ?= 'GitHub, Inc'
submitUrl ?= 'http://54.249.141.25:1127/post'
autoSubmit... |
Set canvas dimensions to the document dimensions | requirejs.config({
paths: {
fabric: [
'lib/fabric']
}
})
define ['game', 'synchronizedtime', 'position', 'lib/fabric', 'lib/jquery'], (Game, SynchronizedTime, Position) -> # Fabric is deliberately not set as an argument
console.log "Fabric: ", fabric
console.log "Position: ", new Position([1,2], 0, 5... | requirejs.config({
paths: {
fabric: [
'lib/fabric']
}
})
define ['game', 'synchronizedtime', 'position', 'lib/fabric', 'lib/jquery'], (Game, SynchronizedTime, Position) -> # Fabric is deliberately not set as an argument
canvas = $("#canvas")
canvas.width = document.body.clientWidth
canvas.height =... |
Use provided context payload to render tooltip | $(document).on 'peek:update', ->
resqueContext = $('#peek-context-resque')
if resqueContext.size()
context = resqueContext.data('context')
failures = context.jobs.failures
$('#resque-jobs-tooltip').attr('title', "Failures: #{failures}").tipsy()
| $(document).on 'peek:render', (event, data) ->
$('#resque-jobs-tooltip').attr('title', "Failures: #{data.context.resque.jobs.failures}").tipsy()
|
Reduce auto-complete to 3 results | 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... |
Fix sorting for apps in "manage your apps" view | ViewCollection = require 'lib/view_collection'
ApplicationRow = require 'views/config_application'
PopoverDescriptionView = require 'views/popover_description'
ApplicationsList = require '../collections/application'
module.exports = class ApplicationsListView extends ViewCollection
id: 'config-application-list'
... | ViewCollection = require 'lib/view_collection'
ApplicationRow = require 'views/config_application'
PopoverDescriptionView = require 'views/popover_description'
ApplicationsList = require '../collections/application'
module.exports = class ApplicationsListView extends ViewCollection
id: 'config-application-list'
... |
Remove git-history and git-time-machine from Atom | packages: [
"atom-beautify"
"atom-elixir"
"atom-wrap-in-tag"
"atomic-chrome"
"auto-update-packages"
"busy-signal"
"close-tags"
"date"
"elmjutsu"
"file-icons"
"git-history"
"git-plus"
"git-time-machine"
"highlight-selected"
"language-elixir"
"language-elm"
"language-erlang"
"language-... | packages: [
"atom-beautify"
"atom-elixir"
"atom-wrap-in-tag"
"atomic-chrome"
"auto-update-packages"
"busy-signal"
"close-tags"
"date"
"elmjutsu"
"file-icons"
"git-plus"
"highlight-selected"
"language-elixir"
"language-elm"
"language-erlang"
"language-haml"
"language-pug"
"language-rs... |
Fix scanner delay that prevented video from appearing | class @CommonDialogsQrcodeDialogViewController extends @DialogViewController
view:
videoCaptureContainer: '#video_capture_container'
qrcodeCheckBlock: null
onAfterRender: ->
super
@_startScanner()
show: ->
ledger.managers.permissions.request 'videoCapture', (granted) =>
_.defer => super... | class @CommonDialogsQrcodeDialogViewController extends @DialogViewController
view:
videoCaptureContainer: '#video_capture_container'
qrcodeCheckBlock: null
onAfterRender: ->
super
_.defer => @_startScanner()
show: ->
ledger.managers.permissions.request 'videoCapture', (granted) =>
_.def... |
Simplify recursive file search interface | fs = require 'fs'
path = require 'path'
# Finds all test files in the given directory.
class TestsFinder
constructor: (@directory) ->
# Returns the name of all files within the given directory that contain tests.
files: ->
files = []
@_search_directory @directory, files
files
_search_director... | fs = require 'fs'
path = require 'path'
# Finds all test files in the given directory.
class TestsFinder
constructor: (@directory) ->
# Returns the name of all files within the given directory that contain tests.
files: ->
@_search_directory @directory, []
# Adds all test files in the current directo... |
Use session stored in scope | class Wowser.ui.screens.Authentication
constructor: (@$scope, @$rootScope) ->
@session = new Wowser(Wowser.expansions.wotlk)
@host = 'localhost'
@username = ''
@password = ''
@session.auth.on 'connect', =>
@authenticate()
@session.auth.on 'authenticate', =>
@$rootScope.state = '... | class Wowser.ui.screens.Authentication
constructor: (@$scope) ->
@session = @$scope.session
@host = 'localhost'
@username = ''
@password = ''
@session.auth.on 'connect', =>
@authenticate()
@session.auth.on 'authenticate', =>
@$scope.$apply =>
@session.screen = 'realm-sel... |
Add more dummy data to example | document.write 'i dunno why i have to write or something to get body working T____T'
Grid = require './lib/javascripts/grid'
columns = new Backbone.Collection [
label: 'hello'
,
label: 'world'
]
grid = new Grid { columns }
grid.render()
document.querySelector('body').appendChild(grid.el)
| document.write 'i dunno why i have to write or something to get body working T____T'
Grid = require './lib/javascripts/grid'
columns = new Backbone.Collection [
{ label: 'hello', name: 'greeting' }
{ label: 'world', name: 'everyone' }
]
collection = new Backbone.Collection [
{ greeting: 'hola', everyone: 'todo... |
Add eventbrite to config example | # Facebook config
exports.facebook =
appId: null
secretKey: null
# Meetup config
exports.meetup = null # API key as string | # Facebook config
exports.facebook =
appId: null
secretKey: null
# Meetup config
exports.meetup = null # API key as string
#Eventbrite config
exports.eventbrite =
appKey: null |
Enable fuzzy filter for suggestions | fs = require 'fs'
path = require 'path'
module.exports =
selector: '.source.lua'
disableForSelector: '.source.lua .comment, .source.lua .string'
inclusionPriority: 10
excludeLowerPriority: true
getSuggestions: ( { editor, bufferPosition, scopeDescriptor, prefix, activatedManually } ) ->
i... | fs = require 'fs'
path = require 'path'
module.exports =
selector: '.source.lua'
disableForSelector: '.source.lua .comment, .source.lua .string'
inclusionPriority: 10
excludeLowerPriority: true
filterSuggestions: true
getSuggestions: ( { editor, bufferPosition, scopeDescriptor, prefix, activa... |
Load JS on country page correctly | require(['annular_sector'], (annularSector)->
$vizContainer = $('#protected-coverage-viz')
return false if $vizContainer.length == 0
$vizContainer.find('.viz').each (idx, el) ->
value = $(el).attr('data-value')
return if typeof +value isnt 'number' or +value is isNaN
data = [
{
value: v... | $(document).ready( ->
require(['annular_sector'], (annularSector)->
$vizContainer = $('#protected-coverage-viz')
return false if $vizContainer.length == 0
$vizContainer.find('.viz').each (idx, el) ->
value = $(el).attr('data-value')
return if typeof +value isnt 'number' or +value is isNaN
... |
Prepare support for MQTT, uncomment to enable | msgflo = require 'msgflo'
path = require 'path'
chai = require 'chai' unless chai
heterogenous = require '../node_modules/msgflo/spec/heterogenous.coffee'
participants =
'C++Repeat': [path.join __dirname, '..', 'build', './repeat-cpp']
describe 'Participants', ->
address = 'amqp://localhost'
g =
broker: nul... | msgflo = require 'msgflo'
path = require 'path'
chai = require 'chai' unless chai
heterogenous = require '../node_modules/msgflo/spec/heterogenous.coffee'
participants =
'C++Repeat': [path.join __dirname, '..', 'build', './repeat-cpp']
# Note: most require running an external broker service
transports =
#'MQTT': ... |
Fix XSS vulnerability in room not found name. | Template.roomNotFound.helpers
data: ->
return Session.get 'roomNotFound' | Template.roomNotFound.helpers
data: ->
return Session.get 'roomNotFound'
name: ->
return Blaze._escape(this.name)
|
Fix lmo href link function | angular.module('loomioApp').directive 'lmoHref', ($window, $router, LmoUrlService) ->
restrict: 'A'
scope:
path: '@lmoHref'
model: '=lmoHrefModel'
link: (scope, elem, attrs) ->
LmoUrlService.route(path: scope.path, model: scope.model, params: scope.params)
elem.attr 'href', ''
elem.bind 'click... | angular.module('loomioApp').directive 'lmoHref', ($window, $router, LmoUrlService) ->
restrict: 'A'
scope:
path: '@lmoHref'
model: '=lmoHrefModel'
link: (scope, elem, attrs) ->
route = LmoUrlService.route(path: scope.path, model: scope.model, params: scope.params)
elem.attr 'href', ''
elem.bin... |
Set uuid for course and register using an invite | _ = require 'underscore'
React = require 'react'
EventEmitter2 = require 'eventemitter2'
api = require '../api'
channel = new EventEmitter2 wildcard: true
class Course
constructor: (@collectionUUID) ->
api.channel.on "course.#{@collectionUUID}.registration.complete", ({data}) =>
_.extend(this, data)
... | _ = require 'underscore'
React = require 'react'
EventEmitter2 = require 'eventemitter2'
api = require '../api'
channel = new EventEmitter2 wildcard: true
class Course
constructor: (attributes) ->
_.extend(@, attributes)
api.channel.on "course.#{@ecosystem_book_uuid}.registration.complete", ({data}) =>
... |
Add current tag value to search field value on blur | React = require 'react'
Select = require 'react-select'
apiClient = require '../api/client'
debounce = require 'debounce'
module.exports = React.createClass
displayName: 'TagSearch'
getDefaultProps: ->
multi: true
searchTags: (value, callback) ->
if value is ''
callback null, { options: [] }
... | React = require 'react'
Select = require 'react-select'
apiClient = require '../api/client'
debounce = require 'debounce'
module.exports = React.createClass
displayName: 'TagSearch'
getDefaultProps: ->
multi: true
searchTags: (value, callback) ->
if value is ''
callback null, { options: [] }
... |
Add support for Heroku Redis-To-Go | Q = require 'kew'
nodeRedis = require 'redis'
mysql = require 'mysql'
config = require '../config'
connect =
ready: Q.defer()
###
* - type (string) : 'production', 'development', 'testing'
###
init: () ->
# Connect to MySQL
@mysql = mysql.createConnection config.mysql
# Conne... | Q = require 'kew'
url = require 'url'
redis = require 'redis'
mysql = require 'mysql'
config = require '../config'
connect =
ready: Q.defer()
###
* - type (string) : 'production', 'development', 'testing'
###
init: () ->
# Connect to MySQL
@mysql = mysql.createConnection config.mysql
... |
Refactor the magnum ci script | # Description:
# Find the build status of an open-source project on Travis
# Can also notify about builds, just enable the webhook notification on travis http://about.travis-ci.org/docs/user/build-configuration/ -> 'Webhook notification'
#
# Dependencies:
#
# Configuration:
# None
#
# Commands:
# hubot travis m... | # Description:
# Find the build status of an open-source project on Travis
# Can also notify about builds, just enable the webhook notification on travis http://about.travis-ci.org/docs/user/build-configuration/ -> 'Webhook notification'
#
# Dependencies:
#
# Configuration:
# None
#
# Commands:
# hubot travis m... |
Fix proxy for production api | gulp = require 'gulp'
connect = require 'connect'
httpProxy = require 'http-proxy'
harp = require 'harp'
http = require 'http'
url = require 'url'
livereload = require 'gulp-livereload'
server = livereload()
laerehost = if gulp.env.local then 'laeredev.co' else 'laere.co'
target =
host: laerehost
port: 80
proxy = h... | gulp = require 'gulp'
connect = require 'connect'
httpProxy = require 'http-proxy'
harp = require 'harp'
http = require 'http'
livereload = require 'gulp-livereload'
server = livereload()
proxy = httpProxy.createProxyServer()
LAERE_PORT = 1337
proxyMiddleware = (req, res) ->
# We wish to proxy to the production API... |
Rollback checkbox labels on cancel | ETahi.InlineEditCheckboxComponent = Em.Component.extend
editing: false
isNew: false
hasContent: Em.computed.notEmpty('bodyPart.value')
hasNoContent: Em.computed.not('hasContent')
checked: ((key, value, oldValue) ->
if arguments.length > 1
#setter
@set('bodyPart.answer', value)
else
... | ETahi.InlineEditCheckboxComponent = Em.Component.extend
editing: false
isNew: false
snapshot: {}
createSnapshot: (->
@set('snapshot', Em.copy(@get('bodyPart'), true))
).observes('editing')
hasContent: Em.computed.notEmpty('bodyPart.value')
hasNoContent: Em.computed.not('hasContent')
checked: ((k... |
Refactor not to use own error classes | errors = require './errors'
bodyParser = require 'body-parser'
defaultHeaders = (request, response, next) ->
response.header 'Content-Type', 'application/json; charset=utf-8'
next()
serverErrorHandling = (err, request, response, next) ->
if err
if err instanceof errors.HttpError
response.status(err.st... | bodyParser = require 'body-parser'
defaultHeaders = (request, response, next) ->
response.header 'Content-Type', 'application/json; charset=utf-8'
next()
serverErrorHandling = (err, request, response, next) ->
if err
console.error err
response.sendStatus 500
jsonParser = (request, response, next) ->
bo... |
Set top and left to 0 | # BeamWars - A multiplayer in-browser remake of the Mac game of the same name
# Copyright (C) 2013 Aaron Hill
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either vers... | # BeamWars - A multiplayer in-browser remake of the Mac game of the same name
# Copyright (C) 2013 Aaron Hill
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either vers... |
Simplify code to check form changes | App.WatchFormChanges =
forms: ->
return $("form[data-watch-changes]")
msg: ->
if($("[data-watch-form-message]").length)
return $("[data-watch-form-message]").data("watch-form-message")
checkChanges: ->
changes = false
App.WatchFormChanges.forms().each ->
form = $(this)
if form.... | App.WatchFormChanges =
forms: ->
return $("form[data-watch-changes]")
msg: ->
if($("[data-watch-form-message]").length)
return $("[data-watch-form-message]").data("watch-form-message")
hasChanged: ->
App.WatchFormChanges.forms().is ->
$(this).serialize() != $(this).data("watchChanges")
... |
Hide if slug is koding | class GroupAvatar extends JView
constructor:(options = {}, data)->
options.cssClass = 'group-avatar-drop'
groupsController = KD.getSingleton 'groupsController'
super options, groupsController.getCurrentGroupData()
groupsController.on 'GroupChanged', @bound 'render'
render:(slug, group)->
if ... | class GroupAvatar extends JView
constructor:(options = {}, data)->
options.cssClass = 'group-avatar-drop hidden'
groupsController = KD.getSingleton 'groupsController'
super options, groupsController.getCurrentGroupData()
groupsController.on 'GroupChanged', @bound 'render'
render:(slug, group)->
... |
Set alignment class on wrapper | class Lanes.Components.FormGroup extends Lanes.React.Component
mixins: [
Lanes.React.Mixins.ReadEditingState
Lanes.React.Mixins.FieldErrors
]
propTypes:
align: React.PropTypes.oneOf([
'right', 'left', 'center'
])
bindDataEvents: ->
model: "invalid-f... | class Lanes.Components.FormGroup extends Lanes.React.Component
mixins: [
Lanes.React.Mixins.ReadEditingState
Lanes.React.Mixins.FieldErrors
]
propTypes:
align: React.PropTypes.oneOf([
'right', 'left', 'center'
])
bindDataEvents: ->
model: "invalid-f... |
Test relative time or date | module "relative date"
test "this year", ->
now = moment()
el = addTimeEl type: "date", datetime: now.toISOString()
run()
equal getText(el), now.format("MMM D")
test "last year", ->
before = moment().subtract("years", 1).subtract("days", 1)
el = addTimeEl type: "date", datetime: before.toISOString()
r... | module "relative date"
test "this year", ->
now = moment()
el = addTimeEl type: "date", datetime: now.toISOString()
run()
equal getText(el), now.format("MMM D")
test "last year", ->
before = moment().subtract("years", 1).subtract("days", 1)
el = addTimeEl type: "date", datetime: before.toISOString()
ru... |
Make some changes to atom packages | "*":
"exception-reporting":
userId: "da976a4b-6a5d-3f34-7d9b-6bfdb74474ed"
welcome:
showOnStartup: false
"one-dark-ui": {}
core:
themes: [
"native-ui"
"base16-tomorrow-dark-theme"
]
disabledPackages: [
"ex-mode"
"vim-mode"
]
editor:
invisibles: {}
tabLen... | "*":
"exception-reporting":
userId: "da976a4b-6a5d-3f34-7d9b-6bfdb74474ed"
welcome:
showOnStartup: false
"one-dark-ui": {}
core:
themes: [
"native-ui"
"base16-tomorrow-dark-theme"
]
disabledPackages: [
]
editor:
invisibles: {}
tabLength: 4
fontSize: 12
"vim-mo... |
Change code for configuration to use config schema | provider = require('./emojis-provider')
module.exports =
configDefaults:
enableUnicodeEmojis: true
enableMarkdownEmojis: true
activate: ->
provider.loadProperties()
atom.commands.add 'atom-workspace',
'autocomplete-emojis:show-cheat-sheet': ->
require('./emoji-cheat-sheet').show()
... | provider = require('./emojis-provider')
module.exports =
config:
enableUnicodeEmojis:
type: 'boolean'
default: true
enableMarkdownEmojis:
type: 'boolean'
default: true
activate: ->
provider.loadProperties()
atom.commands.add 'atom-workspace',
'autocomplete-emojis:sho... |
Validate cookie for 30 days | @createCookie = (name, value, days) ->
expires = undefined
if days
date = new Date()
date.setTime date.getTime() + (days * 24 * 60 * 60 * 1000)
expires = "; expires=#{date.toGMTString()}"
else
expires = ''
document.cookie = "#{encodeURIComponent(name)}=#{encodeURIComponent(value)}#{expires}; pat... | @createCookie = (name, value, days) ->
expires = undefined
if days
date = new Date()
date.setTime date.getTime() + (days * 24 * 60 * 60 * 1000)
expires = "; expires=#{date.toGMTString()}"
else
expires = ''
document.cookie = "#{encodeURIComponent(name)}=#{encodeURIComponent(value)}#{expires}; pat... |
Use Promises for cli tool | numeral = require("numeral")
balance = require("./crypto-balance")
module.exports.run = ->
addr = process.argv[2]
unless addr
console.log "Usage: balance <address>"
process.exit 1
balance addr, (error, items) ->
if error
console.error error
process.exit 1
else
for item in ite... | numeral = require("numeral")
balance = require("./crypto-balance")
module.exports.run = ->
addr = process.argv[2]
unless addr
console.log "Usage: balance <address>"
process.exit 1
balance addr
.then (items) ->
for item in items
if item.status == 'success'
console.log "#{num... |
Fix test for IE8; don't match exact html, because .html() has upper cased HTML tags | helpers = if typeof require is 'undefined' then window.viewHelpers else require './view_helper'
class MockRequest extends MockClass
@chainedCallback 'success'
@chainedCallback 'error'
oldRequest = Batman.Request
QUnit.module 'Batman.View partial rendering'
setup: ->
MockRequest.reset()
Batman.Request = M... | helpers = if typeof require is 'undefined' then window.viewHelpers else require './view_helper'
class MockRequest extends MockClass
@chainedCallback 'success'
@chainedCallback 'error'
oldRequest = Batman.Request
QUnit.module 'Batman.View partial rendering'
setup: ->
MockRequest.reset()
Batman.Request = M... |
Fix spec helper still using up.util.all | u = up.util
beforeEach ->
jasmine.addMatchers
toMatchList: (util, customEqualityTesters) ->
compare: (actualList, expectedList) ->
actualList = u.toArray(actualList) if actualList
expectedList = u.toArray(expectedList) if expectedList
pass:
actualList &&
expec... | u = up.util
beforeEach ->
jasmine.addMatchers
toMatchList: (util, customEqualityTesters) ->
compare: (actualList, expectedList) ->
actualList = u.toArray(actualList) if actualList
expectedList = u.toArray(expectedList) if expectedList
pass:
actualList &&
expec... |
Fix error object when XHR failed | # Pre dependencies
# (none)
###*
@class XhrPromise
Promise-based XMLHttpRequest
###
module.exports = class XhrPromise
null
@get: (url, options) ->
return _get("text", url, options)
@getAsText: (url, options) ->
return _get("text", url, options)
@getAsArrayBuffer: (url, options) ->
return _get(... | # Pre dependencies
# (none)
###*
@class XhrPromise
Promise-based XMLHttpRequest
###
module.exports = class XhrPromise
null
@get: (url, options) ->
return _get("text", url, options)
@getAsText: (url, options) ->
return _get("text", url, options)
@getAsArrayBuffer: (url, options) ->
return _get(... |
Change text in advanced greedy theory | import contest from "../../lib/contest"
import label from "../../lib/label"
import link from "../../lib/link"
import page from "../../lib/page"
import problem from "../../lib/problem"
import topic from "../../lib/topic"
export default greedy_2 = () ->
return {
topic: topic("Жадные алгоритмы", "Задачи на жа... | import contest from "../../lib/contest"
import label from "../../lib/label"
import link from "../../lib/link"
import page from "../../lib/page"
import problem from "../../lib/problem"
import topic from "../../lib/topic"
export default greedy_2 = () ->
return {
topic: topic("Жадные алгоритмы", "Задачи на жа... |
Move to the connected event | Redis = require 'redis'
Url = require 'url'
info = Url.parse process.env.POO_REDIS_URL or "redis://localhost:6379/0"
redis_client = Redis.createClient(info.port, info.hostname)
redis_client.auth info.auth.split(":")[1] if info.auth
module.exports = (robot) ->
POO_TRACKER_KEY = "poops"
POO_LATEST_KEY = "poops:late... | Redis = require 'redis'
Url = require 'url'
info = Url.parse process.env.POO_REDIS_URL or "redis://localhost:6379/0"
redis_client = Redis.createClient(info.port, info.hostname)
redis_client.auth info.auth.split(":")[1] if info.auth
module.exports = (robot) ->
POO_TRACKER_KEY = "poops"
POO_LATEST_KEY = "poops:late... |
Add feature flag for github sync | Settings = require 'settings-sharelatex'
module.exports = Features =
externalAuthenticationSystemUsed: ->
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
hasFeature: (feature) ->
switch feature
when 'registration'
return not Features.externalAuthenticationSystemUsed()
else
throw new ... | Settings = require 'settings-sharelatex'
module.exports = Features =
externalAuthenticationSystemUsed: ->
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
hasFeature: (feature) ->
switch feature
when 'registration'
return not Features.externalAuthenticationSystemUsed()
when 'github-sync'
... |
Clarify wording on actual functionality of backwards compatibility | parse_pararms = (querystring) ->
params = {}
querystring = querystring.split('&')
for qs in querystring
continue if not qs
pair = qs.split('=')
params[decodeURIComponent pair[0]] = decodeURIComponent pair[1]
params
Meteor.Router.add
'/': ->
Session.set('params', parse_pararms @querystring)
... | parse_pararms = (querystring) ->
params = {}
querystring = querystring.split('&')
for qs in querystring
continue if not qs
pair = qs.split('=')
params[decodeURIComponent pair[0]] = decodeURIComponent pair[1]
params
Meteor.Router.add
'/': ->
Session.set('params', parse_pararms @querystring)
... |
Sort files by size but with directories on top | Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @director... | Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @director... |
Use percentages as ratios and full map bounds. | define ['URI', 'app/views/base', 'app/p13n'], (URI, base, p13n) ->
class ExportingView extends base.SMLayout
template: 'exporting'
events:
'click .exporting-button': 'exportEmbed'
exportEmbed: (ev) ->
EXPORT_PREVIEW_HOST = 'localhost'
url = URI window.loc... | define ['URI', 'app/views/base', 'app/p13n'], (URI, base, p13n) ->
class ExportingView extends base.SMLayout
template: 'exporting'
events:
'click .exporting-button': 'exportEmbed'
exportEmbed: (ev) ->
EXPORT_PREVIEW_HOST = 'localhost'
url = URI window.loc... |
Add droid sans to font list | 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'... | 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',
'Droid ... |
Fix nav item route matching | Marbles.Views.NavigationActive = class NavigationActiveView extends Marbles.View
@view_name: 'navigation_active'
@buildMappingRegexp: (mapping) ->
new RegExp("#{mapping.replace("*", ".*?")}")
initialize: ->
@active_class = Marbles.DOM.attr(@el, 'data-active-class')
@active_selector = Marbles.DOM.att... | Marbles.Views.NavigationActive = class NavigationActiveView extends Marbles.View
@view_name: 'navigation_active'
@buildMappingRegexp: (mapping) ->
new RegExp("^#{mapping.replace("*", ".*?")}$")
initialize: ->
@active_class = Marbles.DOM.attr(@el, 'data-active-class')
@active_selector = Marbles.DOM.a... |
Use polyfill method for specific pages | # Navigation
(($) ->
circle = $.sammy("body", ->
# Page
class Page
constructor: (@name, @title) ->
render: ->
document.title = "Circle - " + @title
$("body").attr("id",@name).html HAML['header'](renderContext)
$("body").append HAML[@name](renderContext)
$("body").... | # Navigation
(($) ->
circle = $.sammy("body", ->
# Page
class Page
constructor: (@name, @title) ->
render: ->
document.title = "Circle - " + @title
$("body").attr("id",@name).html HAML['header'](renderContext)
$("body").append HAML[@name](renderContext)
$("body").... |
Fix typo in haveOpacity() matcher (thanks @foobear) | u = up.util
e = up.element
$ = jQuery
beforeEach ->
jasmine.addMatchers
toHaveOpacity: (util, customEqualityTesters) ->
compare: (element, expectedOpacity, tolerance = 0.0) ->
element = e.get(element)
actualOpacity = e.styleNumber(element, 'opacity')
result = {}
result.pass ... | u = up.util
e = up.element
$ = jQuery
beforeEach ->
jasmine.addMatchers
toHaveOpacity: (util, customEqualityTesters) ->
compare: (element, expectedOpacity, tolerance = 0.0) ->
element = e.get(element)
actualOpacity = e.styleNumber(element, 'opacity')
result = {}
result.pass ... |
Fix jQuery wrap because poltergeist/phantomJS choked (got a JS error). | $(document).on 'page:load ready', ->
$('#circle_role_role_type').on 'change', (e)->
$type = $(e.target)
$name = $type.siblings('#circle_role_name')
console.log(e)
console.log($type.val())
if $type.val() == "circle.custom"
$name.removeClass("hidden")
else
$name.addClass("hidden")
... | $(document).on 'page:load ready', ->
$('#circle_role_role_type').on 'change', (e)->
$type = $(e.target)
$name = $type.siblings('#circle_role_name')
console.log(e)
console.log($type.val())
if $type.val() == "circle.custom"
$name.removeClass("hidden")
else
$name.addClass("hidden")
... |
Add custom load and activate method to Theme Package | AtomPackage = require './atom-package'
module.exports =
class ThemePackage extends AtomPackage
getType: -> 'theme'
getStylesheetType: -> 'theme'
enable: ->
atom.config.unshiftAtKeyPath('core.themes', @metadata.name)
disable: ->
atom.config.removeAtKeyPath('core.themes', @metadata.name)
| Q = require 'q'
AtomPackage = require './atom-package'
module.exports =
class ThemePackage extends AtomPackage
getType: -> 'theme'
getStylesheetType: -> 'theme'
enable: ->
atom.config.unshiftAtKeyPath('core.themes', @metadata.name)
disable: ->
atom.config.removeAtKeyPath('core.themes', @metadata.nam... |
Handle css live reloading correctly. | module.exports = (grunt) ->
return {
express:
files: [
'Gruntfile.coffee'
'server-src/*.coffee'
'config/*.yml'
]
options:
spawn: false
tasks: ['copy:app', 'coffee:server', 'express:dev']
client:
files: [
'<%= src %>/*.coffee'
'<%= s... | module.exports = (grunt) ->
return {
express:
files: [
'Gruntfile.coffee'
'server-src/*.coffee'
'config/*.yml'
]
options:
spawn: false
tasks: ['copy:app', 'coffee:server', 'express:dev']
client:
files: [
'<%= src %>/*.coffee'
'<%= s... |
Add keymaps supported by Linux and Windows | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://ato... | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://ato... |
Add support for data-expand links. | initPage = ->
# Fix stupid Chrome bug.
# See https://code.google.com/p/chromium/issues/detail?id=388664
#
$('form').each ->
$(this).attr('action', this.action);
# Autofocus form fields with autofocus. We need to do this even though
# browsers do it natively because (due to Turbolinks), we're always jus... | initPage = ->
# Fix stupid Chrome bug.
# See https://code.google.com/p/chromium/issues/detail?id=388664
#
$('form').each ->
$(this).attr('action', this.action);
# Autofocus form fields with autofocus. We need to do this even though
# browsers do it natively because (due to Turbolinks), we're always jus... |
Fix discussion prop-name in search result | React = require 'react'
DiscussionPreview = require './discussion-preview'
CommentLink = require './comment-link'
CommentPreview = require './comment-preview'
PromiseRenderer = require '../components/promise-renderer'
parseSection = require './lib/parse-section'
apiClient = require '../api/client'
# This isn't very re... | React = require 'react'
DiscussionPreview = require './discussion-preview'
CommentLink = require './comment-link'
CommentPreview = require './comment-preview'
PromiseRenderer = require '../components/promise-renderer'
parseSection = require './lib/parse-section'
apiClient = require '../api/client'
# This isn't very re... |
Include price_range when hitting trending endpoints | _ = require 'underscore'
Backbone = require 'backbone'
Genes = require '../../../../collections/genes.coffee'
{ Following } = require '../../../../components/follow_button/index.coffee'
priceBuckets = require '../mixins/price_buckets.coffee'
module.exports =
initializeGeneArtists:... | _ = require 'underscore'
Backbone = require 'backbone'
Genes = require '../../../../collections/genes.coffee'
{ Following } = require '../../../../components/follow_button/index.coffee'
priceBuckets = require '../mixins/price_buckets.coffee'
module.exports =
initializeGeneArtists:... |
Change first param of `getMemberSubscriptions` to `user_or_id`, to match semantics of usage. | Subscription = require('../../models/Subscription').Subscription
logger = require("logger-sharelatex")
ObjectId = require('mongoose').Types.ObjectId
module.exports =
getUsersSubscription: (user_or_id, callback)->
if user_or_id? and user_or_id._id?
user_id = user_or_id._id
else if user_or_id?
user_id = user... | Subscription = require('../../models/Subscription').Subscription
logger = require("logger-sharelatex")
ObjectId = require('mongoose').Types.ObjectId
module.exports =
getUsersSubscription: (user_or_id, callback)->
if user_or_id? and user_or_id._id?
user_id = user_or_id._id
else if user_or_id?
user_id = user... |
Add safe checks for image dimensions | noflo = require 'noflo'
path = require 'path'
utils = require '../utils'
# @runtime noflo-nodejs
# @name SWTDetect
exports.getComponent = ->
c = new noflo.Component
c.icon = 'font'
c.description = 'Stroke Width Transform text detector'
c.inPorts.add 'canvas',
datatype: 'object'
description: 'Canvas o... | noflo = require 'noflo'
path = require 'path'
utils = require '../utils'
# @runtime noflo-nodejs
# @name SWTDetect
exports.getComponent = ->
c = new noflo.Component
c.icon = 'font'
c.description = 'Stroke Width Transform text detector'
c.inPorts.add 'canvas',
datatype: 'object'
description: 'Canvas o... |
Fix github fetching code running everywhere | Testributor.Pages ||= {}
class Testributor.Pages.ProjectWizard
show: ()->
$(".multi-select").select2()
$fetchRepos = $('.js-fetch-repos')
$fetchingRepos = $('.js-fetching-repos')
currentPath = $fetchRepos.data('current-path')
Pace.ignore(->
jqxhr = $.get(currentPath, (data, xhr)->
... | Testributor.Pages ||= {}
class Testributor.Pages.ProjectWizard
show: ()->
$(".multi-select").select2()
$fetchRepos = $('.js-fetch-repos')
$fetchingRepos = $('.js-fetching-repos')
currentPath = $fetchRepos.data('current-path')
if currentPath
Pace.ignore(->
jqxhr = $.get(currentPath,... |
Fix typo in menu bar | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
'context-menu':
'atom-text-editor': [
{
'label': 'Toggle atom-ethereum-interface'
'command': 'eth-interface:toggle'
}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Atom Ethereum In... | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
'context-menu':
'atom-text-editor': [
{
'label': 'Toggle atom-ethereum-interface'
'command': 'eth-interface:toggle'
}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Atom Ethereum In... |
Fix the numbering for total slides | class window.PageTitle
constructor: (@reveal, @prefix) ->
@title = document.querySelector 'title'
@prefix ?= @title.innerHTML
@total = document.querySelectorAll(".reveal .slides > section:not(.stack)").length + 1
@reveal.addEventListener 'slidechanged', => @render arguments...
@render(indexh: @re... | class window.PageTitle
constructor: (@reveal, @prefix) ->
@title = document.querySelector 'title'
@prefix ?= @title.innerHTML
@total = document.querySelectorAll(".reveal .slides > section:not(.stack)").length
@reveal.addEventListener 'slidechanged', => @render arguments...
@render(indexh: @reveal... |
Change error type for consistency | NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__pro... | NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__pro... |
Use UserService inside session to ensure identical conversions | angular.module('kassa').service('SessionService',[
'$http'
'$q'
'$window'
($http, $q, $window)->
currentUser = null
equal = angular.equals
setAuthenticated = (promise)-> promise.then (resp)-> currentUser = resp.data.user
checkStatus = -> setAuthenticated $http.get('/users/me')
signIn = (... | angular.module('kassa').service('SessionService',[
'$http'
'$q'
'$window'
'UserService'
($http, $q, $window, User)->
currentUser = null
equal = angular.equals
setUser = (user)-> currentUser = user
checkStatus = -> User.find('me').then(setUser)
signIn = (email, password, rememberMe=true... |
Change module declaration on MnoeApiSvc | angular.module 'frontendAdmin'
.factory 'MnoeApiSvc', ($log, Restangular, inflector) ->
return Restangular.withConfig((RestangularProvider) ->
RestangularProvider.setBaseUrl('/mnoe/jpi/v1')
RestangularProvider.setDefaultHeaders({Accept: "application/json"})
# Unwrap api response
Restangul... | @App.factory 'MnoeApiSvc', ($log, Restangular, inflector) ->
return Restangular.withConfig((RestangularProvider) ->
RestangularProvider.setBaseUrl('/mnoe/jpi/v1')
RestangularProvider.setDefaultHeaders({Accept: "application/json"})
# Unwrap api response
RestangularProvider.addResponseInterceptor(
... |
Fix merging of parameters for granule queries | #= require models/data/xhr_model
ns = @edsc.models.data
ns.Granules = do (ko, getJSON=jQuery.getJSON, XhrModel=ns.XhrModel, extend=$.extend) ->
class GranulesModel extends XhrModel
constructor: (query, @parentQuery) ->
super('/granules.json', query)
_toResults: (data) ->
results = data.feed.en... | #= require models/data/xhr_model
ns = @edsc.models.data
ns.Granules = do (ko, getJSON=jQuery.getJSON, XhrModel=ns.XhrModel, extend=$.extend) ->
class GranulesModel extends XhrModel
constructor: (query, @parentQuery) ->
super('/granules.json', query)
_toResults: (data) ->
results = data.feed.en... |
Fix gutter rendering when sorted | React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports = React.createClass
render: ->
{firstRow, lastRow, totalRows, gutter, height, parentView} = @props
rows = for row in [firstRow...lastRow]
classes = ['table-edit-row-number']
classes.push 'active-row' if pare... | React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports = React.createClass
render: ->
{firstRow, lastRow, totalRows, gutter, height, parentView} = @props
rows = for row in [firstRow...lastRow]
classes = ['table-edit-row-number']
classes.push 'active-row' if pare... |
Stop referencing the old style naming for util/privacy. | # Helper class to contain status messages from the OFX response.
type = require 'lang/type'
class Status
constructor: (@code, @status, @message) ->
isSuccess: ->
@code in ["0", "1"]
isError: ->
not @isSuccess()
isGeneralError: ->
@code is '2000'
isAuthenticationError: ->
@code is '15500'... | # Helper class to contain status messages from the OFX response.
type = require 'lang/type'
privacy = require 'util/privacy'
class Status
constructor: (@code, @status, @message) ->
isSuccess: ->
@code in ["0", "1"]
isError: ->
not @isSuccess()
isGeneralError: ->
@code is '2000'
isAuthenticat... |
Use Pane::activate instead of PaneView::focus | MarkdownPreviewView = require './markdown-preview-view'
module.exports =
activate: ->
atom.workspaceView.command 'markdown-preview:show', =>
@show()
atom.workspace.registerOpener (uriToOpen) ->
fs = require 'fs-plus'
url = require 'url'
{protocol, pathname} = url.parse(uriToOpen)
... | MarkdownPreviewView = require './markdown-preview-view'
module.exports =
activate: ->
atom.workspaceView.command 'markdown-preview:show', =>
@show()
atom.workspace.registerOpener (uriToOpen) ->
fs = require 'fs-plus'
url = require 'url'
{protocol, pathname} = url.parse(uriToOpen)
... |
Add results of schema query to debug output. | {Client} = require "mysql"
fs = require "fs"
context =
compiler: require "../../lib/compiler"
object: { id: 1, rgt: 1, lft: 2, permalink: "home" }
reflector: (callback) ->
configuration = JSON.parse fs.readFileSync("#{__dirname}/../../configuration.json", "utf8")
mysql = configuration.databases.mysql
... | {Client} = require "mysql"
fs = require "fs"
context =
compiler: require "../../lib/compiler"
object: { id: 1, rgt: 1, lft: 2, permalink: "home" }
reflector: (callback) ->
configuration = JSON.parse fs.readFileSync("#{__dirname}/../../configuration.json", "utf8")
mysql = configuration.databases.mysql
... |
Use the configured default extension | sysPath = require 'path'
compileHBS = require './ember-handlebars-compiler'
module.exports = class EmberHandlebarsCompiler
brunchPlugin: yes
type: 'template'
extension: 'hbs'
precompile: off
root: null
modulesPrefix: 'module.exports = '
constructor: (@config) ->
if @config.files.templates.preco... | sysPath = require 'path'
compileHBS = require './ember-handlebars-compiler'
module.exports = class EmberHandlebarsCompiler
brunchPlugin: yes
type: 'template'
extension: 'hbs'
precompile: off
root: null
modulesPrefix: 'module.exports = '
constructor: (@config) ->
if @config.files.templates.preco... |
Add more prefix to turblinks | ###
# Copyright 2015-2017 ppy Pty. Ltd.
#
# This file is part of osu!web. osu!web is distributed with the hope of
# attracting more community contributions to the core ecosystem of osu!.
#
# osu!web is free software: you can redistribute it and/or modify
# it under the terms of the Affero GNU General Pub... | ###
# Copyright 2015-2017 ppy Pty. Ltd.
#
# This file is part of osu!web. osu!web is distributed with the hope of
# attracting more community contributions to the core ecosystem of osu!.
#
# osu!web is free software: you can redistribute it and/or modify
# it under the terms of the Affero GNU General Pub... |
Use --force to enable tests on Node 0.1 through 10 | 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'
coffeelint:
options:
no_empty_param_list:
level: 'erro... | 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'
coffeelint:
options:
no_empty_param_list:
level: 'erro... |
Update search query to check if contains string | express = require 'express'
xmler = require 'node-xmler'
router = express.Router()
# GET: /explore
router.get '/', (req, res) ->
# TODO: Show latest letters
res.render 'explore/index',
title: req.config.title
# GET: /explore/search
router.get '/search', (req, res) ->
client = req.baseXClient
query =
... | express = require 'express'
xmler = require 'node-xmler'
router = express.Router()
# GET: /explore
router.get '/', (req, res) ->
# TODO: Show latest letters
res.render 'explore/index',
title: req.config.title
# GET: /explore/search
router.get '/search', (req, res) ->
client = req.baseXClient
query =
... |
Add translator as a Talk role | module.exports = [
# Role | Can access:
"admin" # admin, moderator, ream, all
"moderator" # moderator, team, all
"team" # team, all
"all" # all *
]
| module.exports = [
# Role | Can access:
"admin" # admin, moderator, team, translator, all
"moderator" # moderator, team, translator, all
"team" # team, translator, all
"translator" # translator, all
"all" # all *
]
|
Use position: absolute instead of relative for better positioning | FactlinkJailRoot.showProxyMessage = ->
content = """
<div class="proxy-message">
<strong>Factlink Browser</strong>
<ul>
<li>Get the <a target="_blank" href="https://factlink.com">extension</a> to add discussions on every site</li>
<li>Or <a target="_blank" href="https://factlink.com/p/... | FactlinkJailRoot.showProxyMessage = ->
content = """
<div class="proxy-message">
<strong>Factlink Browser</strong>
<ul>
<li>Get the <a target="_blank" href="https://factlink.com">extension</a> to add discussions on every site</li>
<li>Or <a target="_blank" href="https://factlink.com/p/... |
Add a test for buffer as parameter | require './test_helpers'
crc = require('../src')
describe 'CRC', ->
it 'should have a shortcut hexdigest', ->
string = '1234567890'
expected = '0d'
crc.crc1(string).should.equal expected
| require './test_helpers'
crc = require('../src')
describe 'CRC', ->
it 'should have a shortcut hexdigest', ->
string = '1234567890'
expected = '0d'
crc.crc1(string).should.equal expected
it 'buffer as parameter is also support', ->
buffer = new Buffer '1234567890'
expected = '0d'
crc.crc1... |
Add AB test for Artist Insights V2 | # Centralizes configuration for currently running split tests
#
# eg.
# header_design:
# key: 'header_design'
# outcomes:
# old: 8
# new: 2
#
# Or, `outcomes` can be an array, when you specify `weighting: 'equal'.
# weighting: 'equal'
# outcomes: [
# 'old'
# 'new'
# ]
# edge: 'new'
# dimen... | # Centralizes configuration for currently running split tests
#
# eg.
# header_design:
# key: 'header_design'
# outcomes:
# old: 8
# new: 2
#
# Or, `outcomes` can be an array, when you specify `weighting: 'equal'.
# weighting: 'equal'
# outcomes: [
# 'old'
# 'new'
# ]
# edge: 'new'
# dimen... |
Add email title to user. Could be a proper tooltip? | crypto = require 'crypto'
{View} = require 'space-pen'
module.exports =
class ParticipantView extends View
@content: ->
@div class: 'collaboration-participant overlay floating large', =>
@video autoplay: true, outlet: 'video'
@div class: 'volume-container', outlet: 'volumeContainer', =>
@div cl... | crypto = require 'crypto'
{View} = require 'space-pen'
module.exports =
class ParticipantView extends View
@content: ->
@div class: 'collaboration-participant overlay floating large', =>
@video autoplay: true, outlet: 'video'
@div class: 'volume-container', outlet: 'volumeContainer', =>
@div cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.