Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Update to Atom 1.15.0 default | # Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybind... | # Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybind... |
Add confirmation to player delete | Polymer
is: 'league-controller'
properties:
league: Object
leagueId:
type: String,
observer: '_leagueIdChanged'
leagueAttrs: Object
players:
type: Object
observer: '_onPlayersChange'
playerModels: Array
newPlayer: ->
event.preventDefault()
league = @league
... | Polymer
is: 'league-controller'
properties:
league: Object
leagueId:
type: String,
observer: '_leagueIdChanged'
leagueAttrs: Object
players:
type: Object
observer: '_onPlayersChange'
playerModels: Array
newPlayer: ->
event.preventDefault()
league = @league
... |
Replace notify view to NotifyView | Marionette = require "marionette"
CommentCollectionView = require "./comment/collectionView"
PlayingNotifierView = require "./nowPlaying/nowPlayingView"
module.exports =
class NcoMainLayout extends Marionette.LayoutView
template : require "./view.jade"
regions :
comment : "#nco-comm... | Marionette = require "marionette"
CommentCollectionView = require "./comment/collectionView"
NotifyView = require "./notify/NotifyView"
module.exports =
class NcoMainLayout extends Marionette.LayoutView
template : require "./view.jade"
regions :
comment : "#nco-comments"
notify ... |
Switch out view to login and back on completion | React = require 'react'
BS = require 'react-bootstrap'
UserStatus = require '../user/status'
{ExerciseStep} = require '../exercise'
STEP_ID = '4571'
Demo = React.createClass
displayName: 'Demo'
render: ->
demos =
exercise: <ExerciseStep id={STEP_ID}/>
demos = _.map(demos, (demo, name) ->
<BS... | React = require 'react'
BS = require 'react-bootstrap'
UserStatus = require '../user/status'
UserLoginButton = require '../user/login-button'
UserLogin = require '../user/login'
{ExerciseStep} = require '../exercise'
STEP_ID = '4571'
Demo = React.createClass
displayName: 'Demo'
onAttemptLogin: ->
@setState... |
Update menus to use custom tag selectors | 'context-menu':
'.tab': [
{label: 'Close Tab', command: 'tabs:close-tab'}
{label: 'Close Other Tabs', command: 'tabs:close-other-tabs'}
{label: 'Close Tabs to the Right', command: 'tabs:close-tabs-to-right'}
{label: 'Close Saved Tabs', command: 'tabs:close-saved-tabs'}
{label: 'Close All Tabs', co... | 'context-menu':
'tabs-tab': [
{label: 'Close Tab', command: 'tabs:close-tab'}
{label: 'Close Other Tabs', command: 'tabs:close-other-tabs'}
{label: 'Close Tabs to the Right', command: 'tabs:close-tabs-to-right'}
{label: 'Close Saved Tabs', command: 'tabs:close-saved-tabs'}
{label: 'Close All Tabs'... |
Change thing by ID to thing by name route and close new argument modal right. | Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
@controllerFor('arguments.index').set 'thingId', @modelFor('thing').id
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
setupContr... | Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
@controllerFor('arguments.index').set 'thingName', @modelFor('thing')._data.name
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
... |
Enable to set timeout as command line option. | StockXmlImport = require('../main').StockXmlImport
fs = require 'fs'
argv = require('optimist')
.usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --xmlfile file')
.demand(['projectKey', 'clientId', 'clientSecret', 'xmlfile'])
.argv
options =
config:
project_key: argv.projectKey
cli... | StockXmlImport = require('../main').StockXmlImport
fs = require 'fs'
argv = require('optimist')
.usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --xmlfile file --timeout timeout')
.demand(['projectKey', 'clientId', 'clientSecret', 'xmlfile'])
.argv
timeout = argv.timeout
timeout or= 60000
... |
Add some layaut to command line usage. | fs = require 'fs'
package_json = require '../package.json'
StockXmlImport = require('../main').StockXmlImport
argv = require('optimist')
.usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --xmlfile file --timeout timeout')
.default('timeout', 300000)
.describe('projectKey', 'your SPHERE.IO pro... | fs = require 'fs'
package_json = require '../package.json'
StockXmlImport = require('../main').StockXmlImport
argv = require('optimist')
.usage('Usage: $0 --projectKey [key] --clientId [id] --clientSecret [secret] --xmlfile [file] --timeout [timeout]')
.default('timeout', 300000)
.describe('projectKey', 'your SPH... |
Correct bad property name mapping in inspector-panel | NodeEditView= React.createFactory require '../node-edit-view'
LinkEditView= React.createFactory require '../link-edit-view'
{div, i} = React.DOM
module.exports = React.createClass
displayName: 'InspectorPanelView'
getInitialState: ->
expanded: true
collapse: ->
@setState {expanded: false}
expand: ... | NodeEditView= React.createFactory require '../node-edit-view'
LinkEditView= React.createFactory require '../link-edit-view'
{div, i} = React.DOM
module.exports = React.createClass
displayName: 'InspectorPanelView'
getInitialState: ->
expanded: true
collapse: ->
@setState {expanded: false}
expand: ... |
Add serialization version to image and archive edit sessions | fsUtils = require 'fs-utils'
path = require 'path'
_ = require 'underscore'
archive = require 'ls-archive'
File = require 'file'
module.exports=
class ArchiveEditSession
registerDeserializer(this)
@activate: ->
Project = require 'project'
Project.registerOpener (filePath) ->
new ArchiveEditSession(f... | fsUtils = require 'fs-utils'
path = require 'path'
_ = require 'underscore'
archive = require 'ls-archive'
File = require 'file'
module.exports=
class ArchiveEditSession
registerDeserializer(this)
@version: 1
@activate: ->
Project = require 'project'
Project.registerOpener (filePath) ->
new Archiv... |
Set phase positions on client side to prevent awkward position correction in callback | ETahi.PaperManageController = Ember.ObjectController.extend
sortedPhases: ( ->
Ember.ArrayProxy.createWithMixins(Em.SortableMixin, {
content: @get('model.phases')
sortProperties: ['position']
})
).property('model.phases.@each')
actions:
addPhase: (position) ->
paper = @get('model')
... | ETahi.PaperManageController = Ember.ObjectController.extend
sortedPhases: ( ->
Ember.ArrayProxy.createWithMixins(Em.SortableMixin, {
content: @get('model.phases')
sortProperties: ['position']
})
).property('model.phases.@each')
updatePositions: (phase)->
relevantPhases = _(this.get('model... |
Set pin-message permissions only on insert | Meteor.startup ->
RocketChat.settings.add 'Message_AllowPinning', true, { type: 'boolean', group: 'Message', public: true }
RocketChat.models.Permissions.upsert('pin-message', {$addToSet: {roles: {$each: ['owner', 'moderator', 'admin']}}})
| Meteor.startup ->
RocketChat.settings.add 'Message_AllowPinning', true, { type: 'boolean', group: 'Message', public: true }
RocketChat.models.Permissions.upsert('pin-message', { $setOnInsert: { roles: ['owner', 'moderator', 'admin'] } });
|
Revert "force usage of jQuery 2 from jquery-rails" | #= require jquery2
#= require ./jquery_ui
#= require jquery_ujs
#= require_self
#= require_tree ./lib
#= require_tree ./ext
#= require_tree ./initializers
window.ActiveAdmin = {}
| #= require jquery
#= require ./jquery_ui
#= require jquery_ujs
#= require_self
#= require_tree ./lib
#= require_tree ./ext
#= require_tree ./initializers
window.ActiveAdmin = {}
|
Make authentication take at least one second, to prevent revealing whether a username exists based on timing |
errors = require 'errors'
{threshold} = require 'limits'
exports.$endpoint = ->
limiter:
message: "You are logging in too much."
threshold: threshold(3).every(30).seconds()
receiver: (req, fn) ->
switch req.body.method
when 'local'
(req.passport.authenticate 'local', (error, user, info) ... |
Promise = require 'bluebird'
errors = require 'errors'
{threshold} = require 'limits'
exports.$endpoint = ->
limiter:
message: "You are logging in too much."
threshold: threshold(3).every(30).seconds()
receiver: (req, fn) ->
{passport} = req
loginPromise = switch req.body.method
when 'loca... |
Update user notes on text change | { formatMoney } = require 'accounting'
StepView = require './step.coffee'
createSlider = require '../../../../../components/slider/index.coffee'
template = -> require('../../templates/price_range.jade') arguments...
module.exports = class PriceRangeView extends StepView
formatter: (val, index) ->
if index is 0
... | { formatMoney } = require 'accounting'
StepView = require './step.coffee'
createSlider = require '../../../../../components/slider/index.coffee'
template = -> require('../../templates/price_range.jade') arguments...
module.exports = class PriceRangeView extends StepView
events:
'keyup #anything-else' : 'update... |
Add default keybinding for go-to-page command | '.platform-darwin .pdf-view':
'cmd-+': 'pdf-view:zoom-in'
'cmd-=': 'pdf-view:zoom-in'
'cmd--': 'pdf-view:zoom-out'
'cmd-_': 'pdf-view:zoom-out'
'cmd-0': 'pdf-view:reset-zoom'
'.platform-win32 .pdf-view, .platform-linux .pdf-view':
'ctrl-+': 'pdf-view:zoom-in'
'ctrl-=': 'pdf-view:zoom-in'
'ctrl--': 'pdf... | '.pdf-view':
'ctrl-g': 'pdf-view:go-to-page'
'.platform-darwin .pdf-view':
'cmd-+': 'pdf-view:zoom-in'
'cmd-=': 'pdf-view:zoom-in'
'cmd--': 'pdf-view:zoom-out'
'cmd-_': 'pdf-view:zoom-out'
'cmd-0': 'pdf-view:reset-zoom'
'.platform-win32 .pdf-view, .platform-linux .pdf-view':
'ctrl-+': 'pdf-view:zoom-in'... |
Handle back path for login page |
@registryadmin.controller 'RegistryLoginCtrl', [
"$scope"
"registrydataService"
"registryloginService"
"$q"
"$location"
"$rootScope"
($scope,registrydataService,registryloginService,$q,$location,$rootScope) ->
scopeDestroyed = false
registryloginService.clearCredentials()
$scope.error = ''
... |
@registryadmin.controller 'RegistryLoginCtrl', [
"$scope"
"registrydataService"
"registryloginService"
"$q"
"$location"
"$rootScope"
($scope,registrydataService,registryloginService,$q,$location,$rootScope) ->
scopeDestroyed = false
registryloginService.clearCredentials()
$scope.error = ''
... |
Update amd-tamer task to use variables and new naming scheme | module.exports =
dist:
options:
namespace: '<%= package.name %>',
base: 'src/'
src: ['src/**/*.js'],
dest: 'build/debug/js/<%= package.name %>.js'
all:
options:
footer: '//# sourceMappingURL=all.js.map'
base: 'build/debug/js'
src: ['build/debug/js/**/*.js']
dest: 'bui... | module.exports =
dist:
options:
namespace: '<%= package.name %>',
base: 'src/'
src: ['src/**/*.js'],
dest: '<%= buildDebug %>/js/<%= package.name %>.js'
all:
options:
footer: '//# sourceMappingURL=all.js.map'
base: '<%= buildDebug %>/js'
src: ['<%= buildDebug %>/js/**/*.j... |
Fix for rendering Field Settings for default fields | _ = require 'underscore'
View = require 'lib/view'
FormMixin = require 'views/base/mixins/form'
FieldTypeSettingsView = require 'views/fields/settings'
mediator = require 'mediator'
tpl = require 'templates/fields/edit'
module.exports = class FieldEditView extends View
template: tpl
events:
'submit form': 's... | _ = require 'underscore'
View = require 'lib/view'
FormMixin = require 'views/base/mixins/form'
FieldTypeSettingsView = require 'views/fields/settings'
mediator = require 'mediator'
tpl = require 'templates/fields/edit'
module.exports = class FieldEditView extends View
template: tpl
events:
'submit form': 's... |
Switch from using incorrect lodash function in analytics service | angular.module("doubtfire.services.analytics", [])
#
# Services for analytics
#
.factory("analyticsService", ($analytics, currentUser) ->
analyticsService = {}
#
# Logs a new event
#
# For consistency, use like this:
# category: 'Visualisations' (Pluralised)
# eventName: 'Refreshed All' (Past-Tense)
... | angular.module("doubtfire.services.analytics", [])
#
# Services for analytics
#
.factory("analyticsService", ($analytics, currentUser) ->
analyticsService = {}
#
# Logs a new event
#
# For consistency, use like this:
# category: 'Visualisations' (Pluralised)
# eventName: 'Refreshed All' (Past-Tense)
... |
Add error handling for dynamically loaded API routes | express = require 'express'
cookieParser = require 'cookie-parser'
bodyParser = require 'body-parser'
expressSession = require 'express-session'
colors = require 'colors'
passport = require './lib/auth'
util = require './lib/util'
config = require './config'
module.exports = app = express()
app.set 'views', 'public/... | express = require 'express'
cookieParser = require 'cookie-parser'
bodyParser = require 'body-parser'
expressSession = require 'express-session'
colors = require 'colors'
passport = require './lib/auth'
util = require './lib/util'
config = require './config'
module.exports = app = express()
app.set 'views', 'public/... |
Use skinny arrow for WrapGuide.initialize() | {View} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class WrapGuideView extends View
@activate: ->
rootView.eachEditor (editor) =>
editor.underlayer.append(new WrapGuideView(editor)) if editor.attached
@content: ->
@div class: 'wrap-guide'
defaultColumn: 80... | {View} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class WrapGuideView extends View
@activate: ->
rootView.eachEditor (editor) =>
editor.underlayer.append(new WrapGuideView(editor)) if editor.attached
@content: ->
@div class: 'wrap-guide'
defaultColumn: 80... |
Add embed-terms info to supported routes | #
# Pages like Terms of Use, Privacy, etc. that display relatively static content.
#
express = require 'express'
routes = require './routes'
app = module.exports = express()
app.set 'views', __dirname
app.set 'view engine', 'jade'
app.get '/terms', routes.vanityUrl('terms')
app.get '/past-terms', routes.vanityU... | #
# Pages like Terms of Use, Privacy, etc. that display relatively static content.
#
express = require 'express'
routes = require './routes'
app = module.exports = express()
app.set 'views', __dirname
app.set 'view engine', 'jade'
app.get '/terms', routes.vanityUrl('terms')
app.get '/past-terms', routes.vanityU... |
Clear vendor search with empty input. | class @VendorFindMode extends CheckoutMode
ModeSwitcher.registerEntryPoint("vendor_find", @)
constructor: (args..., query) ->
super
@vendorList = new VendorList()
@query = query
enter: ->
super
@cfg.uiRef.body.append(@vendorList.render())
if @query?
Api.vendor_find(q: @query).done... | class @VendorFindMode extends CheckoutMode
ModeSwitcher.registerEntryPoint("vendor_find", @)
constructor: (args..., query) ->
super
@vendorList = new VendorList()
@query = query
enter: ->
super
@cfg.uiRef.body.append(@vendorList.render())
if @query?
@onSearchVendor(@query)
glyp... |
Fix a bug which linked URL is invalid | Vue = require "vue/dist/vue"
escape = require "../filters/escape"
linkify = require "../filters/linkify"
newLine = require "../filters/newLine"
module.exports = Vue.extend
methods:
filter: (text) ->
text = escape text
text = newLine text
text = linkify text
text
mounted: ->
$comme... | Vue = require "vue/dist/vue"
escape = require "../filters/escape"
linkify = require "../filters/linkify"
newLine = require "../filters/newLine"
module.exports = Vue.extend
methods:
filter: (text) ->
text = escape text
text = linkify text
text = newLine text
text
mounted: ->
$comme... |
Use the collections' url for the paginator | class window.Followers extends Backbone.Paginator.requestPager
model: User,
server_api:
take: -> @perPage
skip: -> (@currentPage-1) * @perPage
paginator_core:
dataType: "json",
url: -> "/#{@user.get('username')}/followers"
paginator_ui:
perPage: 3
firstPage: 1
currentPage: 1
... | class window.Followers extends Backbone.Paginator.requestPager
model: User,
server_api:
take: -> @perPage
skip: -> (@currentPage-1) * @perPage
paginator_core:
dataType: "json",
url: -> @url()
paginator_ui:
perPage: 3
firstPage: 1
currentPage: 1
initialize: (models, opts) ->
... |
Add more event emitter wildcard tests | should = require 'should'
sinon = require 'sinon'
shouldSinon = require 'should-sinon'
KDEventEmitterWildcard = require '../../lib/core/eventemitterwildcard'
describe 'KDEventEmitterWildcard', ->
beforeEach ->
@instance = new KDEventEmitterWildcard
it 'exists', ->
KDEventEmitterWildcard.should.exist
d... | should = require 'should'
sinon = require 'sinon'
shouldSinon = require 'should-sinon'
KDEventEmitterWildcard = require '../../lib/core/eventemitterwildcard'
describe 'KDEventEmitterWildcard', ->
beforeEach ->
@instance = new KDEventEmitterWildcard
emitSpy = sinon.spy @instance.emit
it 'exists', ->
K... |
Add util methods for creating a high res canvas element | App.Utils =
hexToRgb: (hex) ->
result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec hex;
if result
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
else
null
| App.Utils =
hexToRgb: (hex) ->
result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec hex;
if result
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
else
null
# http://stackoverflow.com/questions/15661339/how-do-i-fix-blurry-text-in-my-html5-canvas
getPixelRat... |
Disable stream when output to clipboard. | module.exports =
class ProcessConfig
constructor: (object={}) ->
@namespace = 'Process Palette';
@action = null;
@command = null;
@arguments = [];
@cwd = null;
@env = {};
@keystroke = null;
@stream = false;
@outputTarget = 'panel';
@reuseOutputTarget = true;
@maxCompleted ... | module.exports =
class ProcessConfig
constructor: (object={}) ->
@namespace = 'Process Palette';
@action = null;
@command = null;
@arguments = [];
@cwd = null;
@env = {};
@keystroke = null;
@stream = false;
@outputTarget = 'panel';
@reuseOutputTarget = true;
@maxCompleted ... |
Add ability to remove terms from list | # Description:
# Business cat is summoned when business jargon is used
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_BUSINESS_CAT_JARGON comma-separated list of additional "tiggers"
#
# Commands:
# Business jargon - summons business cat
#
# Notes:
# See jargon array for list of trigger phrases
#
# Autho... | # Description:
# Business cat is summoned when business jargon is used
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_BUSINESS_CAT_JARGON comma-separated list of additional "tiggers"
#
# Commands:
# Business jargon - summons business cat
#
# Notes:
# See jargon array for list of trigger phrases
#
# Autho... |
Add try/catch to check localStorage support | window.lesson = {}
window.lesson.applyScrollEffect = (classList, options) ->
@prevST = 0
@scrollTimer = null
if localStorage.getItem('scrollAlertShown')
$('.scroll-effect-alert').alert('close')
else
$('.scroll-effect-alert .close').click(-> localStorage.setItem('scrollAlertShown', 'tru... | window.lesson = {}
window.lesson.applyScrollEffect = (classList, options) ->
@prevST = 0
@scrollTimer = null
@localStorageSupport = ->
test = ->
support = 'support'
localStorage.setItem(support, support)
localStorage.removeItem(support)
return true
... |
Fix broken css on some input text | ###*
* @namespace OpenOrchestra:FormBehavior
###
window.OpenOrchestra or= {}
window.OpenOrchestra.FormBehavior or= {}
###*
* @class ValidateHidden
###
class OpenOrchestra.FormBehavior.ValidateHidden extends OpenOrchestra.FormBehavior.AbstractFormBehavior
###*
* activateBehaviorOnElements
* @param {Array} el... | ###*
* @namespace OpenOrchestra:FormBehavior
###
window.OpenOrchestra or= {}
window.OpenOrchestra.FormBehavior or= {}
###*
* @class ValidateHidden
###
class OpenOrchestra.FormBehavior.ValidateHidden extends OpenOrchestra.FormBehavior.AbstractFormBehavior
###*
* activateBehaviorOnElements
* @param {Array} el... |
Switch min and max in Math.clamp if max > min | ((window, Elyssa) ->
# Elyssa.Math
# Static class
# @mixin
Elyssa.Math =
# Clamps a value between a minimum and maximum
#
# @param {Number} The value that needs to be clamped
# @param {Number} Minimum (Optional, set to 0.0 by default)
# @param {Number} Maximum (Optional, set to 1.0 by def... | ((window, Elyssa) ->
# Elyssa.Math
# Static class
# @mixin
Elyssa.Math =
# Clamps a value between a minimum and maximum
#
# @param {Number} The value that needs to be clamped
# @param {Number} Minimum (Optional, set to 0.0 by default)
# @param {Number} Maximum (Optional, set to 1.0 by def... |
Remove caching on auction lots until we can get headers working | _ = require 'underscore'
Artist = require '../../models/artist'
AuctionLots = require '../../collections/auction_lots'
@artist = (req, res) ->
artist = null
auctionLots = null
currentPage = parseInt req.query.page || 1
sort = req.query.sort
render = _.after 2, ->
res.render... | _ = require 'underscore'
Artist = require '../../models/artist'
AuctionLots = require '../../collections/auction_lots'
@artist = (req, res) ->
artist = null
auctionLots = null
currentPage = parseInt req.query.page || 1
sort = req.query.sort
render = _.after 2, ->
res.render... |
Fix issue with ctrl-k keybinding in Atom | '.workspace':
'ctrl-h': 'window:focus-pane-on-left'
'ctrl-j': 'window:focus-pane-below'
'ctrl-k': 'window:focus-pane-above'
'ctrl-l': 'window:focus-pane-on-right'
'ctrl-|': 'pane:split-right'
'ctrl--': 'pane:split-down'
'alt-g j': 'git-diff:move-to-next-diff'
'alt-g k': 'git-diff:move-to-previous-diff... | '.workspace, .editor':
'ctrl-h': 'window:focus-pane-on-left'
'ctrl-j': 'window:focus-pane-below'
'ctrl-k': 'window:focus-pane-above'
'ctrl-l': 'window:focus-pane-on-right'
'.workspace':
'ctrl-|': 'pane:split-right'
'ctrl--': 'pane:split-down'
'alt-g j': 'git-diff:move-to-next-diff'
'alt-g k': 'git-dif... |
Update V2 API endpoint path. | request = require('request')
module.exports = class API
constructor: (apiKey) ->
@apiKey = apiKey
getCourseFromRoom: (building, room, done) ->
apiURL = @apiURLForEndpoint("buildings/#{building}/#{room}/courses")
options = {
uri: apiURL
headers: {'User-Agent': 'Roomular (https://github.com... | request = require('request')
module.exports = class API
constructor: (apiKey) ->
@apiKey = apiKey
getCourseFromRoom: (building, room, done) ->
apiURL = @apiURLForEndpoint("buildings/#{building}/#{room}/courses")
options = {
uri: apiURL
headers: {'User-Agent': 'Roomular (https://github.com... |
Add 401 error test cases | "use strict"
assert = require 'assert'
server = require '../coffee/server.coffee'
cookie = null
before (done) ->
opts =
method: 'POST'
url: '/login'
payload: 'username=turbo%40dnt.org&password=helttopp'
headers:
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Length': 42
... | "use strict"
assert = require 'assert'
server = require '../coffee/server.coffee'
cookie = null
before (done) ->
opts =
method: 'POST'
url: '/login'
payload: 'username=turbo%40dnt.org&password=helttopp'
headers:
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Length': 42
... |
Remove reference to spec-launcher, which no longer exists | SpecLauncher = require './spec-launcher'
SpecRunnerView = require './spec-runner-view'
configUri = "atom://spec-runner"
module.exports =
activate: (state) ->
atom.project.registerOpener (uri) =>
@specRunnerView = new SpecRunnerView if uri is configUri
atom.config.setDefaults "spec-runner",
com... | SpecRunnerView = require './spec-runner-view'
configUri = "atom://spec-runner"
module.exports =
activate: (state) ->
atom.project.registerOpener (uri) =>
@specRunnerView = new SpecRunnerView if uri is configUri
atom.config.setDefaults "spec-runner",
command: "rspec"
atom.workspaceView.com... |
Make sure fancybox updates after things ajax in | RunLoop.register ->
for el in $('[data-replace-self-on-load]')
url = $(el).data('replace-self-on-load')
$(el).removeAttr('data-replace-self-on-load')
$.get url, (html) ->
$(el).replaceWith(html)
| RunLoop.register ->
for el in $('[data-replace-self-on-load]')
url = $(el).data('replace-self-on-load')
$(el).removeAttr('data-replace-self-on-load')
$.get url, (html) ->
$(el).replaceWith(html)
$.fancybox.update()
|
Add jQuery on click event handler for search | #=require d3
$ ->
$(".report.repository-select").on 'change', (e) =>
repository = $(".report.repository-select").val()
window.location = "repository?show=#{repository}"
$(".dropdown-toggle").dropdown()
| #=require d3
$ ->
$(".report.repository-select").on 'change', (event) =>
repository = $(".report.repository-select").val()
window.location = "repository?show=#{repository}"
$(".dropdown-toggle").dropdown()
$("a.report.search").on 'click', (event) =>
parameter = $(event.target).data('parameter')
|
Add source.coffee.jsx to list of selectors. | coffee = require 'coffee-script'
configManager = require '../config-manager'
cjsx_transform = null
module.exports =
id: 'coffee-compile'
selector: [
'source.coffee'
'source.litcoffee'
'text.plain'
'text.plain.null-grammar'
]
compiledScope: 'source.js'
preCompile: (code, editor) ->
... | coffee = require 'coffee-script'
configManager = require '../config-manager'
cjsx_transform = null
module.exports =
id: 'coffee-compile'
selector: [
'source.coffee'
'source.coffee.jsx'
'source.litcoffee'
'text.plain'
'text.plain.null-grammar'
]
compiledScope: 'source.js'
preCompi... |
Update to use sentence case 'Log out' | React = require 'react'
{CurrentUserStore} = require '../../flux/current-user'
classnames = require 'classnames'
LOGOUT_URL = '/accounts/logout'
LOGOUT_URL_CC = '/accounts/logout?cc=true'
CSRF_Token = CurrentUserStore.getCSRFToken()
LogoutLink = React.createClass
propTypes:
label: React.PropTypes.string
get... | React = require 'react'
{CurrentUserStore} = require '../../flux/current-user'
classnames = require 'classnames'
LOGOUT_URL = '/accounts/logout'
LOGOUT_URL_CC = '/accounts/logout?cc=true'
CSRF_Token = CurrentUserStore.getCSRFToken()
LogoutLink = React.createClass
propTypes:
label: React.PropTypes.string
get... |
Call Hubot.loadBot with the correct params. | # This is the Hubot Loading Bay. NPM uses it as an entry point.
#
# Hubot = require 'hubot'
# YourBot = Hubot.robot 'campfire', 'yourbot'
# Loads a Hubot robot
exports.loadBot = (adapterName, botName) ->
robot = require './src/robot'
new robot adapterName, botName
exports.robot = ->
require './src/robo... | # This is the Hubot Loading Bay. NPM uses it as an entry point.
#
# Hubot = require 'hubot'
# YourBot = Hubot.robot 'campfire', 'yourbot'
# Loads a Hubot robot
exports.loadBot = (adapterPath, adapterName, botName) ->
robot = require './src/robot'
new robot adapterPath, adapterName, botName
exports.robot ... |
Trim white spaces during email validation | koding = require './../bongo'
{ getClientId } = require './../helpers'
module.exports = (req, res) ->
{ JUser } = koding.models
{ password, email, tfcode } = req.body
return res.status(400).send 'Bad request' unless email?
{ password, redirect } = req.body
clientId = getClientId req,... | koding = require './../bongo'
{ getClientId } = require './../helpers'
module.exports = (req, res) ->
{ JUser } = koding.models
{ password, email, tfcode } = req.body
unless email? and (email = email.trim()).length isnt 0
return res.status(400).send 'Bad request'
{ password, redirect ... |
Improve protected branches page UX | $ ->
$(".protected-branches-list :checkbox").change ->
name = $(this).attr("name")
if name == "developers_can_push"
id = $(this).val()
checked = $(this).is(":checked")
url = $(this).data("url")
$.ajax
type: "PUT"
url: url
dataType: "json"
data:
... | $ ->
$(".protected-branches-list :checkbox").change (e) ->
name = $(this).attr("name")
if name == "developers_can_push"
id = $(this).val()
checked = $(this).is(":checked")
url = $(this).data("url")
$.ajax
type: "PUT"
url: url
dataType: "json"
data:
... |
Use hubot convention of env var | # Description
# A hubot script that shows who has the longest github streak in your org
#
# Configuration:
# LIST_OF_ENV_VARS_TO_SET
# ORG_ACCESS_TOKEN
#
# Commands:
# streak ladder - <Gets a list of the longest github commit streaks in your org>
#
# Notes:
# An access token is required by the github api to a... | # Description
# A hubot script that shows who has the longest github streak in your org
#
# Configuration:
# LIST_OF_ENV_VARS_TO_SET
# HUBOT_ORG_ACCESS_TOKEN
#
# Commands:
# streak ladder - <Gets a list of the longest github commit streaks in your org>
#
# Notes:
# An access token is required by the github ap... |
Use process.env.PORT to find the proroduction port | module.exports =
development:
port: 3000
production:
port: 80
| module.exports =
development:
port: 3000
production:
port: process.env.PORT || 80
|
Fix the import progress not having the correct translations | Template.adminImportProgress.helpers
step: ->
return Template.instance().step.get()
completed: ->
return Template.instance().completed.get()
total: ->
return Template.instance().total.get()
Template.adminImportProgress.onCreated ->
instance = @
@step = new ReactiveVar t('Loading...')
@completed = new React... | Template.adminImportProgress.helpers
step: ->
return Template.instance().step.get()
completed: ->
return Template.instance().completed.get()
total: ->
return Template.instance().total.get()
Template.adminImportProgress.onCreated ->
instance = @
@step = new ReactiveVar t('Loading...')
@completed = new React... |
Hide Octospinner when opening in new tab/new window. | ready = ->
$('.js-navigation').on('click', -> $('.loading-indicator').show())
$(document).ready(ready)
$(document).on('page:load', ready)
| ready = ->
$('.js-navigation').on('click', (event) ->
if (event.ctrlKey or # New tab (windows)
event.shiftKey or # New window
event.metaKey or # New tab (mac)
(event.button and event.button == 1) # New tab (middle click)
)
return
return $('.loading-indicator').show())
$(document).ready(... |
Fix for when the array is empty | do ($$ = Quo) ->
VENDORS = [ "-webkit-", "-moz-", "-ms-", "-o-", "" ]
$$.fn.addClass = (name) ->
@each ->
unless _existsClass(name, @className)
@className += " " + name
@className = @className.trim()
$$.fn.removeClass = (name) ->
@each ->
... | do ($$ = Quo) ->
VENDORS = [ "-webkit-", "-moz-", "-ms-", "-o-", "" ]
$$.fn.addClass = (name) ->
@each ->
unless _existsClass(name, @className)
@className += " " + name
@className = @className.trim()
$$.fn.removeClass = (name) ->
@each ->
... |
Add century to year field format. | filters = angular.module 'qiprofile.filters', []
filters.filter 'capitalize', ->
(s) -> _.str.capitalize(s)
filters.filter 'moment', ->
(s) -> moment(s).format('MM/DD/YY')
filters.filter 'visitDates', ->
(sessions) ->
sess.acquisition_date() for sess in sessions
| filters = angular.module 'qiprofile.filters', []
filters.filter 'capitalize', ->
(s) -> _.str.capitalize(s)
filters.filter 'moment', ->
(s) -> moment(s).format('MM/DD/YYYY')
filters.filter 'visitDates', ->
(sessions) ->
sess.acquisition_date() for sess in sessions
|
Resolve atom.sh and apm relative to app dir | fs = require 'fs'
path = require 'path'
async = require 'async'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'run-specs', 'Run the specs', ->
passed = true
done = @async()
atomPath = path.resolve('atom.sh')
apmPath = path.resolve('node_modules/.bin/apm... | fs = require 'fs'
path = require 'path'
async = require 'async'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'run-specs', 'Run the specs', ->
passed = true
done = @async()
appDir = grunt.config.get('atom.appDir')
atomPath = path.join(appDir, 'atom.sh')... |
Include image files in cache busting for Rails. | exports.config = (config) ->
# File path glob patterns.
# All file paths matching these glob patterns will be watched for changes,
# and when they are detected, the matching URL cache will be expired.
config.watch "app/assets/**"
config.watch "vendor/assets/**"
# Match file paths to their corresponding URL... | exports.config = (config) ->
# File path glob patterns.
# All file paths matching these glob patterns will be watched for changes,
# and when they are detected, the matching URL cache will be expired.
config.watch "app/assets/**"
config.watch "vendor/assets/**"
# Match file paths to their corresponding URL... |
Change test environment AWS region to us-west-1 | AWS = require 'aws-sdk'
AWS.config.region = 'us-east-1'
AWS.config.update
accessKeyId : 'AKIAJTAPKSDXI4FIXGJA'
secretAccessKey : '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'
module.exports = AWS
| AWS = require 'aws-sdk'
AWS.config.region = 'us-west-1'
AWS.config.update
accessKeyId : 'AKIAJTAPKSDXI4FIXGJA'
secretAccessKey : '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'
module.exports = AWS
|
Refactor variable parsing test helpers | VariableParser = require '../lib/variable-parser'
describe 'VariableParser', ->
[parser] = []
itParses = (expression) ->
description: ''
asColor: (variable) ->
[expectedName] = Object.keys(variable)
expectedValue = variable[expectedName]
it "parses the '#{expression}' as a color variabl... | VariableParser = require '../lib/variable-parser'
describe 'VariableParser', ->
[parser] = []
itParses = (expression) ->
description: ''
as: (variable, lastIndex) ->
[expectedName] = Object.keys(variable)
expectedValue = variable[expectedName]
lastIndex ?= expression.length
it "pa... |
Update file icons on service change | FileIcons = require './file-icons'
module.exports =
activate: (state) ->
@tabBarViews = []
TabBarView = require './tab-bar-view'
_ = require 'underscore-plus'
@paneSubscription = atom.workspace.observePanes (pane) =>
tabBarView = new TabBarView
tabBarView.initialize(pane)
paneEle... | FileIcons = require './file-icons'
module.exports =
activate: (state) ->
@tabBarViews = []
TabBarView = require './tab-bar-view'
_ = require 'underscore-plus'
@paneSubscription = atom.workspace.observePanes (pane) =>
tabBarView = new TabBarView
tabBarView.initialize(pane)
paneEle... |
Use SecureValue field for password input | require "forge.bundle.js"
WsseDynamicValue = ->
this.username = ""
this.password = ""
this.evaluate = ->
time = (new Date()).toISOString()
nonce = forge.util.bytesToHex forge.random.getBytesSync 10
nonce64 = forge.util.encode64 nonce
md = forge.md.sha1.create()
md.update nonce + time + th... | require "forge.bundle.js"
WsseDynamicValue = ->
this.username = ""
this.password = ""
this.evaluate = ->
time = (new Date()).toISOString()
nonce = forge.util.bytesToHex forge.random.getBytesSync 10
nonce64 = forge.util.encode64 nonce
md = forge.md.sha1.create()
md.update nonce + time + th... |
Add back coffee-script require but don't assign it | fs = require 'fs'
path = require 'path'
delegate = require 'atom_delegate'
optimist = require 'optimist'
atomApplication = null
delegate.browserMainParts.preMainMessageLoopRun = ->
commandLineArgs = parseCommandLine()
require('module').globalPaths.push(path.join(commandLineArgs.resourcePath, 'src'))
AtomApplica... | fs = require 'fs'
path = require 'path'
delegate = require 'atom_delegate'
optimist = require 'optimist'
require 'coffee-script'
atomApplication = null
delegate.browserMainParts.preMainMessageLoopRun = ->
commandLineArgs = parseCommandLine()
require('module').globalPaths.push(path.join(commandLineArgs.resourcePat... |
Remove random errorIds from retrievalError, reference valid var name | # galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity.
# Copyright (C) 2013 Matthew Farmer - Distributed Under the GNU AGPL 3.0. See LICENSE at project root.
module.exports = (app, jobs, db) ->
ObjectId = require('mongodb').ObjectID;
retrievalError = (error, res) ->
error... | # galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity.
# Copyright (C) 2013 Matthew Farmer - Distributed Under the GNU AGPL 3.0. See LICENSE at project root.
module.exports = (app, jobs, db) ->
ObjectId = require('mongodb').ObjectID;
retrievalError = (error, res) ->
res.j... |
Remove a stray console.log call. | {BaseClass} = require "./BaseClass"
{Events} = require "./Events"
Events.MIDICommand = "midiCommand"
class MIDIInput extends BaseClass
@define "enabled",
get: -> @_inputs?.length or @_request
set: (value) ->
return unless value != @enabled
return @_requestRejected() if not navigator.requestMIDIAccess
i... | {BaseClass} = require "./BaseClass"
{Events} = require "./Events"
Events.MIDICommand = "midiCommand"
class MIDIInput extends BaseClass
@define "enabled",
get: -> @_inputs?.length or @_request
set: (value) ->
return unless value != @enabled
return @_requestRejected() if not navigator.requestMIDIAccess
i... |
Add maxAge for static files | stylus = require 'stylus'
express = require 'express'
{ basename, join } = require 'path'
browserify = do (browserify = require 'browserify-middleware') ->
(path) -> browserify path, transform: [ 'coffeeify', 'jadeify2' ]
module.exports = ->
@set 'public', join __dirname, '..', 'public'
@use stylus.middleware ... | stylus = require 'stylus'
express = require 'express'
{ basename, join } = require 'path'
browserify = do (browserify = require 'browserify-middleware') ->
(path) -> browserify path, transform: [ 'coffeeify', 'jadeify2' ]
module.exports = ->
@set 'public', join __dirname, '..', 'public'
@use stylus.middleware ... |
Fix flash error method using wrong attributes | Trade.Flash = Ember.Mixin.create
needs: 'application'
application: Ember.computed.alias('controllers.application')
notification: Ember.computed.alias('controllers.application.notification')
flashSuccess: (options) ->
@get('application').notify({
title: "Done"
message: options.message,
type... | Trade.Flash = Ember.Mixin.create
needs: 'application'
application: Ember.computed.alias('controllers.application')
notification: Ember.computed.alias('controllers.application.notification')
flashSuccess: (options) ->
@get('application').notify({
title: "Done"
message: options.message,
type... |
Change linux keymap to match others | '.platform-darwin atom-text-editor':
'ctrl-shift-u': 'encoding-selector:show'
'.platform-win32 atom-text-editor':
'ctrl-shift-u': 'encoding-selector:show'
'.platform-linux atom-text-editor':
'ctrl-u': 'encoding-selector:show'
| '.platform-darwin atom-text-editor':
'ctrl-shift-u': 'encoding-selector:show'
'.platform-win32 atom-text-editor':
'ctrl-shift-u': 'encoding-selector:show'
'.platform-linux atom-text-editor':
'alt-u': 'encoding-selector:show'
|
Add competitor name to autocomplete suggestion. | $(document).ready ->
autocompleteURL = $("#competitor_wca").attr("data-url")
auto = $("#competitor_wca").typeahead {
minLength: 6
},{
source: (q, callback) ->
$.getJSON(autocompleteURL + "?q=#{q}")
.done (result) ->
callback(result)
matcher: (item) ->
true
name: 'wca... | $(document).ready ->
autocompleteURL = $("#competitor_wca").attr("data-url")
auto = $("#competitor_wca").typeahead {
minLength: 6
},{
source: (q, callback) ->
$.getJSON(autocompleteURL + "?q=#{q}")
.done (result) ->
callback(result)
matcher: (item) ->
true
name: 'wca... |
Increase minimum_chrome_version to 32 in order to support Promise and onWheel | name: 'Popup my Bookmarks'
version: ''
manifest_version: 2
minimum_chrome_version: '26'
default_locale: 'en'
description: '__MSG_extDesc__'
icons:
16: 'img/icon16.png'
48: 'img/icon48.png'
128: 'img/icon128.png'
browser_action:
default_icon: 'img/icon38.png'
default_popup: 'popup.html'
options_page: 'optio... | name: 'Popup my Bookmarks'
version: ''
manifest_version: 2
minimum_chrome_version: '32'
default_locale: 'en'
description: '__MSG_extDesc__'
icons:
16: 'img/icon16.png'
48: 'img/icon48.png'
128: 'img/icon128.png'
browser_action:
default_icon: 'img/icon38.png'
default_popup: 'popup.html'
options_page: 'optio... |
Fix bug with Foundation undefined | #= require jquery
#= require jquery_ujs
#= require foundation
#= require rails.validations
#= require rails.validations.simple_form
#= require rails.validations.simple_form.fix
#= require turbolinks
#= require nprogress
#= require nprogress-turbolinks
#= require jquery.autosize
#= require globals/_functions
#= require ... | #= require vendor/modernizr
#= require jquery
#= require jquery_ujs
#= require foundation/foundation
#= require foundation
#= require rails.validations
#= require rails.validations.simple_form
#= require rails.validations.simple_form.fix
#= require turbolinks
#= require nprogress
#= require nprogress-turbolinks
#= requ... |
Fix Atom reopen closed tab | # all
# ----------------------------------------
'atom-text-editor.vim-mode-plus':
# mode switch
'ctrl-space': 'vim-mode-plus:reset-normal-mode'
# undo/redo
'ctrl-u': 'vim-mode-plus:redo'
# motions
'ctrl-h': 'vim-mode-plus:previous-tab'
'ctrl-l': 'vim-mode-plus:next-tab'
'ctrl-k': 'vi... | # all
# ----------------------------------------
'atom-text-editor.vim-mode-plus':
# mode switch
'ctrl-space': 'vim-mode-plus:reset-normal-mode'
# undo/redo
'ctrl-u': 'vim-mode-plus:redo'
# motions
'ctrl-h': 'vim-mode-plus:previous-tab'
'ctrl-l': 'vim-mode-plus:next-tab'
'ctrl-k': 'vi... |
Use image, pdf, and compressed file icons | {View, $$} = require 'space-pen'
$ = require 'jquery'
Git = require 'git'
module.exports =
class FileView extends View
@content: (file) ->
@li class: 'file entry', =>
@span file.getBaseName(), class: 'name'
@span "", class: 'highlight'
file: null
initialize: (@file) ->
@addClass('ignored') ... | {View, $$} = require 'space-pen'
$ = require 'jquery'
Git = require 'git'
fs = require 'fs'
_ = require 'underscore'
module.exports =
class FileView extends View
@COMPRESSED_EXTENSIONS: [
'.zip'
'.jar'
'.tar'
'.gz'
]
@IMAGE_EXTENSIONS: [
'.jpeg'
'.jpg'
'.gif'
'.png'
]
@PDF_... |
Fix the about page, where moderators don't always show up | class @AboutController extends RouteController
onBeforeRun: ->
if not subscriptionHandles.moderators
subscriptionHandles.moderators = Meteor.subscribe('moderators')
subscriptionHandles.moderators.stop = ->
tempalte: 'about'
renderTemplates:
'nav': to: 'nav'
data: ->
page: 'about' | class @AboutController extends RouteController
onBeforeRun: ->
if not subscriptionHandles.moderators
subscriptionHandles.moderators = Meteor.subscribe('moderators')
subscriptionHandles.moderators.stop = ->
waitOn: ->
subscriptionHandles.moderators
tempalte: 'about'
renderTemplates:
'n... |
Increase the number of samples to take such that the mean value is close enough to zero for the test. | {expect} = require "chai"
utils = require "../../utils"
{Collections} = utils.require "base"
Jitter = utils.require("models/transforms/jitter").Model
describe "Jitter transform module", ->
source = {start: 0, end: 10}
target = {start: 20, end: 80}
generate_jitter = ->
new Jitter({
width: 1,
mea... | {expect} = require "chai"
utils = require "../../utils"
{Collections} = utils.require "base"
Jitter = utils.require("models/transforms/jitter").Model
describe "Jitter transform module", ->
source = {start: 0, end: 10}
target = {start: 20, end: 80}
generate_jitter = ->
new Jitter({
width: 1,
mea... |
Use favicon middleware during development by default. | express = require 'express'
extend = require './extend'
{existsSync} = require './utils'
{join, dirname} = require 'path'
exports.extend = (app, func) ->
extend app, func
exports.createServer = (func) ->
app = express.createServer()
extend app, func
exports.default = (opts) ->
->
@configure ->
@se... | express = require 'express'
extend = require './extend'
{existsSync} = require './utils'
{join, dirname} = require 'path'
exports.extend = (app, func) ->
extend app, func
exports.createServer = (func) ->
app = express.createServer()
extend app, func
exports.default = (opts) ->
->
@configure ->
@se... |
Store a 'fields' attribute on form | FieldList = require './field_list'
module.exports = class Form extends Backbone.Model
defaults:
saveable: false
updateOnly: false
sections: [
{ key: 'default', group: true }
{ key: 'none', group: false }
]
initialize: (attributes) ->
@original = attributes?.model
@buildClone... | FieldList = require './field_list'
module.exports = class Form extends Backbone.Model
defaults:
saveable: false
updateOnly: false
sections: [
{ key: 'default', group: true }
{ key: 'none', group: false }
]
initialize: (attributes) ->
@original = attributes?.model
@buildClone... |
Move trace from app "start" to app "before:start" | module.exports = do (Marionette, $) ->
{ UIRouterMarionette } = require('../router')
App = new Marionette.Application
Marionette.Behaviors.behaviorsLookup = ->
# Import Marionette behaviors for state lookup/active state
UISref: require('../router/marionette/behaviors').UISref
App.addRegions
rootReg... | module.exports = do (Marionette, $) ->
{ UIRouterMarionette } = require('../router')
App = new Marionette.Application
Marionette.Behaviors.behaviorsLookup = ->
# Import Marionette behaviors for state lookup/active state
UISref: require('../router/marionette/behaviors').UISref
App.addRegions
rootReg... |
Fix existing add subgroup link | angular.module('loomioApp').directive 'subgroupsCard', ->
scope: {group: '='}
restrict: 'E'
templateUrl: 'generated/components/group_page/subgroups_card/subgroups_card.html'
replace: true
controller: ($scope, Records, AbilityService, ModalService, StartGroupForm) ->
Records.groups.fetchByParent $scope.gro... | angular.module('loomioApp').directive 'subgroupsCard', ->
scope: {group: '='}
restrict: 'E'
templateUrl: 'generated/components/group_page/subgroups_card/subgroups_card.html'
replace: true
controller: ($scope, Records, AbilityService, ModalService, StartGroupForm) ->
Records.groups.fetchByParent $scope.gro... |
Disable auto-saves until the data has been loaded | # Description:
# None
#
# Dependencies:
# "redis": "0.7.2"
#
# Configuration:
# REDISTOGO_URL
#
# Commands:
# None
#
# Author:
# atmos
Url = require "url"
Redis = require "redis"
# sets up hooks to persist the brain into redis.
module.exports = (robot) ->
info = Url.parse process.env.REDISTOGO_URL || ... | # Description:
# None
#
# Dependencies:
# "redis": "0.7.2"
#
# Configuration:
# REDISTOGO_URL
#
# Commands:
# None
#
# Author:
# atmos
Url = require "url"
Redis = require "redis"
# sets up hooks to persist the brain into redis.
module.exports = (robot) ->
info = Url.parse process.env.REDISTOGO_URL || ... |
Refactor darker-background directive, extract method | Darkswarm.directive "darkerBackground", ->
restrict: "A"
link: (scope, elm, attr)->
elm.closest('.page-view').toggleClass("with-darker-background", true)
| Darkswarm.directive "darkerBackground", ->
restrict: "A"
link: (scope, elm, attr)->
toggleClass = (value) ->
elm.closest('.page-view').toggleClass("with-darker-background", value)
toggleClass(true)
|
Use find instead of children to support more advanced selectors | define (require) ->
BaseView = require('cs!helpers/backbone/views/base')
observerConfig =
subtree: true
childList: true
characterData: true
return class EditableView extends BaseView
initialize: () ->
super()
@listenTo(@model, 'change:edit', @toggleEdit)
@observer = new Mutat... | define (require) ->
BaseView = require('cs!helpers/backbone/views/base')
observerConfig =
subtree: true
childList: true
characterData: true
return class EditableView extends BaseView
initialize: () ->
super()
@listenTo(@model, 'change:edit', @toggleEdit)
@observer = new Mutat... |
Fix custom then on record loader | angular.module('loomioApp').factory 'RecordLoader', (Records) ->
class RecordLoader
constructor: (opts = {}) ->
@loadingFirst = true
@collection = opts.collection
@params = opts.params or {from: 0, per: 25, order: 'id'}
@path = opts.path
@numLoaded = opts.numLoaded or 0
... | angular.module('loomioApp').factory 'RecordLoader', (Records) ->
class RecordLoader
constructor: (opts = {}) ->
@loadingFirst = true
@collection = opts.collection
@params = opts.params or {from: 0, per: 25, order: 'id'}
@path = opts.path
@numLoaded = opts.numLoaded or 0
... |
Make sure there is handle (since its optional this check is necessary) | class ApplicationTabHandleHolder extends KDView
constructor: (options = {}, data) ->
options.cssClass = KD.utils.curry "application-tab-handle-holder", options.cssClass
options.bind = "mouseenter mouseleave"
options.addPlusHandle ?= yes
super options, data
if options.addPlus... | class ApplicationTabHandleHolder extends KDView
constructor: (options = {}, data) ->
options.cssClass = KD.utils.curry "application-tab-handle-holder", options.cssClass
options.bind = "mouseenter mouseleave"
options.addPlusHandle ?= yes
super options, data
if options.addPlus... |
Remove unsupported items from toolbar | $(document).ready ->
if $('[contenteditable!=false]').length > 0
for elementId in ['body_editable', 'abstract_editable']
CKEDITOR.inline elementId,
extraPlugins: 'sharedspace'
removePlugins: 'floatingspace,resize'
sharedSpaces:
top: 'ckeditor-toolbar'
$('#save_button').o... | $(document).ready ->
if $('[contenteditable!=false]').length > 0
for elementId in ['body_editable', 'abstract_editable']
CKEDITOR.inline elementId,
extraPlugins: 'sharedspace'
removePlugins: 'floatingspace,resize'
sharedSpaces:
top: 'ckeditor-toolbar'
toolbarGroups:... |
Update DataTables `aoColumnDefs` class names. | jQuery ->
$('.results_round').dataTable
bPaginate: false
bInfo: false
sDom: 't'
aoColumnDefs: [
aTargets: ['recalled_header', 'adjudicator_header']
bSearchable: false
]
$('.results_round').floatThead()
| jQuery ->
$('.results_round').dataTable
bPaginate: false
bInfo: false
sDom: 't'
aoColumnDefs: [
aTargets: ['recalled_col', 'adjudicator_col']
bSearchable: false
]
$('.results_round').floatThead()
|
Support stores, add setStore method. | xhr = require 'xhr'
class Crowdstart
endpoint: "https://api.crowdstart.com"
constructor: (@key) ->
setKey: (key) ->
@key = key
req: (uri, data, cb) ->
xhr
uri: (@endpoint.replace /\/$/, '') + uri
method: 'POST'
headers:
'Content-Type': 'application/json'
'Authorizat... | xhr = require 'xhr'
class Crowdstart
endpoint: "https://api.crowdstart.com"
constructor: (@key) ->
setKey: (key) ->
@key = key
setStore: (id) ->
@storeId = id
req: (uri, data, cb) ->
xhr
uri: (@endpoint.replace /\/$/, '') + uri
method: 'POST'
headers:
'Content-Type': ... |
Add TomDoc for Heroku status script usage | # Show current Heroku status
module.exports = (robot) ->
robot.respond /heroku status/, (msg) ->
msg.http("https://status.heroku.com/status.json")
.get() (err, res, body) ->
try
json = JSON.parse(body)
msg.send "App Operations: #{json['App Operations']}\n" +
"... | # Show current Heroku status
#
# heroku status - Returns the current Heroku status for app operations and tools
module.exports = (robot) ->
robot.respond /heroku status/, (msg) ->
msg.http("https://status.heroku.com/status.json")
.get() (err, res, body) ->
try
json = JSON.parse(body)
... |
Fix documentation examples for fsUtils.isDirectory | fs = require('fs')
_ = require('lodash')
# Check if valid path
#
# @private
#
# @param {String} path path
# @return {Boolean} is valid path
#
# @todo There should be more complex checks here
#
# @example Is valid path?
# console.log isValidPath('/Users/me') # True
# console.log isValidPath([ 1, 2, 3 ]) # False
#
exp... | fs = require('fs')
_ = require('lodash')
# Check if valid path
#
# @private
#
# @param {String} path path
# @return {Boolean} is valid path
#
# @todo There should be more complex checks here
#
# @example Is valid path?
# console.log isValidPath('/Users/me') # True
# console.log isValidPath([ 1, 2, 3 ]) # False
#
exp... |
Add description and title to showErrorInline config | module.exports =
instance: null
config:
lintOnFly:
title: 'Lint on fly'
description: 'Lint files while typing, without the need to save them'
type: 'boolean'
default: true
showErrorInline:
type: 'boolean'
default: true
activate: ->
@instance = new (require './linte... | module.exports =
instance: null
config:
lintOnFly:
title: 'Lint on fly'
description: 'Lint files while typing, without the need to save them'
type: 'boolean'
default: true
showErrorInline:
title: "Show Inline Tooltips"
descriptions: "Show inline tooltips for errors"
... |
Fix broken scroll on firefox | class ImageListWidget
constructor: (images) ->
@imgs = images
@binder = new Binder()
onCreate: () ->
@binder.bindAction(
Rx.Observable
.fromEvent($(window), 'resize')
.map(() => $(window).height())
.startWith($(window).height()... | class ImageListWidget
constructor: (images) ->
@imgs = images
@binder = new Binder()
onCreate: () ->
@binder.bindAction(
Rx.Observable
.fromEvent($(window), 'resize')
.map(() => $(window).height())
.startWith($(window).height()... |
Move (temporarily) to ctrl-cmd-o since cmd-O seems unaccessible | # 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... |
Use `.jshintrc` if present in directory | linterPath = atom.packages.getLoadedPackage("linter").path
Linter = require "#{linterPath}/lib/linter"
class LinterJshint extends Linter
# The syntax that the linter handles. May be a string or
# list/tuple of strings. Names should be all lowercase.
@syntax: ['source.js', 'source.js.jquery', 'text.html.basic'] #... | linterPath = atom.packages.getLoadedPackage("linter").path
Linter = require "#{linterPath}/lib/linter"
findFile = require "#{linterPath}/lib/util"
class LinterJshint extends Linter
# The syntax that the linter handles. May be a string or
# list/tuple of strings. Names should be all lowercase.
@syntax: ['source.j... |
Remove a "console.log" from FlexibilityOrder | class @FlexibilityOrder
constructor: (@element) ->
# pass
url: (path) ->
"#{ App.scenario.url_path() }/flexibility_order/#{ path }"
update: (order) =>
$.ajax
url: @url('set'),
type: 'POST',
data:
flexibility_order:
order: order,
scenario_id: App.scenario... | class @FlexibilityOrder
constructor: (@element) ->
# pass
url: (path) ->
"#{ App.scenario.url_path() }/flexibility_order/#{ path }"
update: (order) =>
$.ajax
url: @url('set'),
type: 'POST',
data:
flexibility_order:
order: order,
scenario_id: App.scenario... |
Load unassigned category on main categories index page | App.CategoriesRoute = Em.Route.extend
model: ->
App.Category.findAll()
setupController: (controller, model) ->
@_super controller, model
@set 'unassigned', model.findBy('system_type', 'unassigned')
| App.CategoriesRoute = Em.Route.extend
model: ->
App.Category.findAll()
setupController: (controller, model) ->
@_super controller, model
unassigned = model.findBy('system_type', 'unassigned')
@controllerFor('categoriesShow').set('model', unassigned)
@controllerFor('pagedTransactions').setPropert... |
Fix bug to get always notified when all tests are completed | class TestRunner
running: false
results: {}
instance = null
@get: ->
instance ?= new TestRunner();
constructor: ()->
Meteor.startup =>
console.log 'TestRunner: Meteor.startup'
Tracker.autorun @onVelocityIsReady
onVelocityIsReady: =>
console.log 'onVelocityIsReady:'
retu... | class TestRunner
running: false
results: {}
instance = null
@get: ->
instance ?= new TestRunner();
constructor: ()->
Meteor.startup =>
console.log 'TestRunner: Meteor.startup'
Tracker.autorun @onVelocityIsReady
onVelocityIsReady: =>
console.log 'onVelocityIsReady:'
retu... |
Use bluebird long stacktraces in development | require './shim/phantomjs-bind'
window.Promise = require 'bluebird'
window.Rdb = require('rdb/index')
| require './shim/phantomjs-bind'
window.Promise = require 'bluebird'
if process.env.NODE_ENV == 'development'
Promise.longStackTraces()
window.Rdb = require('rdb/index')
|
Replace 'live' with 'on' syntax. | # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
(($) ->
$('input.date').liv... | # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
(($) ->
$(document).on 'cli... |
Remove percentages and combine robot.hear calls | # 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... | # Description:
# Listens for words and sometimes replies with an Arnie quote
#
# Dependencies:
# None
#
# Commands:
# None
#
# Author:
# Casey Lawrence <casey.j.lawrence@gmail.com>
#
arnie_quotes = [
'GET TO THE CHOPPA!',
'Your clothes, give them to me, NOW!',
'Hasta La Vista, Baby!',
'DDDAAANN... |
Stop redirecting to movies index when adding a movie | class Shothere.Routers.MoviesRouter extends Backbone.Router
initialize: (options) ->
@movies = new Shothere.Collections.MoviesCollection()
@movies.reset options.movies if options.movies
@movies.on( 'add', @index, @)
routes:
"new" : "newMovie"
"index" : "index"
":id/edit" : "edit"
... | class Shothere.Routers.MoviesRouter extends Backbone.Router
initialize: (options) ->
@movies = new Shothere.Collections.MoviesCollection()
@movies.reset options.movies if options.movies
routes:
"new" : "newMovie"
"index" : "index"
":id/edit" : "edit"
":id" : "show"
".*" ... |
Remove User from shared machines when username changed. | module.exports = usernameChanged = ({ oldUsername, username, isRegistration }) ->
return unless oldUsername and username
return if isRegistration
JMachine = require '../machine'
console.log "Removing user #{oldUsername} vms..."
JMachine.update
provider : { $in: ['koding', 'managed'] }
crede... | module.exports = usernameChanged = ({ oldUsername, username, isRegistration }) ->
return unless oldUsername and username
return if isRegistration
JUser = require '../../user'
JMachine = require '../machine'
console.log "Removing user #{oldUsername} vms..."
JMachine.update
provider : { $in:... |
Add "home" to start of breadcrumbs to allow easy browse nav | mod = angular.module("player")
mod.controller("BrowseCtrl", ($scope, $stateParams, $state, library, playlist) ->
"use strict"
that = this
$scope.library = library
that.breadcrumbs = (uri) ->
parts = uri.split("/")
{ label: part, path: parts[0..i].join("/") } for part, i in parts
$scope.$on "$state... | mod = angular.module("player")
mod.controller("BrowseCtrl", ($scope, $stateParams, $state, library, playlist) ->
"use strict"
that = this
$scope.library = library
that.breadcrumbs = (uri) ->
parts = uri.split("/")
crumbs = ({
label: part,
path: parts[0..i].join("/")
} for part, i in p... |
Use event provided by status bar | {View} = require 'atom'
module.exports =
class SelectionCountView extends View
@content: ->
@div class: "selection-count inline-block"
initialize: (@statusBar) ->
@subscribe atom.workspaceView.eachEditorView (editor) =>
@subscribe editor, "selection:changed", @updateCount
@subscribe atom.workspa... | {View} = require 'atom'
module.exports =
class SelectionCountView extends View
@content: ->
@div class: "selection-count inline-block"
initialize: (@statusBar) ->
@subscribe atom.workspaceView.eachEditorView (editor) =>
@subscribe editor, "selection:changed", @updateCount
@subscribe @statusBar, ... |
Fix redirect in clone project modal | define [
"base"
], (App) ->
App.controller 'CloneProjectModalController', ($scope, $modalInstance, $timeout, $http, ide) ->
$scope.inputs =
projectName: ide.$scope.project.name + " (Copy)"
$scope.state =
inflight: false
error: false
$modalInstance.opened.then () ->
$timeout () ->
$scope.$broad... | define [
"base"
], (App) ->
App.controller 'CloneProjectModalController', ($scope, $modalInstance, $timeout, $http, ide) ->
$scope.inputs =
projectName: ide.$scope.project.name + " (Copy)"
$scope.state =
inflight: false
error: false
$modalInstance.opened.then () ->
$timeout () ->
$scope.$broad... |
Clear other input values too. | $(document).on 'click', 'a[data-clear-form]', (event) ->
event.preventDefault()
$(event.currentTarget).closest('form').trigger('clear')
$(document).on 'clear', '.effective-datatable-scopes form', (event) ->
$(this).find('.radio.active').removeClass('active');
$(this).find(':radio').prop('checked', false);
$(... | $(document).on 'click', 'a[data-clear-form]', (event) ->
event.preventDefault()
$(event.currentTarget).closest('form').trigger('clear')
$(document).on 'clear', '.effective-datatable-scopes form', (event) ->
$(this).find('.radio.active').removeClass('active');
$(this).find(':radio').prop('checked', false);
$(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.