Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Revert "Add dummy select method for collections"
Augury.Routers.Connections = Backbone.Router.extend( routes: "connections/new": "new" "connections/select": "select" "connections/:id/connect": "connect" "connections/disconnect": "disconnect" new: -> view = new Augury.Views.Connections.New() $("#integration_main").html view.render().el ...
Augury.Routers.Connections = Backbone.Router.extend( routes: "connections/new": "new" "connections/:id/connect": "connect" "connections/disconnect": "disconnect" new: -> Augury.update_nav('overview') view = new Augury.Views.Connections.New() $("#integration_main").html view.render().el ...
Use fresh scope for each quantity field
Darkswarm.directive "validateStockQuantity", (StockQuantity) -> restrict: 'A' require: "ngModel" link: (scope, element, attr, ngModel) -> ngModel.$parsers.push (selectedQuantity) -> valid_number = parseInt(selectedQuantity) != NaN valid_quantity = parseInt(selectedQuantity) <= scope.available_qua...
Darkswarm.directive "validateStockQuantity", (StockQuantity) -> restrict: 'A' require: "ngModel" scope: true link: (scope, element, attr, ngModel) -> ngModel.$parsers.push (selectedQuantity) -> valid_number = parseInt(selectedQuantity) != NaN valid_quantity = parseInt(selectedQuantity) <= scope...
Switch default font to powerline enabled
"*": "atom-beautify": python: beautify_on_save: true sort_imports: true "autocomplete-python": extraPaths: ".venv/lib/python3.5/site-packages;.venv/lib/python2.6/site-packages;~/.pyenv/versions/3.5.1/lib/python3.5/site-packages" pythonPaths: ".venv/bin/python;~/.pyenv/versions/3.5.1/bin/pyth...
"*": "atom-beautify": python: beautify_on_save: true sort_imports: true "autocomplete-python": extraPaths: ".venv/lib/python3.5/site-packages;.venv/lib/python2.6/site-packages;~/.pyenv/versions/3.5.1/lib/python3.5/site-packages" pythonPaths: ".venv/bin/python;~/.pyenv/versions/3.5.1/bin/pyth...
Make the smoke-writing test actually using various blueprint slices
{assert} = require 'chai' fs = require 'fs' Drafter = require '../../src/drafter' describe 'Typing test', -> blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8' drafter = new Drafter describe 'When I type the blueprint', -> currentLength = 0 error = undefined exception = un...
{assert} = require 'chai' fs = require 'fs' Drafter = require '../../src/drafter' describe 'Typing test', -> blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8' drafter = new Drafter describe 'When I type the blueprint', -> currentLength = 0 # Because drafter.make uses protago...
Change import path of Polymer library
".text.html": "polymer element": "prefix": "pe" "body": """ ${1:<link rel="import" href="../polymer/polymer.html">} <dom-module id="$2"> <style> :host { display: block; } </style> <template> $4 </template> </dom-module> <script> ...
".text.html": "polymer element": "prefix": "pe" "body": """ <link rel="import" href="${1:../bower_components}/polymer/polymer.html"> <dom-module id="$2"> <style> :host { display: block; } </style> <template> $4 </template> </dom-module> ...
Increase delay for showing loading overlay
### # Copyright 2015 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 Public License version ...
### # Copyright 2015 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 Public License version ...
Update menu when right clicking
# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': 'atom-text-editor': [ { 'label': 'Test Navigator' 'command': 'test-navigator:toggle' } ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Test Navigator' 'submenu'...
# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': 'atom-text-editor': [ { 'label': 'Test Navigator' 'command': 'test-navigator:navigate' } ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Test Navigator' 'submen...
Call info and update the latestState after each operation
class VirtualizationController extends KDController constructor:-> super @kc = KD.singletons.kiteController _cbWrapper:(callback, emitStateChanged)-> return callback unless emitStateChanged kallback = (rest...)=> @info (err, info)=> warn "[VM]", err if err @emit 'StateChan...
class VirtualizationController extends KDController constructor:-> super @kc = KD.singletons.kiteController @lastState = state : 'STOPPED' run:(command, callback, emitStateChanged=yes)-> @kc.run kiteName : 'os' method : command , @_cbWrapper callback, emitStateChanged ...
Remove task reload in route
ETahi.PaperTaskRoute = Ember.Route.extend model: (params) -> paperTasks = _.flatten @modelFor('paper').get('phases').mapProperty('tasks.content') task = paperTasks.findBy('id', params.task_id) task.reload() setupController: (controller, model) -> # FIXME: Rename AdHocTask to Task (here, in views, a...
ETahi.PaperTaskRoute = Ember.Route.extend model: (params) -> paperTasks = _.flatten @modelFor('paper').get('phases').mapProperty('tasks.content') task = paperTasks.findBy('id', params.task_id) task setupController: (controller, model) -> # FIXME: Rename AdHocTask to Task (here, in views, and in tem...
Add unfollow button to profile if already following
class TentStatus.Views.ProfileFollowButton extends Backbone.View initialize: (options = {}) -> @parentView = options.parentView @buttons = {} @buttons.submit = ($ '[type=submit]', @$el) new HTTP 'GET', "#{TentStatus.config.tent_api_root}/followings", { entity: TentStatus.config.domain_entity ...
class TentStatus.Views.ProfileFollowButton extends Backbone.View initialize: (options = {}) -> @parentView = options.parentView @buttons = {} @buttons.submit = ($ '[type=submit]', @$el) new HTTP 'GET', "#{TentStatus.config.tent_api_root}/followings", { entity: TentStatus.config.domain_entity ...
Disable Dogeparty testnet since there is no installation currently
shared = require("./_shared") dogeparty = (addr) -> shared.party(addr, [["XDP", "https://wallet.dogeparty.io/_api"], ["XDPTEST", "http://testnet.wallet.dogeparty.io/_t_api"]]) module.exports = dogeparty
shared = require("./_shared") dogeparty = (addr) -> shared.party(addr, [ ["XDP", "https://wallet.dogeparty.io/_api"] # ["XDPTEST", "http://testnet.wallet.dogeparty.io/_t_api"] ]) module.exports = dogeparty
Enable keymap for Python grammar only.
# 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 that registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom...
# 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 that registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom...
Add headless Chrome parameters to work on ResinCi
karmaConfig = require('resin-config-karma') packageJSON = require('./package.json') module.exports = (config) -> karmaConfig.plugins.push(require('karma-chrome-launcher')) karmaConfig.browsers = ['ChromeHeadless'] karmaConfig.logLevel = config.LOG_INFO karmaConfig.sauceLabs = testName: "#{packageJSON.name} v#{...
karmaConfig = require('resin-config-karma') packageJSON = require('./package.json') module.exports = (config) -> karmaConfig.plugins.push(require('karma-chrome-launcher')) karmaConfig.browsers = ['ChromeHeadlessCustom'] karmaConfig.customLaunchers = ChromeHeadlessCustom: base: 'ChromeHeadless' flags: [ ...
Fix radio checked class and changes to support the new html
Neighborly.Neighborly.Balanced ?= {} Neighborly.Neighborly.Balanced.Creditcard ?= {} Neighborly.Neighborly.Balanced.Creditcard.Payments ?= {} Neighborly.Neighborly.Balanced.Creditcard.Payments.New = Backbone.View.extend el: '.neighborly-balanced-creditcard-form' initialize: -> _.b...
Neighborly.Neighborly ?= {} Neighborly.Neighborly.Balanced ?= {} Neighborly.Neighborly.Balanced.Creditcard ?= {} Neighborly.Neighborly.Balanced.Creditcard.Payments ?= {} Neighborly.Neighborly.Balanced.Creditcard.Payments.New = Backbone.View.extend el: '.neigh...
Remove timeout after gender selection
angular.module 'jquest' .controller 'MainSeasonPgLevelRoundGenderCtrl', (seasons, seasonRestangular, $timeout, $state)-> 'ngInject' new class MainSeasonPgLevelRoundGenderCtrl male: (person)=> @genderize person, 'male' other: (person)=> @genderize person, 'other' female: (person)=> @genderize...
angular.module 'jquest' .controller 'MainSeasonPgLevelRoundGenderCtrl', (seasons, seasonRestangular, $state)-> 'ngInject' new class MainSeasonPgLevelRoundGenderCtrl male: (person)=> @genderize person, 'male' other: (person)=> @genderize person, 'other' female: (person)=> @genderize person, '...
Update layout on new block
class ledger.tasks.TransactionObserverTask extends ledger.tasks.Task constructor: () -> super 'global_transaction_observer' onStart: () -> @_listenNewTransactions() onStop: () -> @newTransactionStream?.close() _listenNewTransactions: () -> @newTransactionStream = new WebSocket "wss://ws.ledgerwa...
class ledger.tasks.TransactionObserverTask extends ledger.tasks.Task constructor: () -> super 'global_transaction_observer' onStart: () -> @_listenNewTransactions() onStop: () -> @newTransactionStream?.close() _listenNewTransactions: () -> @newTransactionStream = new WebSocket "wss://ws.ledgerwa...
Set special "if" bindings in Output module
### @TODO @namespace Atoms.COre @class Output @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi ### "use strict" Atoms.Core.Output = method: "append" append: -> @render "append" prepend: -> @render "prepend" html: -> @render "html" render: -> throw "No template defined." unless @template...
### @TODO @namespace Atoms.COre @class Output @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi ### "use strict" Atoms.Core.Output = method: "append" ifs : [] append: -> @render "append" prepend: -> @render "prepend" html: -> @render "html" render: -> throw "No template defined." unl...
Use mocha's dot reporter on travis
module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-contrib-jshint') grunt.loadNpmTasks('grunt-contrib-watch') grunt.loadNpmTasks('grunt-mocha-cov') grunt.initConfig pkg: grunt.file.readJSON('package.json') jshint: options: jshintrc: '.jsh...
module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-contrib-jshint') grunt.loadNpmTasks('grunt-contrib-watch') grunt.loadNpmTasks('grunt-mocha-cov') grunt.initConfig pkg: grunt.file.readJSON('package.json') jshint: options: jshintrc: '.jsh...
Add a project entry for the new Homebrew-Troff tap
[ { title: ".atom" paths: [ "~/.atom" ] icon: "atom-icon" devMode: true } { title: ".files" paths: [ "~/.files" ] icon: "terminal-icon" devMode: true } { title: "language-roff" paths: [ "~/Labs/language-roff" ] icon: "manpage-icon" devMode: true } { title: "file-icons" ...
[ { title: ".atom" paths: [ "~/.atom" ] icon: "atom-icon" devMode: true } { title: ".files" paths: [ "~/.files" ] icon: "terminal-icon" devMode: true } { title: "language-roff" paths: [ "~/Labs/language-roff" ] icon: "manpage-icon" devMode: true } { title: "file-icons" ...
Use full path to signtool.bat
path = require 'path' module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) grunt.registerTask 'codesign', 'Codesign the app', -> done = @async() if process.platform is 'darwin' and process.env.XCODE_KEYCHAIN unlockKeychain (error) -> if error? done(error) ...
path = require 'path' module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) grunt.registerTask 'codesign', 'Codesign the app', -> done = @async() if process.platform is 'darwin' and process.env.XCODE_KEYCHAIN unlockKeychain (error) -> if error? done(error) ...
Fix keymap not binding problem
'atom-text-editor[data-grammar~="latex"]': 'ctrl-alt-b': 'Atom-LaTeX:build' 'ctrl-alt-h': 'atom-latex:build-here' 'ctrl-alt-p': 'Atom-LaTeX:preview' 'ctrl-alt-t': 'Atom-LaTeX:preview-tab' 'ctrl-alt-k': 'Atom-LaTeX:kill' 'ctrl-alt-s': 'atom-latex:synctex' 'ctrl-alt-l': 'Atom-LaTeX:show-log'
'atom-text-editor[data-grammar="text tex latex"]': 'ctrl-alt-b': 'atom-latex:build' 'ctrl-alt-h': 'atom-latex:build-here' 'ctrl-alt-p': 'atom-latex:preview' 'ctrl-alt-t': 'atom-latex:preview-tab' 'ctrl-alt-k': 'atom-latex:kill' 'ctrl-alt-s': 'atom-latex:synctex' 'ctrl-alt-l': 'atom-latex:show-log'
Add grunt watch for test resources
module.exports = (grunt) -> require('jit-grunt')(grunt) require('time-grunt')(grunt) if grunt.option 'time' grunt.initConfig jasmine_nodejs: options: specNameSuffix: ['Spec.js', 'Spec.coffee'] test: specs: ['spec/**'] watch: javaScript: files: ['src/**/*.js', 's...
module.exports = (grunt) -> require('jit-grunt')(grunt) require('time-grunt')(grunt) if grunt.option 'time' grunt.initConfig jasmine_nodejs: options: specNameSuffix: ['Spec.js', 'Spec.coffee'] test: specs: ['spec/**'] watch: javaScript: files: ['src/**/*.js', 's...
Change function call in users router from displayLineActivity to displayGithubActivity.
class App.Routers.Users extends App.Router routes: "dashboard" : "edit" ":username" : "show" show: (username)-> user = new App.Models.User id: username user.fetch().done -> view = new App.Views.Users.Show(model: user) $('.main-container').html(view.el) view.render() if user...
class App.Routers.Users extends App.Router routes: "dashboard" : "edit" ":username" : "show" show: (username)-> user = new App.Models.User id: username user.fetch().done -> view = new App.Views.Users.Show(model: user) $('.main-container').html(view.el) view.render() if user...
Fix listening port for production
app = require('express')() app.get '/', (req, res) -> res.send 'Hello World!' console.log 'GET /' app.listen(3000)
app = require('express')() app.get '/', (req, res) -> res.send 'Hello World!' console.log 'GET /' port = process.env.PORT || 3000 app.listen(port)
Fix broken alert div not closing
$(document).on 'ready page:load page:restore', -> $(document).foundation $a = $('.awesome-share-buttons').find('a') $a.each (index, element) -> $this = $(this) title = $this.attr 'title' $this.attr 'title', '' $(element).wrap "<span class='tip-bottom' data-tooltip aria-hashpopup='true' title='#{...
$(document).on 'ready page:load page:restore', -> $(document).foundation() $a = $('.awesome-share-buttons').find('a') $a.each (index, element) -> $this = $(this) title = $this.attr 'title' $this.attr 'title', '' $(element).wrap "<span class='tip-bottom' data-tooltip aria-hashpopup='true' title='...
Return null instead of throwing an exception
native_methods.sun.net.spi.DefaultProxySelector = [ o 'init()Z', (rs) -> true o 'getSystemProxy(Ljava/lang/String;Ljava/lang/String;)Ljava/net/Proxy;', (rs) -> rs.java_throw rs.get_bs_class('Ljava/io/IOException;'), 'proxy' ]
native_methods.sun.net.spi.DefaultProxySelector = [ o 'init()Z', (rs) -> true o 'getSystemProxy(Ljava/lang/String;Ljava/lang/String;)Ljava/net/Proxy;', (rs) -> null ]
Fix the verbiage if no path is specified at all.
{View} = require 'space-pen' {GitNotFoundError} = require '../git-bridge' class GitNotFoundErrorView extends View @content: (err) -> @div class: 'overlay from-top padded merge-conflict-error merge-conflicts-message', => @div class: 'panel', => @div class: "panel-heading", => @code 'git' ...
{View} = require 'space-pen' {GitNotFoundError} = require '../git-bridge' class GitNotFoundErrorView extends View @content: (err) -> @div class: 'overlay from-top padded merge-conflict-error merge-conflicts-message', => @div class: 'panel', => @div class: 'panel-heading no-path', => @cod...
Add tab meta methods on palette element
class PaletteElement extends HTMLElement getModel: -> @palette setModel: (@palette) -> module.exports = PaletteElement = document.registerElement 'pigments-palette', { prototype: PaletteElement.prototype } PaletteElement.registerViewProvider = (modelClass) -> atom.views.addViewProvider modelClass, (model) ->...
class PaletteElement extends HTMLElement getTitle: -> 'Palette' getURI: -> 'pigments://palette' getIconName: -> "pigments" getModel: -> @palette setModel: (@palette) -> module.exports = PaletteElement = document.registerElement 'pigments-palette', { prototype: PaletteElement.prototype } PaletteElemen...
Improve the syntax of the runtime helper function
# Define a Sumatra plugin as a jQuery plugin. # # Example: # sumatra 'myPlugin', -> # class MyPlugin extends SumatraPlugin # action: null # initialize: # alert 'loaded' @sumatra = (plugin_name, plugin_code) -> plugin_helper = plugin_code.apply(this) jQuery.fn[plugin_name] = (opti...
# Define a Sumatra plugin as a jQuery plugin. # # Example: # sumatra 'myPlugin', -> # class MyPlugin extends SumatraPlugin # action: null # initialize: # alert 'loaded' @sumatra = (plugin_name, plugin_code) -> PluginHelper = plugin_code.apply this jQuery.fn[plugin_name] = (optio...
Add 'click' handler to a.btn.cancel in .modal to close modal
$ -> $(".tabs").tab() $ -> $("a[rel=twipsy]").tooltip live: true $ -> $("a[rel=popover]").popover offset: 10 $ -> $('.dropdown-toggle').dropdown() $ -> $(".alert-message").alert() # Automatically select and deselect text inputs in modals $ -> $(".modal").modal().modal("hide").bind 'shown', -> $(this).f...
$ -> $("div.tabs").tab() $ -> $("a[rel=twipsy]").tooltip live: true $ -> $("a[rel=popover]").popover offset: 10 $ -> $('.dropdown-toggle').dropdown() $ -> $(".alert-message").alert() # Automatically select and deselect text inputs in modals $ -> $("div.modal").modal().modal("hide").bind 'shown', -> $(t...
Add isCurrentUser property to UserItemController
App.UserItemController = Em.ObjectController.extend actions: remove: -> user = @get("model").deleteRecord() successCallback = => console.log("deleted") errorCallback = => console.log("error whatever...") user.save().then(successCallback, errorCallback)
App.UserItemController = Em.ObjectController.extend needs: ["application"] currentUser: Ember.computed.alias("controllers.application.currentUser") isCurrentUser: (-> @get("currentUser").id == @get("model").id ).property("currentUser") actions: remove: -> user = @get("model").deleteRecord() ...
Remove refresh. Already called in parent controller
angular.module("app").controller "AccountBalancesController", ($scope, $location, $stateParams, $state, Wallet, Utils) -> $scope.accounts = Wallet.accounts $scope.balances = Wallet.balances $scope.utils = Utils $scope.formatAsset = Utils.formatAsset Wallet.refresh_accounts()
angular.module("app").controller "AccountBalancesController", ($scope, $location, $stateParams, $state, Wallet, Utils) -> $scope.accounts = Wallet.accounts $scope.balances = Wallet.balances $scope.utils = Utils $scope.formatAsset = Utils.formatAsset
Change string encoding function from escape to encodeURIComponent Encode function could not multibyte string for url.
# Description: # Interacts with the Google Maps API. # # Commands: # hubot map me <query> - Returns a map view of the area returned by `query`. module.exports = (robot) -> robot.respond /(?:(satellite|terrain|hybrid)[- ])?map me (.+)/i, (msg) -> mapType = msg.match[1] or "roadmap" location = msg.match[...
# Description: # Interacts with the Google Maps API. # # Commands: # hubot map me <query> - Returns a map view of the area returned by `query`. module.exports = (robot) -> robot.respond /(?:(satellite|terrain|hybrid)[- ])?map me (.+)/i, (msg) -> mapType = msg.match[1] or "roadmap" location = msg.match[...
Add tooltip to course timezone change
React = require 'react' Router = require 'react-router' {CourseStore} = require '../../../flux/course' TimeZoneSettingsLink = React.createClass propTypes: courseId: React.PropTypes.string.isRequired contextTypes: router: React.PropTypes.func render: -> <Router.Link className='course-time-zo...
React = require 'react' Router = require 'react-router' BS = require 'react-bootstrap' {CourseStore} = require '../../../flux/course' TimeZoneSettingsLink = React.createClass propTypes: courseId: React.PropTypes.string.isRequired contextTypes: router: React.PropTypes.func render: -> tooltip ...
Move pythonTools assignment to beforeEach
PythonTools = require '../lib/python-tools' describe "PythonTools", -> beforeEach -> waitsForPromise -> atom.packages.activatePackage('python-tools') describe "when a response is returned from tools.py", -> it "correctly deserializes JSON", -> pythonTools = atom.packages.getActivePackage('pyth...
PythonTools = require '../lib/python-tools' describe "PythonTools", -> pythonTools = null beforeEach -> waitsForPromise -> atom.packages.activatePackage('python-tools') runs -> pythonTools = atom.packages.getActivePackage('python-tools').mainModule describe "when a response is returned from ...
Use native array.join to concat strings.
goog.provide 'spark.utils' counter = Math.floor Math.random() * 2147483648 ###* Returns a unique id. Ported from TartJS. https://github.com/tart/tartJS/blob/master/tart/tart.js#L26 -- amcalar <3 @export @return {string} Unique id. ### spark.utils.getUid = -> return (counter++).toString 36 ###* Concat...
goog.provide 'spark.utils' counter = Math.floor Math.random() * 2147483648 ###* Returns a unique id. Ported from TartJS. https://github.com/tart/tartJS/blob/master/tart/tart.js#L26 -- amcalar <3 @export @return {string} Unique id. ### spark.utils.getUid = -> return (counter++).toString 36 ###* Concat...
Change get full name and add get rut
# Description # Obtiene el nombre de la persona o empresa del RUT consultado # # Commands: # hubot info rut <rut> -> RUT: <rut>, Nombre: <nombre> # # Author: # lgaticaq infoRut = require("info-rut") module.exports = (robot) -> robot.respond /info rut (.*)/i, (msg) -> rut = msg.match[1] infoRut rut, (e...
# Description # Obtiene el nombre de la persona o empresa del RUT consultado y viceversa # # Dependencies: # "info-rut": "^1.0.0" # # Commands: # hubot info-rut rut <rut> -> RUT: <rut>, Nombre: <nombre> # hubot info-rut nombre <nombre> -> RUT: <rut>, Nombre: <nombre> # # Author: # lgaticaq infoRut = require(...
Test env doesn't need rails.js
#= require qunit #= require rails #= require_directory ./unit window.setupFrame = (env, url) -> stop() env.iframe = document.createElement 'iframe' env.iframe.src = "/frame" env.iframe.onload = -> env.iframe.onload = -> env.window = env.win = env.iframe.contentWindow env.document = env.doc = en...
#= require qunit #= require_directory ./unit window.setupFrame = (env, url) -> stop() env.iframe = document.createElement 'iframe' env.iframe.src = "/frame" env.iframe.onload = -> env.iframe.onload = -> env.window = env.win = env.iframe.contentWindow env.document = env.doc = env.iframe.contentD...
Add redirect from dashboard to user page
define ['angular', 'angularRoute', 'controllers'], (angular) -> getFirstPage = -> if window.isAuthenticated '/user/' + window.user + '/' else '/welcome/' app = angular.module('coviolations', ['ngRoute', 'coviolations.controllers']) .config ['$routeProvider', '$lo...
define ['angular', 'angularRoute', 'controllers'], (angular) -> getFirstPage = -> if window.isAuthenticated '/user/' + window.user + '/' else '/welcome/' app = angular.module('coviolations', ['ngRoute', 'coviolations.controllers']) .config ['$routeProvider', '$lo...
Revert "Reduce spec timeout duration"
exports.beforeEach = (fn) -> global.beforeEach -> result = fn() if result instanceof Promise waitsForPromise(-> result) exports.afterEach = (fn) -> global.afterEach -> result = fn() if result instanceof Promise waitsForPromise(-> result) ['it', 'fit', 'ffit', 'fffit'].forEach (name) ->...
exports.beforeEach = (fn) -> global.beforeEach -> result = fn() if result instanceof Promise waitsForPromise(-> result) exports.afterEach = (fn) -> global.afterEach -> result = fn() if result instanceof Promise waitsForPromise(-> result) ['it', 'fit', 'ffit', 'fffit'].forEach (name) ->...
Update to a better CoffeeScript syntax
argv = require('yargs') .options('d', { alias: 'dir', default: '.', describe: 'Served files directory' }) .options('p', { alias: 'port', default: '1234', describe: 'Runs Shuss on the specified port' }) .options('verbose', { boolean: t...
argv = require('yargs') .options('d', alias: 'dir' default: '.' describe: 'Served files directory' ) .options('p', alias: 'port' default: '1234' describe: 'Runs Shuss on the specified port' ) .options('verbose', boolean: true ...
Add closing tag to turbolinks loading message.
#= require libraries #= require_tree . $ -> $('.alert').delay(4000).fadeOut('slow') $('.chosen').chosen() $('.timeago').timeago() # Have a loading screen when turbolinks is working it's magic document.addEventListener 'page:fetch', -> html = "<div id='loading'><div><i class='icon-spinner icon-spin icon-4x'></...
#= require libraries #= require_tree . $ -> $('.alert').delay(4000).fadeOut('slow') $('.chosen').chosen() $('.timeago').timeago() # Have a loading screen when turbolinks is working it's magic document.addEventListener 'page:fetch', -> html = "<div id='loading'><div><i class='icon-spinner icon-spin icon-4x'></...
Fix search result lmo href
angular.module('loomioApp').directive 'previousProposalsCard', ($routeParams) -> scope: {discussion: '='} restrict: 'E' templateUrl: 'generated/components/thread_page/previous_proposals_card/previous_proposals_card.html' replace: true controller: ($scope, $rootScope, $location, Records) -> Records.votes....
angular.module('loomioApp').directive 'previousProposalsCard', -> scope: {discussion: '='} restrict: 'E' templateUrl: 'generated/components/thread_page/previous_proposals_card/previous_proposals_card.html' replace: true controller: ($scope, $rootScope, $location, Records) -> Records.votes.fetchMyVotes($s...
Allow save mentions to 'all'
### # Mentions is a named function that will process Mentions # @param {Object} message - The message object ### class MentionsServer constructor: (message) -> # If message starts with /me, replace it for text formatting mentions = [] message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->...
### # Mentions is a named function that will process Mentions # @param {Object} message - The message object ### class MentionsServer constructor: (message) -> # If message starts with /me, replace it for text formatting mentions = [] message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->...
Fix wrong comment ordering on pageLoad bug
class CommentListViewController extends KDListViewController constructor: (options = {}, data) -> options.viewOptions or= type : 'comments' dataPath : 'id' itemClass : CommentListItemView itemOptions : activity : data supe...
class CommentListViewController extends KDListViewController constructor: (options = {}, data) -> options.viewOptions or= type : 'comments' dataPath : 'id' itemClass : CommentListItemView itemOptions : activity : data supe...
Use => for clearer code
currentTest = {} startTime = null QUnit.testStart (context) -> currentTest = {} currentTest.name = context.name currentTest.assertions = 0 currentTest.backtrace = [] startTime = (new Date()).getTime() QUnit.log (context) -> if context.result currentTest.assertions++ return stackTrace = [] cu...
@currentTest = {} @startTime = null QUnit.testStart (context) => @currentTest = {} @currentTest.name = context.name @currentTest.assertions = 0 @currentTest.backtrace = [] @startTime = (new Date()).getTime() QUnit.log (context) => if context.result @currentTest.assertions++ return stackTrace =...
Fix unknown props on croppedImage svg
React = require 'react' ReactDOM = require 'react-dom' module.exports = React.createClass XLINK_NS: 'http://www.w3.org/1999/xlink' getDefaultProps: -> src: '' aspectRatio: NaN getInitialState: -> naturalWidth: 0 naturalHeight: 0 componentDidMount: -> @loadImage @props.src componentWil...
React = require 'react' ReactDOM = require 'react-dom' module.exports = React.createClass XLINK_NS: 'http://www.w3.org/1999/xlink' getDefaultProps: -> src: '' aspectRatio: NaN getInitialState: -> naturalWidth: 0 naturalHeight: 0 componentDidMount: -> @loadImage @props.src componentWil...
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 white list to Rails example config
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...
Use node's require instead of internal require
{View} = require 'space-pen' $ = require 'jquery' _ = nodeRequire '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' 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' initialize: (@edi...
Remove commented out line and ;
linterPath = atom.packages.getLoadedPackage("linter").path Linter = require "#{linterPath}/lib/linter" {CompositeDisposable} = require 'atom' class LinterPhp extends Linter # The syntax that the linter handles. May be a string or # list/tuple of strings. Names should be all lowercase. @syntax: ['text.html.php', ...
linterPath = atom.packages.getLoadedPackage("linter").path Linter = require "#{linterPath}/lib/linter" {CompositeDisposable} = require 'atom' class LinterPhp extends Linter # The syntax that the linter handles. May be a string or # list/tuple of strings. Names should be all lowercase. @syntax: ['text.html.php', ...
Put current blocked users view into modal.
kd = require 'kd' KDView = kd.View KDTabView = kd.TabView KDTabPaneView = kd.TabPaneView TeamMembersCommonView = require './teammemberscommonview.coffee' module.exports = class AdminMembersView extends KDView constructor: (options = {}, data) -> options.cs...
kd = require 'kd' KDView = kd.View KDTabView = kd.TabView KDTabPaneView = kd.TabPaneView TeamMembersCommonView = require './teammemberscommonview' GroupsBlockedUserView = require '../groupsblockeduserview' module.exports = class AdminMembersView extends KDView ...
Fix for boolean example validation.
validateParameters = (params) -> result = { warnings: [] errors: [] } for paramName, param of params if param['required'] == true and (param['example'] == '' or param['example'] == undefined) text = "Required URI parameter '#{paramName}' has no example value." result['errors'].push text ...
validateParameters = (params) -> result = { warnings: [] errors: [] } for paramName, param of params if param['required'] == true and (param['example'] == '' or param['example'] == undefined) text = "Required URI parameter '#{paramName}' has no example value." result['errors'].push text ...
Clean up, don't allocate an extra date
module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [first...
module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [first...
Write out actual JSON duh
moment = require('moment') config = require('./config') util = require('util') module.exports = (program) -> posts = [] config.postsDb.createReadStream() .on('data', (data) -> write = true if program.year? unless moment(data.value.created_time).year() is program.year write = false...
moment = require('moment') config = require('./config') module.exports = (program) -> posts = [] config.postsDb.createReadStream() .on('data', (data) -> write = true if program.year? unless moment(data.value.created_time).year() is program.year write = false if program.month...
Add tests for transactions table labels.
describe "DotLedger.Views.Transactions.Table", -> createView = -> collection = new DotLedger.Collections.Transactions view = new DotLedger.Views.Transactions.Table collection: collection view it "should be defined", -> expect(DotLedger.Views.Transactions.Table).toBeDefined() it "should u...
describe "DotLedger.Views.Transactions.Table", -> createView = -> collection = new DotLedger.Collections.Transactions view = new DotLedger.Views.Transactions.Table collection: collection view it "should be defined", -> expect(DotLedger.Views.Transactions.Table).toBeDefined() it "should u...
Remove tuple creation service in tab ctrl
angular.module('clurtch.components.tabs.find.controllers', []) .controller 'FindCtrl', [ '$scope' 'Yelp' 'SortTwoColumns' ($scope, Yelp, SortTwoColumns)-> Yelp.get().success (data) -> $scope.items = $scope.sortTwoColumns data.businesses ]
angular.module('clurtch.components.tabs.find.controllers', []) .controller 'FindCtrl', [ '$scope' 'Yelp' ($scope, Yelp)-> Yelp.get().success (data) -> $scope.items = data.businesses ]
Add test helper to render into document
React = require('react/addons') TestUtils = React.addons.TestUtils module.exports = # Generates a shallow render for a given component with properties and children shallowRenderComponent: (component, props, children...) -> shallowRenderer = TestUtils.createRenderer() shallowRenderer.render(React.create...
TestUtils = React.addons.TestUtils module.exports = renderComponent: (Component, props={}, state={}) -> component = TestUtils.renderIntoDocument(<Component {...props}/>) component.setState(state) unless state == {} component shallowRenderComponent: (component, props, children...) -> shallowRendere...
Use a span to hold the cursor position text
{View} = require 'atom' module.exports = class CursorPositionView extends View @content: -> @div class: 'cursor-position inline-block' initialize: (@statusBar) -> @subscribe @statusBar, 'active-buffer-changed', @updateCursorPositionText @subscribe atom.workspaceView, 'cursor:moved', @updateCursorPosit...
{View} = require 'atom' module.exports = class CursorPositionView extends View @content: -> @div class: 'cursor-position inline-block', => @span outlet: 'cursorPosition' initialize: (@statusBar) -> @subscribe @statusBar, 'active-buffer-changed', @updateCursorPositionText @subscribe atom.workspac...
Add new "error" attribute in the StatusMessage
angular.module("admin.utils").factory "StatusMessage", -> new class StatusMessage types: progress: {style: {color: '#ff9906'}} alert: {style: {color: 'grey'}} notice: {style: {color: 'grey'}} success: {style: {color: '#9fc820'}} failure: {style: {color: '#da5354'}} status...
angular.module("admin.utils").factory "StatusMessage", -> new class StatusMessage types: progress: {style: {color: '#ff9906'}} alert: {style: {color: 'grey'}} notice: {style: {color: 'grey'}} success: {style: {color: '#9fc820'}} failure: {style: {color: '#da5354'}} error...
Make the alias between checked and displayContent one way.
ETahi.QuestionCheckComponent = ETahi.QuestionComponent.extend layoutName: 'components/question/check_component' multipleAdditionalData: false displayContent: Em.computed.alias('checked') checked: ((key, value, oldValue) -> if arguments.length > 1 #setter @set('model.answer', value) else ...
ETahi.QuestionCheckComponent = ETahi.QuestionComponent.extend layoutName: 'components/question/check_component' multipleAdditionalData: false displayContent: Em.computed.oneWay('checked') checked: ((key, value, oldValue) -> if arguments.length > 1 #setter @set('model.answer', value) else ...
Fix parsing filter for API requests
window.Posts ?= {} window.Posts.PostsFactory = ($http, $q)-> fetchPosts = (page) -> params = {} angular.extend(params, {category: @filter.join(",")}) unless filterPresent() angular.extend(params, {page: page}) if page != 1 angular.extend(params, {sort: @sort}) if @sort != "top" $http({method: "...
window.Posts ?= {} window.Posts.PostsFactory = ($http, $q)-> fetchPosts = (page) -> params = {} angular.extend(params, {category: @filter.join(",")}) if @filterPresent() angular.extend(params, {page: page}) if page != 1 angular.extend(params, {sort: @sort}) if @sort != "top" $http({method: "GET...
Add update device valid check
Authenticate: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' SubscriptionList: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' on: 204: 'check-configure-whitelist' 'check-configure-whitelist': task: 'meshblu-core-task-check-con...
Authenticate: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' SubscriptionList: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' on: 204: 'check-configure-whitelist' 'check-configure-whitelist': task: 'meshblu-core-task-check-con...
Add change item to editor context menu
'menu': [ 'label': 'Edit' 'submenu': [ 'label': 'Select Grammar' 'command': 'grammar-selector:show' ] ]
'menu': [ 'label': 'Edit' 'submenu': [ 'label': 'Select Grammar' 'command': 'grammar-selector:show' ] ] 'context-menu': '.overlayer': [ 'label': 'Change Grammar' 'command': 'grammar-selector:show' ]
Allow urls that already have the ws:// scheme, add it if it's missing. This also allows for wss:// for websockets over ssl.
### WebSocket Interface for the WebSocketRails client. ### class WebSocketRails.WebSocketConnection constructor: (@url,@dispatcher) -> @_conn = new WebSocket("ws://#{@url}") @_conn.onmessage = @on_message @_conn.onclose = @on_close trigger: (event_name, data, connection_id) => payload ...
### WebSocket Interface for the WebSocketRails client. ### class WebSocketRails.WebSocketConnection constructor: (@url,@dispatcher) -> @url = "ws://#{@url}" unless @url.match(/^wss?:\/\//) @_conn = new WebSocket(@url) @_conn.onmessage = @on_message @_conn.onclose = @on_close ...
Change keymap selector from `.workspace` to `.editor`
# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://ato...
'.editor': 'ctrl-alt-b': 'latex:build'
Adjust the white space to make the linter happy
_ = require "underscore" Markup = require "./markup" p = require "../../core/properties" class DivView extends Markup.View tagName: "div" render: () -> super() if @mget('render_as_text') == true @$el.text(@mget('text')) else @$el.html(@mget('text')) return @ class Div extends Mar...
_ = require "underscore" Markup = require "./markup" p = require "../../core/properties" class DivView extends Markup.View tagName: "div" render: () -> super() if @mget('render_as_text') == true @$el.text(@mget('text')) else @$el.html(@mget('text')) return @ class Div extends Markup....
Kill player after current tick in SinglePlayerListener
define(['listener'], (Listener) -> class SinglePlayerListener extends Listener notify: (player1, player2, point) -> console.log "Collision: #{player1} #{player2} #{point}" @game.killPlayer(player2, point) SinglePlayerListener )
define(['listener'], (Listener) -> class SinglePlayerListener extends Listener notify: (player1, player2, point) -> console.log "Collision: #{player1.name} #{player2.name} #{point}" @game.runAfterTick((game) -> game.killPlayer(player2, point)) SinglePlayerListener )
Remove function accidentally committed with merge
path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getCo...
path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getCo...
Update app.Routes to new este.Routes. Simply!
goog.provide 'app.Routes' goog.require 'este.Routes' class app.Routes extends este.Routes ###* @constructor @extends {este.Routes} ### constructor: -> super() @home = new este.Route '/', Routes.MSG_HOME @newSong = new este.Route '/@me/songs/new', Routes.MSG_NEW_SONG @song = new este.Rou...
goog.provide 'app.Routes' goog.require 'este.Routes' class app.Routes extends este.Routes ###* @param {app.Storage} storage @constructor @extends {este.Routes} ### constructor: (@storage) -> super() @home = @route '/' @newSong = @route '/@me/songs/new' @song = @route '/@me/songs/:u...
Use fs::readFileSync instead of deprecated fs::read
PEG = require 'pegjs' {fs} = require 'atom' grammarSrc = fs.read(require.resolve('./snippet-body.pegjs')) module.exports = PEG.buildParser(grammarSrc, trackLineAndColumn: true)
PEG = require 'pegjs' {fs} = require 'atom' grammarSrc = fs.readFileSync(require.resolve('./snippet-body.pegjs'), 'utf8') module.exports = PEG.buildParser(grammarSrc, trackLineAndColumn: true)
Add tooltip to cursor position status
class CursorPositionView extends HTMLElement initialize: -> @classList.add('cursor-position', 'inline-block') @activeItemSubscription = atom.workspace.onDidChangeActivePaneItem (activeItem) => @subscribeToActiveTextEditor() @subscribeToActiveTextEditor() destroy: -> @activeItemSubscription....
class CursorPositionView extends HTMLElement initialize: -> @classList.add('cursor-position', 'inline-block') @activeItemSubscription = atom.workspace.onDidChangeActivePaneItem (activeItem) => @subscribeToActiveTextEditor() @subscribeToActiveTextEditor() @tooltip = atom.tooltips.add(this, tit...
Call @stickit() at end of default View render if bindings available
Chaplin = require 'chaplin' module.exports = class BaseView extends Chaplin.View autoRender: true getTemplateFunction: -> @template delegateNewEvents: (events) -> @_delegateEvents events # This is different from Chaplin.View::dispose in that it doesn't try to # remove the el on disposal. dispose: -...
Chaplin = require 'chaplin' module.exports = class BaseView extends Chaplin.View autoRender: true getTemplateFunction: -> @template delegateNewEvents: (events) -> @_delegateEvents events render: -> super if @bindings @stickit() @ # This is different from Chaplin.View::dispose in...
Fix bug in quick load url retry logic.
$(document).ready -> quick_add_url_button = $('#quick-add-url-button') input = $('#quick-add-url') status = quick_add_url_button quick_add_url_button.click -> status.text('Submitting URL') url = input.val() $.ajax '/src_images/', type: 'post' contentType: 'application/json' dataT...
$(document).ready -> quick_add_url_button = $('#quick-add-url-button') input = $('#quick-add-url') status = quick_add_url_button quick_add_url_button.click -> status.text('Submitting URL') url = input.val() $.ajax '/src_images/', type: 'post' contentType: 'application/json' dataT...
Use bluebird only as polyfill
require './shim/phantomjs-bind' window.Promise = require 'bluebird' if process.env.NODE_ENV == 'development' Promise.longStackTraces() window.Rdb = require('rdb/index')
require './shim/phantomjs-bind' unless window.Promise? window.Promise = require 'bluebird' if process.env.NODE_ENV == 'development' Promise.longStackTraces() window.Rdb = require('rdb/index')
Update previews after a module is saved
class CMS.Views.ModuleEdit extends Backbone.View tagName: 'section' className: 'edit-pane' events: 'click .cancel': 'cancel' 'click .module-edit': 'editSubmodule' 'click .save-update': 'save' initialize: -> @$el.load @model.editUrl(), => @model.loadModule(@el) # Load preview modul...
class CMS.Views.ModuleEdit extends Backbone.View tagName: 'section' className: 'edit-pane' events: 'click .cancel': 'cancel' 'click .module-edit': 'editSubmodule' 'click .save-update': 'save' initialize: -> @$el.load @model.editUrl(), => @model.loadModule(@el) # Load preview modul...
Call atom.show() from a setTimeout()
# Like sands through the hourglass, so are the days of our lives. date = new Date().getTime() require 'atom' require 'window' window.setUpEnvironment() window.startup() atom.show() console.log "Load time: #{new Date().getTime() - date}"
# Like sands through the hourglass, so are the days of our lives. date = new Date().getTime() require 'atom' require 'window' window.setUpEnvironment() window.startup() setTimeout((-> atom.show()), 0) console.log "Load time: #{new Date().getTime() - date}"
Update for api changes yet again.
LINES_TO_JUMP = 10 getEditSession = -> atom.workspaceView.getActiveView()?.activeEditSession module.exports = activate: (state) -> atom.workspaceView.command 'line-jumper:move-up', => getEditSession()?.moveCursorUp(LINES_TO_JUMP) atom.workspaceView.command 'line-jumper:move-down', => getEditS...
LINES_TO_JUMP = 10 getEditor = -> atom.workspaceView.getActiveView()?.editor module.exports = activate: (state) -> atom.workspaceView.command 'line-jumper:move-up', => getEditor()?.moveCursorUp(LINES_TO_JUMP) atom.workspaceView.command 'line-jumper:move-down', => getEditor()?.moveCursorDown(L...
Allow for single slash to be a delimiter
# The SplitStr component receives a string in the in port, splits it by # string specified in the delimiter port, and send each part as a separate # packet to the out port noflo = require "../../lib/NoFlo" class SplitStr extends noflo.Component constructor: -> @delimiterString = "\n" @strings = []...
# The SplitStr component receives a string in the in port, splits it by # string specified in the delimiter port, and send each part as a separate # packet to the out port noflo = require "../../lib/NoFlo" class SplitStr extends noflo.Component constructor: -> @delimiterString = "\n" @strings = []...
Change the regex in such a way so that user's name is stripped automatically.
# Description: # Rajinikanth is Chuck Norris of India, witness his awesomeness. # # Dependencies: # "cheerio": "0.7.0" # # Configuration: # None # # Commands: # hubot rajinikanth|rajini -- random Rajinikanth awesomeness # hubot rajinikanth|rajini me <user> -- let's see how <user> would do as Rajinikanth # # A...
# Description: # Rajinikanth is Chuck Norris of India, witness his awesomeness. # # Dependencies: # "cheerio": "0.7.0" # # Configuration: # None # # Commands: # hubot rajinikanth|rajini -- random Rajinikanth awesomeness # hubot rajinikanth|rajini me <user> -- let's see how <user> would do as Rajinikanth # # A...
Fix pick into empty array.
{APLArray} = require '../array' @['βŠƒ'] = (omega, alpha) -> if alpha # Pick (`βŠƒ`) # # β¬βŠƒ3 <=> 3 # 2βŠƒ'PICK' <=> 'C' # 1 0βŠƒ2 2⍴'ABCD' <=> 'C' # 1βŠƒ'foo' 'bar' <=> 'bar' if alpha.shape.length > 1 throw RankError pick = alpha.toArray() if pick.length isnt omega....
{APLArray} = require '../array' @['βŠƒ'] = (omega, alpha) -> if alpha # Pick (`βŠƒ`) # # β¬βŠƒ3 <=> 3 # 2βŠƒ'PICK' <=> 'C' # 1 0βŠƒ2 2⍴'ABCD' <=> 'C' # 1βŠƒ'foo' 'bar' <=> 'bar' if alpha.shape.length > 1 throw RankError pick = alpha.toArray() if pick.length isnt omega....
Implement Kissmetrics' request signing and use context binding for static methods
# # Kissmetrics Batch class BatchKissmetricsClient @HOST: 'api.kissmetrics.com' @HTTP_METHOD: 'POST' @API_VERSION: 'v1' @process: (queue, apiKey, apiSecret, productGUID) -> http = require 'http' apiVersion = BatchKissmetricsClient.API_VERSION urlPath = "#{apiVersion}/products/#{productGUID}/tr...
# # Kissmetrics Batch class BatchKissmetricsClient @HOST: 'api.kissmetrics.com' @HTTP_METHOD: 'POST' @API_VERSION: 'v1' @process: (queue, apiKey, apiSecret, productGUID) => http = require 'http' urlPath = "#{@API_VERSION}/products/#{productGUID}/tracking/e" baseUrl = "http://#{@HOST}/#{urlPat...
Add locale replace rule for \!
through2 = require 'through2' parsePropertiesFile = (fileContent) -> out = {} lines = fileContent.split '\n' for line in lines if match = line.match '([a-zA-Z0-9\._-]+)[ ]?=[ ]?(.*)' [__, key, value] = match out[key] = value out i18n = () -> through2.obj (file, encoding, callback) -> i1...
through2 = require 'through2' parsePropertiesFile = (fileContent) -> out = {} lines = fileContent.split '\n' for line in lines if match = line.match '([a-zA-Z0-9\._-]+)[ ]?=[ ]?(.*)' [__, key, value] = match out[key] = value out i18n = () -> through2.obj (file, encoding, callback) -> i1...
Fix typo in fits viewer stub
BaseTool = window.Ubret.BaseTool or require('./base_tool') class FitsViewer extends BaseTool constructor:
BaseTool = window.Ubret.BaseTool or require('./base_tool') class FitsViewer extends BaseTool
Introduce javascript event to init form components
# Enable any date choosers on page jQuery -> $(".date-chooser").each -> new window.DateChooser($(this)) $("form [data-show-when]").each -> new window.ShowHide($(this)) $("form [data-disable-when]").each -> new window.DisableChecker($(this)) $("table tr.clickable-row").each -> $(this).addClass...
# Enable any date choosers on page jQuery -> $(document).on "drs:init_form_components", (e) -> $target = $(e.target) $target.find(".date-chooser").each -> new window.DateChooser($(this)) $target.find("form [data-show-when]").each -> new window.ShowHide($(this)) $target.find("form [data...
Load the environment before express so our defaults are set correctly
#!node_modules/.bin/coffee ### # server.coffee # # Β© 2014 Dan Nichols # See LICENSE for more details # # Our NodeJS server application. Nothing too special here, a quick ExpressJS # app that serves a single page AngularJS app. In production all it will # handle is the single page app, as all static content will be h...
#!node_modules/.bin/coffee ### # server.coffee # # Β© 2014 Dan Nichols # See LICENSE for more details # # Our NodeJS server application. Nothing too special here, a quick ExpressJS # app that serves a single page AngularJS app. In production all it will # handle is the single page app, as all static content will be h...
Remove old prop _isInReplayMode left in by mistake
class Space.eventSourcing.Projection extends Space.Object @mixin Space.messaging.EventSubscribing collections: {} _isInReplayMode: false _state: null _queuedEvents: null constructor: -> super @_state = 'projecting' @_queuedEvents = [] @dependencies = {} _.extend @dependencies, @constr...
class Space.eventSourcing.Projection extends Space.Object @mixin Space.messaging.EventSubscribing collections: {} _state: null _queuedEvents: null constructor: -> super @_state = 'projecting' @_queuedEvents = [] @dependencies = {} _.extend @dependencies, @constructor::dependencies, @col...
Fix bug in addition form
mid = new Date('02/25/14 00:00:00') Template.agenda.day1 = -> @items.filter((i) -> i.time < mid).sort((a, b) -> a.time >= b.time) Template.agenda.day2 = -> @items.filter((i) -> i.time > mid).sort((a, b) -> a.time >= b.time) Template.agenda.canSee = -> u = User.current() u and (u.admin() or u.moderator()) Tem...
mid = new Date('02/25/14 00:00:00') Template.agenda.day1 = -> @items.filter((i) -> i.time < mid).sort((a, b) -> a.time >= b.time) Template.agenda.day2 = -> @items.filter((i) -> i.time > mid).sort((a, b) -> a.time >= b.time) Template.agenda.canSee = -> u = User.current() u and (u.admin() or u.moderator()) Tem...
Support rendering children of test component
_ = require 'underscore' expect = chai.expect React = require 'react' ReactAddons = require('react/addons') ReactTestUtils = React.addons.TestUtils {Promise} = require 'es6-promise' {commonActions} = require './utilities' sandbox = null Wrapper = React.createClass render: -> React.createElement(@props._...
_ = require 'underscore' expect = chai.expect React = require 'react' ReactAddons = require('react/addons') ReactTestUtils = React.addons.TestUtils {Promise} = require 'es6-promise' {commonActions} = require './utilities' sandbox = null Wrapper = React.createClass render: -> React.createElement(@props._...
Remove tutorial and hide marks buttons
React = require 'react' Favourite = require './favourite' module.exports = React.createClass displayName: 'SubjectTools' render: -> <div className="drawing-controls"> {<Favourite project={@props.project} api={@props.api} subject={@props.subject} /> if @props.subject? && @props.user?} <label clas...
React = require 'react' Favourite = require './favourite' module.exports = React.createClass displayName: 'SubjectTools' render: -> <div className="drawing-controls"> {<Favourite project={@props.project} api={@props.api} subject={@props.subject} /> if @props.subject? && @props.user?} </div>
Refactor browersync into its own function
gulp = require 'gulp' browserSync = require 'browser-sync' config = require './config.coffee' argv = require('yargs').argv nodemon = require 'gulp-nodemon' gulp.task 'api', -> nodemon script: 'server/server.js' ext: 'coffee' ignore: ['src/*', 'gulp/*', 'gulpfile.coffee', 'tests/*'] gulp.task 'serve', [ ...
gulp = require 'gulp' browserSync = require 'browser-sync' config = require './config.coffee' argv = require('yargs').argv nodemon = require 'gulp-nodemon' server = -> browserSync server: {baseDir: config.path} port: 4000 open: false reloadOnRestart: false notify: false ghostMode: argv.ghost ...
Implement validating files from the CLI
parser = require 'nomnom' braveMouse = require '../brave-mouse' braveMousePackageJson = require '../../package.json' module.exports = (argv) -> opts = parser .script 'brave-mouse' .options help: abbr: 'h' flag: true help: 'Print this help message' version: abbr: 'v' flag: true help: 'Print br...
async = require 'async' parser = require 'nomnom' braveMouse = require '../brave-mouse' braveMousePackageJson = require '../../package.json' module.exports = (argv) -> opts = parser .script 'brave-mouse' .options path: position: 0 help: 'Files to validate against your .editorconfig.' list: true help: ...
Fix fake map on node edit page.
Wheelmap.FakeMapView = Ember.View.extend classNames: 'fake-map' attributeBindings: ['style'] style: (()-> location = @get('controller.location') unless location? return '' "background-image: url(http://api.tiles.mapbox.com/v4/sozialhelden.map-iqt6py1k/#{location.lng},#{location.lat},17/1280x1...
Wheelmap.FakeMapView = Ember.View.extend classNames: 'fake-map' attributeBindings: ['style'] style: (()-> location = @get('controller.location') unless location? return '' "background-image: url(http://api.tiles.mapbox.com/v4/sozialhelden.map-iqt6py1k/#{location.lng},#{location.lat}," + ...
Refresh localstorage data on GET
'use strict' class UserViolationsPrefsCtrl constructor: (@scope, @UserViolationsPrefsFcty, @growlNotifications, @localStorage) -> @getPrefs() @selectedFlag = {} _fillPrefs: (data) => @prefs = data @groupData = _.groupBy(@prefs, 'category') for x of @groupData @selectedFlag[x] = ! _.some...
'use strict' class UserViolationsPrefsCtrl constructor: (@scope, @UserViolationsPrefsFcty, @growlNotifications, @localStorage) -> @getPrefs() @selectedFlag = {} _fillPrefs: (data) => @prefs = data @groupData = _.groupBy(@prefs, 'category') @localStorage.userprefs = @groupData for x of @gr...
Add a comment about local storage
module.exports = { data: window.preload or {} tasks: {} init: (fn) -> fn.call(this) add: (obj) -> @tasks[key] = fn.bind(this) for key, fn of obj return obj bind: (fn) -> return @callback = fn change: -> return @callback(@data) if @callback }
# TODO try to load the state from local storage. # BUT if there's no cookie, then act like local storage isn't there. # Also, state changes `change` should update the data in local storage as well. module.exports = { data: window.preload or {} tasks: {} init: (fn) -> fn.call(this) add: (obj) ...
Make Atom Linter less obtrusive
"*": core: disabledPackages: [ "archive-view" "background-tips" "deprecation-cop" "dev-live-reload" "welcome" "update-package-dependencies" "timecop" "exception-reporting" "image-view" "metrics" "open-on-github" "release-notes" "stylegu...
"*": core: disabledPackages: [ "archive-view" "background-tips" "dev-live-reload" "welcome" "update-package-dependencies" "timecop" "exception-reporting" "image-view" "metrics" "open-on-github" "release-notes" "styleguide" "autocomplete...
Remove cruft to show multiple voters
class OpinionatorsAvatarView extends Backbone.Marionette.Layout tagName: 'span' className: 'opinionators-avatar' template: 'opinionators/avatar' onRender: -> UserPopoverContentView.makeTooltip @, @model class window.OpinionatorsAvatarsView extends Backbone.Marionette.CompositeView tagName: 'span' clas...
class OpinionatorsAvatarView extends Backbone.Marionette.Layout tagName: 'span' className: 'opinionators-avatar' template: 'opinionators/avatar' onRender: -> UserPopoverContentView.makeTooltip @, @model class window.OpinionatorsAvatarsView extends Backbone.Marionette.CompositeView tagName: 'span' clas...
Add a spec about lowercasing config values
describe 'Custom Element Base', -> registerCustomElement = require('../base.min.js') {getCustomElement} = require('./helper') it 'fires the events in order', -> lastRan = null element = new (registerCustomElement(getCustomElement({ name: 'x-spec-event-order' created: -> lastRan = 'created' ...
describe 'Custom Element Base', -> registerCustomElement = require('../base.min.js') {getCustomElement} = require('./helper') it 'fires the events in order', -> lastRan = null element = new (registerCustomElement(getCustomElement({ name: 'x-spec-event-order' created: -> lastRan = 'created' ...
Fix category route to sync with new paging model
App.CategoriesShowRoute = Em.Route.extend model: (params) -> App.Category.find(params.id) setupController: (controller, model) -> @_super controller, model @controllerFor('pagedTransactions').setProperties page: 1 renderTemplate: -> @_super() @render 'transactions', into: 'categor...
App.CategoriesShowRoute = Em.Route.extend model: (params) -> App.Category.find(params.id) setupController: (controller, model) -> @_super controller, model transactionsController = @controllerFor('transactions') model.reload().then -> transactionsController.setProperties model: model....
Build tests from array of IDs
module "localized" test "local time", -> assertLocalized "one" assertLocalized "two" test "local time in the past", -> assertLocalized "past" test "local time in the future", -> assertLocalized "future" test "local date", -> assertLocalized "date", "date" assertLocalized = (id, type = "time") -> switc...
module "localized" for id in ["one", "two", "past", "future"] test id, -> assertLocalized id test "date", -> assertLocalized "date", "date" assertLocalized = (id, type = "time") -> switch type when "time" momentFormat = "MMMM D, YYYY h:mma" compare = "toString" when "date" moment...