commit
stringlengths
40
40
old_file
stringlengths
9
134
new_file
stringlengths
9
134
old_contents
stringlengths
0
2.21k
new_contents
stringlengths
34
3.19k
subject
stringlengths
14
340
message
stringlengths
15
1.43k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
9
29k
5174f3b3e68ff6a19efade57d543b9c2038840b3
bokehjs/test/models/transforms/jitter_transform.coffee
bokehjs/test/models/transforms/jitter_transform.coffee
{expect} = require "chai" utils = require "../../utils" {Collections} = utils.require "base" describe "step_interpolator_transform module", -> source = {start: 0, end: 10} target = {start: 20, end: 80} generate_jitter = -> Collections("Jitter").create width: 1 center: 0 distribution: 'uniform' describe "Jitter with uniform", -> transform = generate_jitter() transform.set('distribution', 'uniform') it "should average the fixed values", -> vals = Array.apply(null, Array(10)).map(function(){return 5}) rets = transform.v_compute(vals) add(a, b) -> return a+b thesum = rets.reduce(add, 0) thediff = (thesum/1000) - 5 expect(thediff).to.be.below 0.01 describe "Jitter with normal", -> transform = generate_jitter() transform.set('distribution', 'normal') it "should average the fixed values", -> vals = Array.apply(null, Array(10)).map(function(){return 5}) rets = transform.v_compute(vals) add(a, b) -> return a+b thesum = rets.reduce(add, 0) thediff = (thesum/1000) - 5 expect(thediff).to.be.below 0.01
{expect} = require "chai" utils = require "../../utils" {Collections} = utils.require "base" describe "step_interpolator_transform module", -> source = {start: 0, end: 10} target = {start: 20, end: 80} generate_jitter = -> Collections("Jitter").create width: 1 center: 0 distribution: 'uniform' describe "Jitter with uniform", -> transform = generate_jitter() transform.set('distribution', 'uniform') it "should average the fixed values", -> vals = Array.apply(null, Array(10)).map -> 5 rets = transform.v_compute(vals) add(a, b) -> return a+b thesum = rets.reduce(add, 0) thediff = (thesum/1000) - 5 expect(thediff).to.be.below 0.01 describe "Jitter with normal", -> transform = generate_jitter() transform.set('distribution', 'normal') it "should average the fixed values", -> vals = Array.apply(null, Array(10)).map -> 5 rets = transform.v_compute(vals) add(a, b) -> return a+b thesum = rets.reduce(add, 0) thediff = (thesum/1000) - 5 expect(thediff).to.be.below 0.01
Put in correct form for the CoffeeScript to make JS
Put in correct form for the CoffeeScript to make JS
CoffeeScript
bsd-3-clause
quasiben/bokeh,azjps/bokeh,ericmjl/bokeh,percyfal/bokeh,ericmjl/bokeh,ericmjl/bokeh,justacec/bokeh,quasiben/bokeh,clairetang6/bokeh,bokeh/bokeh,ptitjano/bokeh,DuCorey/bokeh,mindriot101/bokeh,timsnyder/bokeh,clairetang6/bokeh,mindriot101/bokeh,rs2/bokeh,timsnyder/bokeh,azjps/bokeh,aiguofer/bokeh,rs2/bokeh,philippjfr/bokeh,timsnyder/bokeh,rs2/bokeh,aavanian/bokeh,draperjames/bokeh,DuCorey/bokeh,jakirkham/bokeh,bokeh/bokeh,dennisobrien/bokeh,schoolie/bokeh,justacec/bokeh,ericmjl/bokeh,ptitjano/bokeh,justacec/bokeh,draperjames/bokeh,azjps/bokeh,philippjfr/bokeh,dennisobrien/bokeh,dennisobrien/bokeh,DuCorey/bokeh,schoolie/bokeh,dennisobrien/bokeh,jakirkham/bokeh,draperjames/bokeh,azjps/bokeh,bokeh/bokeh,philippjfr/bokeh,aavanian/bokeh,percyfal/bokeh,phobson/bokeh,clairetang6/bokeh,schoolie/bokeh,ericmjl/bokeh,jakirkham/bokeh,phobson/bokeh,philippjfr/bokeh,timsnyder/bokeh,jakirkham/bokeh,percyfal/bokeh,bokeh/bokeh,ptitjano/bokeh,schoolie/bokeh,jakirkham/bokeh,rs2/bokeh,aiguofer/bokeh,mindriot101/bokeh,timsnyder/bokeh,draperjames/bokeh,dennisobrien/bokeh,aavanian/bokeh,phobson/bokeh,rs2/bokeh,phobson/bokeh,azjps/bokeh,Karel-van-de-Plassche/bokeh,justacec/bokeh,philippjfr/bokeh,stonebig/bokeh,DuCorey/bokeh,stonebig/bokeh,ptitjano/bokeh,stonebig/bokeh,Karel-van-de-Plassche/bokeh,ptitjano/bokeh,mindriot101/bokeh,percyfal/bokeh,aiguofer/bokeh,quasiben/bokeh,clairetang6/bokeh,aiguofer/bokeh,DuCorey/bokeh,aiguofer/bokeh,Karel-van-de-Plassche/bokeh,Karel-van-de-Plassche/bokeh,aavanian/bokeh,Karel-van-de-Plassche/bokeh,stonebig/bokeh,draperjames/bokeh,schoolie/bokeh,bokeh/bokeh,percyfal/bokeh,phobson/bokeh,aavanian/bokeh
e45c901b2b759e77ab01207bb45f8c86847dc029
lib/models/git-checkout-current-file.coffee
lib/models/git-checkout-current-file.coffee
git = require '../git' StatusView = require '../views/status-view' Path = require 'path' gitCheckoutCurrentFile = -> currentFile = atom.project.getRepo().relativize atom.workspace.getActiveEditor()?.getPath() git( ['checkout', currentFile], (data) -> new StatusView(type: 'success', message: data.toString()) ) module.exports = gitCheckoutCurrentFile
git = require '../git' StatusView = require '../views/status-view' Path = require 'path' gitCheckoutCurrentFile = -> currentFile = atom.project.getRepo().relativize atom.workspace.getActiveEditor()?.getPath() git( ['checkout', '--', currentFile], (data) -> new StatusView(type: 'success', message: data.toString()) ) module.exports = gitCheckoutCurrentFile
Fix error if filename matches an existing branch
Fix error if filename matches an existing branch
CoffeeScript
mit
akonwi/git-plus,akonwi/git-plus
d741e1464703caefcd9aa46654ee5fa6c71f884c
cake/lib/scaffold.coffee
cake/lib/scaffold.coffee
scaffolt = require 'scaffolt' _s = require 'underscore.string' module.exports = class Scaffold @generate: -> scaffold = new Scaffold scaffold.generate arguments... @destroy: -> scaffold = new Scaffold scaffold.destroy arguments... generate: (name = '', callback = ->) -> scaffolt @className(), name, callback destroy: (name = '', callback = ->) -> scaffolt @className(), name, {revert: yes}, callback className: -> _s.dasherize(@constructor.name).replace(/^-/, '')
scaffolt = require 'scaffolt' _s = require 'underscore.string' module.exports = class Scaffold @generate: -> scaffold = new @constructor scaffold.generate arguments... @destroy: -> scaffold = new @constructor scaffold.destroy arguments... generate: (name = '', callback = ->) -> scaffolt @className(), name, callback destroy: (name = '', callback = ->) -> scaffolt @className(), name, {revert: yes}, callback className: -> _s.dasherize(@constructor.name).replace(/^-/, '')
Fix issue in class methods for Scaffold
Fix issue in class methods for Scaffold
CoffeeScript
mit
jupl/btc-cordova,jupl/btc-angular,jackhung/wokchap,jupl/btc-chaplin,jupl/btc,jupl/btc-ember,jupl/btc-serverpack
f93d1d03fc85cabfd9a4a7ae8eb08f05c3be8f41
src/app/admin/states/teachingperiods/teachingperiods.coffee
src/app/admin/states/teachingperiods/teachingperiods.coffee
angular.module('doubtfire.admin.states.teachingperiods', []) # # Convenors of a unit(s) can see a list of all the units they convene # in this view and make changes to those units. # # Users with an Administrator system role can create new units. # .config((headerServiceProvider) -> teachingPeriodsAdminViewStateData = url: "/admin/teachingperiods" views: main: controller: "AdministerTeachingPeriodsState" templateUrl: "admin/states/teachingperiods/teachingperiods.tpl.html" data: pageTitle: "_Teaching-Period Administration_" roleWhitelist: ['Admin'] headerServiceProvider.state "admin/teachingperiods", teachingPeriodsAdminViewStateData ) .controller("AdministerTeachingPeriodsState", ($scope, $state, $modal, ExternalName, currentUser, alertService, TeachingPeriod, TeachingPeriodSettingsModal) -> $scope.teachingPeriods = TeachingPeriod.query() # Table sort details $scope.sortOrder = "start_date" $scope.reverse = true # Pagination details $scope.currentPage = 1 $scope.maxSize = 5 $scope.pageSize = 15 # Get the confugurable, external name of Doubtfire $scope.externalName = ExternalName # User settings/create modal $scope.showTeachingPeriodModal = (teachingPeriod) -> # If we're given a user, show that user, else create a new one teachingPeriodToShow = if teachingPeriod? then teachingPeriod else { } TeachingPeriodSettingsModal.show teachingPeriodToShow )
angular.module('doubtfire.admin.states.teachingperiods', []) # # Users with an Administrator system role can create new Teaching Periods. # .config((headerServiceProvider) -> teachingPeriodsAdminViewStateData = url: "/admin/teachingperiods" views: main: controller: "AdministerTeachingPeriodsState" templateUrl: "admin/states/teachingperiods/teachingperiods.tpl.html" data: pageTitle: "_Teaching-Period Administration_" roleWhitelist: ['Admin'] headerServiceProvider.state "admin/teachingperiods", teachingPeriodsAdminViewStateData ) .controller("AdministerTeachingPeriodsState", ($scope, $state, $modal, ExternalName, currentUser, alertService, TeachingPeriod, TeachingPeriodSettingsModal) -> $scope.teachingPeriods = TeachingPeriod.query() # Table sort details $scope.sortOrder = "start_date" $scope.reverse = true # Pagination details $scope.currentPage = 1 $scope.maxSize = 5 $scope.pageSize = 15 # Get the confugurable, external name of Doubtfire $scope.externalName = ExternalName # User settings/create modal $scope.showTeachingPeriodModal = (teachingPeriod) -> # If we're given a user, show that user, else create a new one teachingPeriodToShow = if teachingPeriod? then teachingPeriod else { } TeachingPeriodSettingsModal.show teachingPeriodToShow )
Comment explaining teaching period state
FIX: Comment explaining teaching period state
CoffeeScript
agpl-3.0
doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web
0c472ff8cf7a714ba9e3c4f99b64d5d5e0db952f
lib/package-keymap-view.coffee
lib/package-keymap-view.coffee
{$$$, View} = require 'atom' # Displays the keybindings for a package namespace module.exports = class PackageKeymapView extends View @content: -> @section => @div class: 'section-heading icon icon-keyboard', 'Keybindings' @table outlet: 'keymapTable', class: 'package-keymap-table table native-key-bindings text', tabindex: -1, => @thead => @tr => @th 'Keystroke' @th 'Command' @th 'Selector' @tbody outlet: 'keybindingItems' initialize: (namespace) -> for {command, keystroke, selector} in atom.keymap.getKeyBindings() continue unless command.indexOf("#{namespace}:") is 0 @keybindingItems.append $$$ -> @tr class: 'package-keymap-item', => @td class: 'keystroke', keystroke @td class: 'command', command @td class: 'selector', selector @hide() unless @keybindingItems.children().length > 0
{$$$, View} = require 'atom' # Displays the keybindings for a package namespace module.exports = class PackageKeymapView extends View @content: -> @section => @div class: 'section-heading icon icon-keyboard', 'Keybindings' @table class: 'package-keymap-table table native-key-bindings text', tabindex: -1, => @thead => @tr => @th 'Keystroke' @th 'Command' @th 'Selector' @tbody outlet: 'keybindingItems' initialize: (namespace) -> for {command, keystroke, selector} in atom.keymap.getKeyBindings() continue unless command.indexOf("#{namespace}:") is 0 @keybindingItems.append $$$ -> @tr => @td keystroke @td command @td selector @hide() unless @keybindingItems.children().length > 0
Remove unused classes and outlets
Remove unused classes and outlets
CoffeeScript
mit
atom/settings-view
4bc6442073e08cb68748028a55a9692aa9b06ae1
projects.cson
projects.cson
[ { title: ".atom" paths: [ "~/.atom" ] devMode: true } { title: ".files" paths: [ "~/.files" ] devMode: true } { title: "language-roff" paths: [ "~/Labs/language-roff" ] devMode: true } { title: "file-icons" paths: [ "~/Labs/file-icons" ] devMode: true } { title: "Atom-FS" paths: [ "~/Labs/Atom-FS" "~/Labs/Utils" ] devMode: true } { title: "Utils" paths: [ "~/Labs/Utils" ] devMode: true } ]
[ { title: ".atom" paths: [ "~/.atom" ] devMode: true } { title: ".files" paths: [ "~/.files" ] devMode: true } { title: "language-roff" paths: [ "~/Labs/language-roff" ] devMode: true } { title: "file-icons" paths: [ "~/Labs/file-icons" ] devMode: true } { title: "Atom-FS" paths: [ "~/Labs/Atom-FS" ] devMode: true } { title: "Utils" paths: [ "~/Labs/Utils" ] devMode: true } ]
Remove `~/Labs/Utils` from Atom-FS's project entry
Remove `~/Labs/Utils` from Atom-FS's project entry
CoffeeScript
isc
Alhadis/Atom-PhoenixTheme
b70bba1e254f95480f315d65e21d327852e6860b
coffee/views/menu.coffee
coffee/views/menu.coffee
define [ "jquery" "chaplin" "views/base/view" "lib/utils" "templates/menu" ], ($, Chaplin, View, utils, template) -> "use strict" class MenuView extends View el: "#menu" template: template autoRender: true events: "click #common_menu a": "navigate" "click #logout": "logout" initialize: -> super Chaplin.mediator.subscribe "!router:changeURL", (url) => $("#common_menu>li").removeClass("active") a = $("#common_menu a[href='/#{url}']") if a.length a.parent().addClass("active") # Reload controller even if url was not changed navigate: (e) -> url = $(e.currentTarget).attr("href") utils.gotoUrl url # For some reason jQuery's event.preventDefault() doesn't work here false logout: (e) -> e.preventDefault() utils.clearAuth() @render() utils.gotoUrl "/" afterRender: -> super @$(".dropdown-toggle").dropdown()
define [ "jquery" "chaplin" "views/base/view" "lib/utils" "templates/menu" ], ($, Chaplin, View, utils, template) -> "use strict" class MenuView extends View el: "#menu" template: template autoRender: true events: "click #common_menu a": "navigate" "click #logout": "logout" initialize: -> super @subscribeEvent "!router:changeURL", (url) -> $("#common_menu>li").removeClass("active") a = $("#common_menu a[href='/#{url}']") if a.length a.parent().addClass("active") # Reload controller even if url was not changed navigate: (e) -> url = $(e.currentTarget).attr("href") utils.gotoUrl url # For some reason jQuery's event.preventDefault() doesn't work here false logout: (e) -> e.preventDefault() utils.clearAuth() @render() utils.gotoUrl "/" afterRender: -> super @$(".dropdown-toggle").dropdown()
Use View's native subscribeEvent method
Use View's native subscribeEvent method I will always read documentation I will always read documentation I will always read documentation
CoffeeScript
cc0-1.0
border-radius/meow-anon,border-radius/meow-anon,Kagami/bnw-meow
69bb48c7794e1e86d5fc0ca285e298c06e8ea9a0
test/exercise/collection.spec.coffee
test/exercise/collection.spec.coffee
_ = require 'underscore' Collection = require 'exercise/collection' step = require '../../api/steps/4571/GET' describe 'Exercise Collection', -> beforeEach -> @stepId = 4571 @step = _.clone(step) Collection.quickLoad(@stepId, @step) describe 'getCurrentPanel', -> it 'returns free-response by default', -> expect(Collection.getCurrentPanel(@stepId)).equal('free-response') it 'returns review if correct answer is present', -> @step.correct_answer_id = 99 Collection.quickLoad(@stepId, @step) expect(Collection.getCurrentPanel(@stepId)).equal('review') it 'returns multiple-choice if free response is present', -> @step.free_response = 'my best guess' Collection.quickLoad(@stepId, @step) expect(Collection.getCurrentPanel(@stepId)).equal('multiple-choice')
_ = require 'underscore' Collection = require 'exercise/collection' step = require '../../api/steps/4571/GET' describe 'Exercise Collection', -> beforeEach -> @stepId = 4571 @step = _.clone(step) Collection.quickLoad(@stepId, @step) describe 'getCurrentPanel', -> it 'returns free-response by default', -> expect(Collection.getCurrentPanel(@stepId)).equal('free-response') it 'returns review if content.questions is missing', -> @step.content = {} Collection.quickLoad(@stepId, @step) expect(Collection.getCurrentPanel(@stepId)).equal('review') it 'returns multiple-choice if free_response is present', -> @step.free_response = 'my best guess' Collection.quickLoad(@stepId, @step) expect(Collection.getCurrentPanel(@stepId)).equal('multiple-choice')
Fix testing for different states
Fix testing for different states
CoffeeScript
agpl-3.0
openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js
1b569b33c0af8ba6ea81b92000c1831773225e3b
menus/atom-sys-angular.cson
menus/atom-sys-angular.cson
# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': '.tree-view .directory > .header': [ { label: 'SysAngular', submenu: [ { label: 'Create Module', command: 'atom-sys-angular:generate-module' }, { label: 'Create Controller', command: 'atom-sys-angular:generate-controller' }, { label: 'Create Directive', command: 'atom-sys-angular:generate-directive' }, { label: 'Create Service', command: 'atom-sys-angular:generate-service' } ] } ]
# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': '.tree-view .directory > .header': [ { label: 'SysAngular', submenu: [ { label: 'Create Module', command: 'atom-sys-angular:generate-module' }, { label: 'Create Controller', command: 'atom-sys-angular:generate-controller' }, { label: 'Create Directive', command: 'atom-sys-angular:generate-directive' }, { label: 'Create Route', command: 'atom-sys-angular:generate-route' }, { label: 'Create Service', command: 'atom-sys-angular:generate-service' } ] } ]
Add 'Create Route' to menu
Add 'Create Route' to menu
CoffeeScript
mit
sysgarage/atom-sys-angular
b4cb26d754255168f7cc204223c9098fc04c09f0
src/components/icon.cjsx
src/components/icon.cjsx
React = require 'react' BS = require 'react-bootstrap' module.exports = React.createClass displayName: 'Icon' propTypes: type: React.PropTypes.string className: React.PropTypes.string tooltip: React.PropTypes.string render: -> classes = ['tutor-icon', 'fa', "fa-#{@props.type}"] classes.push(@props.className) if @props.className icon = <i className={classes.join(' ')} /> if @props.tooltip tooltip = <BS.Tooltip>Useful for talking securely about students over email.</BS.Tooltip> <BS.OverlayTrigger placement='bottom' overlay={tooltip}>{icon}</BS.OverlayTrigger> else icon
React = require 'react' BS = require 'react-bootstrap' module.exports = React.createClass displayName: 'Icon' propTypes: type: React.PropTypes.string className: React.PropTypes.string tooltip: React.PropTypes.string tooltipProps: React.PropTypes.object getDefaultProps: -> tooltipProps: { placement: 'bottom' } render: -> classes = ['tutor-icon', 'fa', "fa-#{@props.type}"] classes.push(@props.className) if @props.className icon = <i className={classes.join(' ')} /> if @props.tooltip tooltip = <BS.Tooltip>{@props.tooltip}</BS.Tooltip> <BS.OverlayTrigger {...@props.tooltipProps} overlay={tooltip}>{icon}</BS.OverlayTrigger> else icon
Fix so tooltip property is actually displayed
Fix so tooltip property is actually displayed
CoffeeScript
agpl-3.0
openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js
7e94024adbdb5d5dfa3507144ce76003006db971
keymaps.cson
keymaps.cson
'atom-text-editor': 'ctrl-y': 'editor:delete-line'
'atom-text-editor': 'ctrl-y': 'editor:delete-line' 'alt-j': 'find-and-replace:select-next' 'alt-shift-J': 'find-and-replace:select-all'
Add some shortcuts to atom
Add some shortcuts to atom
CoffeeScript
mit
felipeguilhermefs/dotfiles
9e9feb8d69ce15b5cfb0449c56758efaa183b0fe
lib/general-panel.coffee
lib/general-panel.coffee
{View} = require 'atom-space-pen-views' SettingsPanel = require './settings-panel' module.exports = class GeneralPanel extends View @content: -> @div => @form class: 'general-panel section', => @div outlet: "loadingElement", class: 'alert alert-info loading-area icon icon-hourglass', "Loading settings" initialize: -> @loadingElement.remove() @subPanels = [ new SettingsPanel('core', note: ''' <div class="alert alert-info" id="core-settings-note">These are Atom's core settings which affect behavior unrelated to text editing. Individual packages might have additional config settings of their own. Check individual package settings by clicking its package card in the <a class="packages-open">Packages list</a>.</div> ''') new SettingsPanel('editor', note: ''' <div class="alert alert-info" id="editor-settings-note">These config settings are related to text editing. Some of these settings can be overriden on a per-language basis. Check language settings by clicking the language's package card in the <a class="packages-open">Packages list</a>.</div> ''') ] for subPanel in @subPanels @append(subPanel) @on 'click', '.packages-open', -> atom.workspace.open('atom://config/packages') return dispose: -> for subPanel in @subPanels subPanel.dispose() return
{View} = require 'atom-space-pen-views' SettingsPanel = require './settings-panel' module.exports = class GeneralPanel extends View @content: -> @div => @form class: 'general-panel section', => @div outlet: "loadingElement", class: 'alert alert-info loading-area icon icon-hourglass', "Loading settings" initialize: -> @loadingElement.remove() @subPanels = [ new SettingsPanel('core', note: ''' <div class="text icon icon-question" id="core-settings-note" tabindex="-1">These are Atom's core settings which affect behavior unrelated to text editing. Individual packages might have additional config settings of their own. Check individual package settings by clicking its package card in the <a class="link packages-open">Packages list</a>.</div> ''') new SettingsPanel('editor', note: ''' <div class="text icon icon-question" id="editor-settings-note" tabindex="-1">These config settings are related to text editing. Some of these settings can be overriden on a per-language basis. Check language settings by clicking the language's package card in the <a class="link packages-open">Packages list</a>.</div> ''') ] for subPanel in @subPanels @append(subPanel) @on 'click', '.packages-open', -> atom.workspace.open('atom://config/packages') return dispose: -> for subPanel in @subPanels subPanel.dispose() return
Use text note instead of alert
Use text note instead of alert
CoffeeScript
mit
atom/settings-view
6e034c6319bcfe68bddc8a98d9b0fb6e30bb452e
src/panel-element.coffee
src/panel-element.coffee
{CompositeDisposable} = require 'event-kit' class PanelElement extends HTMLElement createdCallback: -> @subscriptions = new CompositeDisposable getModel: -> @model setModel: (@model) -> @appendChild(@model.getItemView()) @subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this)) @subscriptions.add @model.onDidDestroy(@destroyed.bind(this)) attachedCallback: -> @visibleChanged(@model.isVisible()) visibleChanged: (visible) -> if visible @style.display = null else @style.display = 'none' destroyed: -> @subscriptions.dispose() @parentNode?.removeChild(this) module.exports = PanelElement = document.registerElement 'atom-panel', prototype: PanelElement.prototype
{CompositeDisposable} = require 'event-kit' {callAttachHooks} = require './space-pen-extensions' class PanelElement extends HTMLElement createdCallback: -> @subscriptions = new CompositeDisposable getModel: -> @model setModel: (@model) -> view = @model.getItemView() @appendChild(view) callAttachHooks(view) # for backward compatibility with SpacePen views @subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this)) @subscriptions.add @model.onDidDestroy(@destroyed.bind(this)) attachedCallback: -> @visibleChanged(@model.isVisible()) visibleChanged: (visible) -> if visible @style.display = null else @style.display = 'none' destroyed: -> @subscriptions.dispose() @parentNode?.removeChild(this) module.exports = PanelElement = document.registerElement 'atom-panel', prototype: PanelElement.prototype
Call the attach hooks after adding a view to a panel.
Call the attach hooks after adding a view to a panel.
CoffeeScript
mit
Shekharrajak/atom,elkingtonmcb/atom,0x73/atom,fedorov/atom,AlbertoBarrago/atom,tisu2tisu/atom,abcP9110/atom,elkingtonmcb/atom,mrodalgaard/atom,anuwat121/atom,SlimeQ/atom,bencolon/atom,mostafaeweda/atom,bryonwinger/atom,hagb4rd/atom,liuderchi/atom,001szymon/atom,Mokolea/atom,jacekkopecky/atom,AdrianVovk/substance-ide,pombredanne/atom,splodingsocks/atom,jeremyramin/atom,001szymon/atom,AlexxNica/atom,gabrielPeart/atom,G-Baby/atom,githubteacher/atom,bj7/atom,ralphtheninja/atom,targeter21/atom,pengshp/atom,n-riesco/atom,amine7536/atom,GHackAnonymous/atom,MjAbuz/atom,Neron-X5/atom,paulcbetts/atom,daxlab/atom,tanin47/atom,jeremyramin/atom,folpindo/atom,mostafaeweda/atom,Galactix/atom,beni55/atom,Neron-X5/atom,yangchenghu/atom,bryonwinger/atom,mdumrauf/atom,ralphtheninja/atom,Jandersolutions/atom,gontadu/atom,MjAbuz/atom,nvoron23/atom,brettle/atom,palita01/atom,YunchengLiao/atom,deepfox/atom,palita01/atom,florianb/atom,dsandstrom/atom,ilovezy/atom,constanzaurzua/atom,efatsi/atom,liuxiong332/atom,mrodalgaard/atom,MjAbuz/atom,efatsi/atom,Abdillah/atom,Ingramz/atom,bsmr-x-script/atom,ali/atom,0x73/atom,ali/atom,stinsonga/atom,pombredanne/atom,dijs/atom,kaicataldo/atom,johnhaley81/atom,deoxilix/atom,FoldingText/atom,yalexx/atom,gisenberg/atom,ykeisuke/atom,beni55/atom,Austen-G/BlockBuilder,CraZySacX/atom,lovesnow/atom,hharchani/atom,vcarrera/atom,kjav/atom,daxlab/atom,me-benni/atom,mertkahyaoglu/atom,hakatashi/atom,avdg/atom,phord/atom,KENJU/atom,rmartin/atom,devoncarew/atom,tjkr/atom,ppamorim/atom,ironbox360/atom,davideg/atom,dkfiresky/atom,hellendag/atom,toqz/atom,decaffeinate-examples/atom,toqz/atom,bj7/atom,tony612/atom,jordanbtucker/atom,Abdillah/atom,jtrose2/atom,hharchani/atom,h0dgep0dge/atom,mnquintana/atom,matthewclendening/atom,batjko/atom,russlescai/atom,sekcheong/atom,synaptek/atom,RuiDGoncalves/atom,Austen-G/BlockBuilder,Locke23rus/atom,g2p/atom,atom/atom,liuxiong332/atom,boomwaiza/atom,me-benni/atom,Klozz/atom,matthewclendening/atom,hharchani/atom,Hasimir/atom,isghe/atom,burodepeper/atom,jlord/atom,oggy/atom,scippio/atom,tony612/atom,nvoron23/atom,charleswhchan/atom,gisenberg/atom,fredericksilva/atom,ashneo76/atom,tony612/atom,decaffeinate-examples/atom,dsandstrom/atom,vinodpanicker/atom,omarhuanca/atom,dannyflax/atom,kjav/atom,vjeux/atom,Shekharrajak/atom,sekcheong/atom,jeremyramin/atom,daxlab/atom,deepfox/atom,nrodriguez13/atom,vjeux/atom,jordanbtucker/atom,kaicataldo/atom,Arcanemagus/atom,n-riesco/atom,mertkahyaoglu/atom,gontadu/atom,chengky/atom,ezeoleaf/atom,scv119/atom,folpindo/atom,russlescai/atom,abcP9110/atom,Jandersolutions/atom,woss/atom,dannyflax/atom,Mokolea/atom,gisenberg/atom,toqz/atom,jordanbtucker/atom,cyzn/atom,tanin47/atom,fang-yufeng/atom,pkdevbox/atom,brumm/atom,svanharmelen/atom,Galactix/atom,basarat/atom,synaptek/atom,svanharmelen/atom,originye/atom,rsvip/aTom,omarhuanca/atom,oggy/atom,Galactix/atom,mdumrauf/atom,Dennis1978/atom,AlisaKiatkongkumthon/atom,jjz/atom,NunoEdgarGub1/atom,ilovezy/atom,yangchenghu/atom,kittens/atom,Klozz/atom,ezeoleaf/atom,deoxilix/atom,johnrizzo1/atom,rxkit/atom,Jandersoft/atom,synaptek/atom,PKRoma/atom,Ju2ender/atom,ppamorim/atom,Jandersoft/atom,Arcanemagus/atom,GHackAnonymous/atom,atom/atom,wiggzz/atom,rlugojr/atom,Klozz/atom,gisenberg/atom,constanzaurzua/atom,kdheepak89/atom,Jdesk/atom,nrodriguez13/atom,Rychard/atom,transcranial/atom,basarat/atom,fang-yufeng/atom,devmario/atom,qskycolor/atom,vinodpanicker/atom,kittens/atom,xream/atom,sebmck/atom,beni55/atom,bsmr-x-script/atom,ykeisuke/atom,Dennis1978/atom,dannyflax/atom,bryonwinger/atom,yangchenghu/atom,scv119/atom,dannyflax/atom,devmario/atom,jacekkopecky/atom,medovob/atom,MjAbuz/atom,rsvip/aTom,devmario/atom,sebmck/atom,acontreras89/atom,brumm/atom,transcranial/atom,AlexxNica/atom,SlimeQ/atom,folpindo/atom,rsvip/aTom,panuchart/atom,Locke23rus/atom,sekcheong/atom,mdumrauf/atom,kevinrenaers/atom,yomybaby/atom,RobinTec/atom,fscherwi/atom,Jonekee/atom,Rodjana/atom,pkdevbox/atom,vhutheesing/atom,hpham04/atom,ppamorim/atom,constanzaurzua/atom,hakatashi/atom,basarat/atom,gzzhanghao/atom,acontreras89/atom,lovesnow/atom,vhutheesing/atom,bcoe/atom,jjz/atom,Jdesk/atom,Ju2ender/atom,RobinTec/atom,codex8/atom,liuderchi/atom,NunoEdgarGub1/atom,lisonma/atom,gzzhanghao/atom,Ju2ender/atom,fredericksilva/atom,bencolon/atom,mostafaeweda/atom,kjav/atom,sekcheong/atom,anuwat121/atom,nvoron23/atom,n-riesco/atom,bcoe/atom,omarhuanca/atom,acontreras89/atom,russlescai/atom,bryonwinger/atom,prembasumatary/atom,matthewclendening/atom,rmartin/atom,AlisaKiatkongkumthon/atom,hellendag/atom,ardeshirj/atom,AlisaKiatkongkumthon/atom,Jandersoft/atom,yalexx/atom,mostafaeweda/atom,abcP9110/atom,fang-yufeng/atom,john-kelly/atom,crazyquark/atom,dsandstrom/atom,sillvan/atom,bcoe/atom,PKRoma/atom,bcoe/atom,panuchart/atom,mnquintana/atom,sebmck/atom,Abdillah/atom,scippio/atom,g2p/atom,cyzn/atom,deepfox/atom,kjav/atom,BogusCurry/atom,lisonma/atom,phord/atom,Andrey-Pavlov/atom,dijs/atom,liuderchi/atom,Rodjana/atom,sotayamashita/atom,Shekharrajak/atom,sekcheong/atom,jtrose2/atom,johnrizzo1/atom,charleswhchan/atom,seedtigo/atom,YunchengLiao/atom,ReddTea/atom,jjz/atom,hagb4rd/atom,hagb4rd/atom,kevinrenaers/atom,hagb4rd/atom,isghe/atom,jlord/atom,pengshp/atom,transcranial/atom,jlord/atom,toqz/atom,chfritz/atom,decaffeinate-examples/atom,sotayamashita/atom,kdheepak89/atom,me-benni/atom,FoldingText/atom,vcarrera/atom,CraZySacX/atom,pombredanne/atom,harshdattani/atom,rjattrill/atom,pombredanne/atom,t9md/atom,qiujuer/atom,DiogoXRP/atom,Sangaroonaom/atom,YunchengLiao/atom,liuxiong332/atom,kandros/atom,targeter21/atom,stuartquin/atom,brettle/atom,kittens/atom,constanzaurzua/atom,dkfiresky/atom,burodepeper/atom,sotayamashita/atom,champagnez/atom,stuartquin/atom,devoncarew/atom,tisu2tisu/atom,Huaraz2/atom,ReddTea/atom,originye/atom,oggy/atom,prembasumatary/atom,chengky/atom,mostafaeweda/atom,acontreras89/atom,alfredxing/atom,yomybaby/atom,lovesnow/atom,rookie125/atom,DiogoXRP/atom,mnquintana/atom,Austen-G/BlockBuilder,Jonekee/atom,rsvip/aTom,targeter21/atom,phord/atom,ykeisuke/atom,jlord/atom,charleswhchan/atom,tjkr/atom,abcP9110/atom,Andrey-Pavlov/atom,bj7/atom,hagb4rd/atom,pengshp/atom,seedtigo/atom,deoxilix/atom,kdheepak89/atom,splodingsocks/atom,qskycolor/atom,githubteacher/atom,woss/atom,stinsonga/atom,charleswhchan/atom,yalexx/atom,jacekkopecky/atom,splodingsocks/atom,xream/atom,tony612/atom,scippio/atom,kandros/atom,GHackAnonymous/atom,ivoadf/atom,isghe/atom,fredericksilva/atom,bcoe/atom,abcP9110/atom,Rychard/atom,basarat/atom,Jandersolutions/atom,sillvan/atom,ironbox360/atom,Abdillah/atom,rsvip/aTom,elkingtonmcb/atom,liuxiong332/atom,harshdattani/atom,nucked/atom,tmunro/atom,paulcbetts/atom,kevinrenaers/atom,ardeshirj/atom,ppamorim/atom,splodingsocks/atom,davideg/atom,davideg/atom,sxgao3001/atom,helber/atom,me6iaton/atom,seedtigo/atom,einarmagnus/atom,Austen-G/BlockBuilder,Rychard/atom,brettle/atom,bsmr-x-script/atom,Galactix/atom,qiujuer/atom,medovob/atom,Ju2ender/atom,hharchani/atom,niklabh/atom,pkdevbox/atom,ObviouslyGreen/atom,ilovezy/atom,sxgao3001/atom,kc8wxm/atom,RobinTec/atom,davideg/atom,rlugojr/atom,pombredanne/atom,yalexx/atom,Neron-X5/atom,dannyflax/atom,Ingramz/atom,sxgao3001/atom,fscherwi/atom,alfredxing/atom,brumm/atom,lisonma/atom,FIT-CSE2410-A-Bombs/atom,devoncarew/atom,fang-yufeng/atom,wiggzz/atom,codex8/atom,hharchani/atom,russlescai/atom,Jdesk/atom,xream/atom,palita01/atom,svanharmelen/atom,Jandersoft/atom,lpommers/atom,me6iaton/atom,ilovezy/atom,tisu2tisu/atom,stinsonga/atom,rjattrill/atom,qskycolor/atom,jtrose2/atom,paulcbetts/atom,Austen-G/BlockBuilder,ReddTea/atom,johnrizzo1/atom,hpham04/atom,darwin/atom,yamhon/atom,Jandersolutions/atom,omarhuanca/atom,ashneo76/atom,vhutheesing/atom,gabrielPeart/atom,qskycolor/atom,h0dgep0dge/atom,omarhuanca/atom,champagnez/atom,jacekkopecky/atom,synaptek/atom,GHackAnonymous/atom,0x73/atom,codex8/atom,andrewleverette/atom,stinsonga/atom,amine7536/atom,kc8wxm/atom,alexandergmann/atom,vinodpanicker/atom,vjeux/atom,YunchengLiao/atom,john-kelly/atom,vcarrera/atom,lpommers/atom,dkfiresky/atom,basarat/atom,woss/atom,einarmagnus/atom,burodepeper/atom,niklabh/atom,YunchengLiao/atom,ali/atom,darwin/atom,BogusCurry/atom,kc8wxm/atom,prembasumatary/atom,Shekharrajak/atom,KENJU/atom,mertkahyaoglu/atom,RuiDGoncalves/atom,G-Baby/atom,yomybaby/atom,amine7536/atom,liuderchi/atom,yamhon/atom,ezeoleaf/atom,dkfiresky/atom,Ju2ender/atom,isghe/atom,fedorov/atom,devoncarew/atom,Rodjana/atom,russlescai/atom,Andrey-Pavlov/atom,kc8wxm/atom,jjz/atom,alexandergmann/atom,ivoadf/atom,woss/atom,AdrianVovk/substance-ide,devoncarew/atom,lisonma/atom,batjko/atom,sillvan/atom,Andrey-Pavlov/atom,einarmagnus/atom,kittens/atom,kaicataldo/atom,rjattrill/atom,batjko/atom,oggy/atom,sebmck/atom,darwin/atom,davideg/atom,batjko/atom,jlord/atom,toqz/atom,FoldingText/atom,kc8wxm/atom,nrodriguez13/atom,GHackAnonymous/atom,Abdillah/atom,kittens/atom,ezeoleaf/atom,githubteacher/atom,jjz/atom,ali/atom,sillvan/atom,ardeshirj/atom,n-riesco/atom,Neron-X5/atom,nucked/atom,harshdattani/atom,SlimeQ/atom,amine7536/atom,DiogoXRP/atom,hakatashi/atom,chengky/atom,FIT-CSE2410-A-Bombs/atom,yomybaby/atom,devmario/atom,FoldingText/atom,chengky/atom,oggy/atom,dijs/atom,me6iaton/atom,prembasumatary/atom,john-kelly/atom,alfredxing/atom,FoldingText/atom,RobinTec/atom,bolinfest/atom,gisenberg/atom,jtrose2/atom,vinodpanicker/atom,andrewleverette/atom,charleswhchan/atom,amine7536/atom,Jdesk/atom,CraZySacX/atom,john-kelly/atom,paulcbetts/atom,t9md/atom,rookie125/atom,AlbertoBarrago/atom,sxgao3001/atom,yalexx/atom,hpham04/atom,nvoron23/atom,NunoEdgarGub1/atom,woss/atom,n-riesco/atom,BogusCurry/atom,medovob/atom,bolinfest/atom,KENJU/atom,crazyquark/atom,Mokolea/atom,kjav/atom,Hasimir/atom,Galactix/atom,jacekkopecky/atom,ivoadf/atom,fredericksilva/atom,Austen-G/BlockBuilder,isghe/atom,scv119/atom,mertkahyaoglu/atom,batjko/atom,ObviouslyGreen/atom,deepfox/atom,einarmagnus/atom,florianb/atom,florianb/atom,alexandergmann/atom,lisonma/atom,hpham04/atom,anuwat121/atom,mnquintana/atom,qiujuer/atom,johnhaley81/atom,0x73/atom,tanin47/atom,Jandersoft/atom,ironbox360/atom,t9md/atom,fedorov/atom,Neron-X5/atom,tony612/atom,RuiDGoncalves/atom,decaffeinate-examples/atom,tmunro/atom,tmunro/atom,lovesnow/atom,SlimeQ/atom,scv119/atom,Andrey-Pavlov/atom,ilovezy/atom,cyzn/atom,dsandstrom/atom,rlugojr/atom,bolinfest/atom,Hasimir/atom,dannyflax/atom,lpommers/atom,kdheepak89/atom,Jdesk/atom,wiggzz/atom,originye/atom,MjAbuz/atom,001szymon/atom,synaptek/atom,constanzaurzua/atom,Jonekee/atom,niklabh/atom,dkfiresky/atom,yamhon/atom,florianb/atom,fedorov/atom,champagnez/atom,Hasimir/atom,prembasumatary/atom,vcarrera/atom,h0dgep0dge/atom,NunoEdgarGub1/atom,chengky/atom,PKRoma/atom,Dennis1978/atom,codex8/atom,targeter21/atom,devmario/atom,gontadu/atom,FoldingText/atom,qskycolor/atom,helber/atom,rxkit/atom,kdheepak89/atom,Shekharrajak/atom,Arcanemagus/atom,ralphtheninja/atom,vjeux/atom,rxkit/atom,nvoron23/atom,helber/atom,boomwaiza/atom,boomwaiza/atom,RobinTec/atom,bencolon/atom,Sangaroonaom/atom,yomybaby/atom,fang-yufeng/atom,johnhaley81/atom,dsandstrom/atom,FIT-CSE2410-A-Bombs/atom,rmartin/atom,jacekkopecky/atom,matthewclendening/atom,atom/atom,hakatashi/atom,mrodalgaard/atom,ppamorim/atom,jtrose2/atom,sebmck/atom,AlexxNica/atom,chfritz/atom,me6iaton/atom,sillvan/atom,targeter21/atom,avdg/atom,john-kelly/atom,SlimeQ/atom,hpham04/atom,h0dgep0dge/atom,efatsi/atom,NunoEdgarGub1/atom,chfritz/atom,AlbertoBarrago/atom,vcarrera/atom,hellendag/atom,fredericksilva/atom,kandros/atom,basarat/atom,me6iaton/atom,matthewclendening/atom,codex8/atom,vjeux/atom,tjkr/atom,fedorov/atom,mertkahyaoglu/atom,crazyquark/atom,ali/atom,gzzhanghao/atom,Ingramz/atom,andrewleverette/atom,crazyquark/atom,ReddTea/atom,vinodpanicker/atom,ObviouslyGreen/atom,avdg/atom,fscherwi/atom,g2p/atom,gabrielPeart/atom,sxgao3001/atom,KENJU/atom,rookie125/atom,qiujuer/atom,lovesnow/atom,Jandersolutions/atom,Sangaroonaom/atom,stuartquin/atom,acontreras89/atom,G-Baby/atom,nucked/atom,mnquintana/atom,AdrianVovk/substance-ide,deepfox/atom,Huaraz2/atom,Huaraz2/atom,florianb/atom,Locke23rus/atom,rmartin/atom,rjattrill/atom,Hasimir/atom,qiujuer/atom,liuxiong332/atom,einarmagnus/atom,ashneo76/atom,rmartin/atom,crazyquark/atom,panuchart/atom,KENJU/atom,ReddTea/atom
d0eadf3fd9bf9d2d7af63796a44946cbd52c5f84
test/parser.coffee
test/parser.coffee
expect = require('chai').expect parser = require '../dist/parser' describe 'TagDataParser', -> describe '#parse()', -> it 'returns a tag data object', -> expect(parser.parse('ruby:2.1.2 rails:3.x,4.x')).to.deep.equal([ { name: 'ruby' versions: ['2.1.2'] } { name: 'rails' versions: ['3.x', '4.x'] } ]) it 'accepts version with spaces', -> expect(parser.parse('tag:version,\\ with\\ space')).to.deep.equal([ { name: 'tag' versions: ['version', ' with space'] } ]) it 'accepts version with backslashes', -> expect(parser.parse('tag:back\\\\slash')).to.deep.equal([ { name: 'tag' versions: ['back\\slash'] } ])
expect = require('chai').expect parser = require '../dist/parser' describe 'TagDataParser', -> describe '#parse()', -> it 'returns a tag data object', -> expect(parser.parse('ruby:2.1.2 rails:3.x,4.x')).to.deep.equal([ { name: 'ruby' versions: ['2.1.2'] } { name: 'rails' versions: ['3.x', '4.x'] } ]) it 'accepts multi bytes tag name and versions', -> expect(parser.parse('タグ1 タグ2:バージョン1,バージョン2')).to.deep.equal([ { name: 'タグ1' versions: [] } { name: 'タグ2' versions: ['バージョン1', 'バージョン2'] } ]) it 'accepts version with spaces', -> expect(parser.parse('tag:version,\\ with\\ space')).to.deep.equal([ { name: 'tag' versions: ['version', ' with space'] } ]) it 'accepts version with backslashes', -> expect(parser.parse('tag:back\\\\slash')).to.deep.equal([ { name: 'tag' versions: ['back\\slash'] } ])
Add test case for multi bytes chars
Add test case for multi bytes chars
CoffeeScript
mit
increments/tag-data-parser
70bd7a7e321e74e5362a3ce7971d3d8e254887a5
utils.coffee
utils.coffee
fs = Npm.require 'fs' path = Npm.require 'path' sass = Npm.require 'node-sass' share.MailerUtils = joinUrl: (base, path) -> # Remove any trailing slashes base = base.replace(/\/$/, '') # Add front slash if not exist already unless /^\//.test(path) path = '/' + path return base + path addDoctype: (html) -> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n' + html readFile: (relativePathFromApp) -> file = path.join(process.env.PWD, relativePathFromApp) try return fs.readFileSync(file, encoding: 'utf8') catch ex throw new Meteor.Error 500, 'Could not find file: ' + file, ex.message toCSS: (scss) -> file = path.join(process.env.PWD, scss) try return sass.renderSync(file: file, sourceMap: false).css catch ex # ex is somehow a JSON string. e = JSON.parse(ex) console.error 'Sass failed to compile: ' + e.message console.error 'In ' + (e.file or scss)
fs = Npm.require 'fs' path = Npm.require 'path' sass = Npm.require 'node-sass' if process.env.BUNDLE_PATH # BUNDLE_PATH = /var/www/app/bundle ROOT = path.join(process.env.BUNDLE_PATH, 'programs', 'server', 'assets', 'app') else # PWD = /lookback-emailjobs/app ROOT = path.join(process.env.PWD, 'private') share.MailerUtils = joinUrl: (base, path) -> # Remove any trailing slashes base = base.replace(/\/$/, '') # Add front slash if not exist already unless /^\//.test(path) path = '/' + path return base + path addDoctype: (html) -> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n' + html readFile: (relativePathFromApp) -> file = path.join(ROOT, relativePathFromApp) try return fs.readFileSync(file, encoding: 'utf8') catch ex throw new Meteor.Error 500, 'Could not find file: ' + file, ex.message toCSS: (scss) -> file = path.join(ROOT, scss) try return sass.renderSync(file: file, sourceMap: false).css catch ex # ex is somehow a JSON string. e = JSON.parse(ex) console.error 'Sass failed to compile: ' + e.message console.error 'In ' + (e.file or scss)
Add support for reading BUNDLE_PATH env var, for Meteor app bundles
Add support for reading BUNDLE_PATH env var, for Meteor app bundles
CoffeeScript
mit
lookback/meteor-emails,satyavh/meteor-emails,satyavh/meteor-emails,mccormjt/meteor-emails,lookback/meteor-emails,satyavh/meteor-emails,mccormjt/meteor-emails,lookback/meteor-emails,mccormjt/meteor-emails
630652e13fe3459979b1c35268f2f1a3188c5ed5
client/app/MainApp/fs/fsfolder.coffee
client/app/MainApp/fs/fsfolder.coffee
class FSFolder extends FSFile fetchContents:(callback)-> # @emit "fs.fetchContents.started" # @kiteController.run # toDo : "ls" # withArgs : # command : @path # , (err, response)=> # if err # warn err # @emit "fs.fetchContents.finished", err # else # files = FSHelper.parseLsOutput [@path], response # @emit "fs.fetchContents.finished", files # callback? files @emit "fs.fetchContents.started" # a = Date.now() @kiteController.run withArgs : command : "ls #{FSHelper.escapeFilePath @path} -LHlpva --group-directories-first --time-style=full-iso" , (err, response)=> # log "------------------------------------------------------------------" # log "l flag response in: #{Date.now()-a} msec." if err warn err @emit "fs.fetchContents.finished", err else files = FSHelper.parseLsOutput [@path], response @emit "fs.fetchContents.finished", files callback? files # forkRepoCommandMap = -> # git : "git clone" # svn : "svn checkout" # hg : "hg clone" # cloneRepo:(options, callback)-> # @kiteController.run "#{forkRepoCommandMap()[repoType]} #{repo} #{escapeFilePath getAppPath manifest}", (err, response)->
class FSFolder extends FSFile fetchContents:(callback)-> # @emit "fs.fetchContents.started" # @kiteController.run # toDo : "ls" # withArgs : # command : @path # , (err, response)=> # if err # warn err # @emit "fs.fetchContents.finished", err # else # files = FSHelper.parseLsOutput [@path], response # @emit "fs.fetchContents.finished", files # callback? files @emit "fs.fetchContents.started" # a = Date.now() @kiteController.run withArgs : command : "ls #{FSHelper.escapeFilePath @path} -Llpva --group-directories-first --time-style=full-iso" , (err, response)=> # log "------------------------------------------------------------------" # log "l flag response in: #{Date.now()-a} msec." if err warn err @emit "fs.fetchContents.finished", err else files = FSHelper.parseLsOutput [@path], response @emit "fs.fetchContents.finished", files callback? files # forkRepoCommandMap = -> # git : "git clone" # svn : "svn checkout" # hg : "hg clone" # cloneRepo:(options, callback)-> # @kiteController.run "#{forkRepoCommandMap()[repoType]} #{repo} #{escapeFilePath getAppPath manifest}", (err, response)->
Revert "Add -H option to fix broken symbolic links error"
Revert "Add -H option to fix broken symbolic links error" This reverts commit 6b5b68deb6cebff22cbbcef16819ca8c71620bdd.
CoffeeScript
agpl-3.0
cihangir/koding,sinan/koding,drewsetski/koding,cihangir/koding,cihangir/koding,andrewjcasal/koding,szkl/koding,rjeczalik/koding,gokmen/koding,mertaytore/koding,kwagdy/koding-1,andrewjcasal/koding,cihangir/koding,drewsetski/koding,kwagdy/koding-1,jack89129/koding,gokmen/koding,mertaytore/koding,gokmen/koding,sinan/koding,alex-ionochkin/koding,gokmen/koding,mertaytore/koding,drewsetski/koding,mertaytore/koding,usirin/koding,cihangir/koding,andrewjcasal/koding,koding/koding,usirin/koding,mertaytore/koding,jack89129/koding,drewsetski/koding,jack89129/koding,gokmen/koding,acbodine/koding,kwagdy/koding-1,jack89129/koding,koding/koding,koding/koding,rjeczalik/koding,alex-ionochkin/koding,andrewjcasal/koding,usirin/koding,rjeczalik/koding,sinan/koding,sinan/koding,usirin/koding,rjeczalik/koding,koding/koding,cihangir/koding,koding/koding,jack89129/koding,kwagdy/koding-1,koding/koding,usirin/koding,szkl/koding,mertaytore/koding,drewsetski/koding,drewsetski/koding,andrewjcasal/koding,gokmen/koding,usirin/koding,koding/koding,acbodine/koding,usirin/koding,drewsetski/koding,cihangir/koding,szkl/koding,rjeczalik/koding,sinan/koding,szkl/koding,rjeczalik/koding,acbodine/koding,sinan/koding,alex-ionochkin/koding,kwagdy/koding-1,acbodine/koding,sinan/koding,acbodine/koding,andrewjcasal/koding,acbodine/koding,alex-ionochkin/koding,koding/koding,szkl/koding,sinan/koding,kwagdy/koding-1,alex-ionochkin/koding,mertaytore/koding,szkl/koding,acbodine/koding,drewsetski/koding,jack89129/koding,szkl/koding,jack89129/koding,usirin/koding,andrewjcasal/koding,alex-ionochkin/koding,andrewjcasal/koding,rjeczalik/koding,szkl/koding,cihangir/koding,kwagdy/koding-1,gokmen/koding,alex-ionochkin/koding,alex-ionochkin/koding,rjeczalik/koding,gokmen/koding,mertaytore/koding,jack89129/koding,acbodine/koding,kwagdy/koding-1
8c0e5f6cfa3af9394b7fca3a378777b6f0ff0810
app/assets/javascripts/lib/util/flexibility_order.coffee
app/assets/javascripts/lib/util/flexibility_order.coffee
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.api_session_id() success: -> App.call_api() error: (e,f) -> console.log('Throw error') render: => $.ajax url: @url('get') type: 'GET' success: (data) => Sortable.create @element, ghostClass: 'ghost' animation: 150 store: get: (sortable) -> data.order set: (sortable) => @update(sortable.toArray().concat(['curtailment']))
class @FlexibilityOrder constructor: (@element) -> @lastGood = null url: (path) -> "#{ App.scenario.url_path() }/flexibility_order/#{ path }" update: (sortable) => options = sortable.toArray() $.ajax url: @url('set'), type: 'POST', data: flexibility_order: order: options success: => App.call_api() @lastGood = options error: (e,f) => if @lastGood sortable.sort(@lastGood) render: => $.ajax url: @url('get') type: 'GET' success: (data) => Sortable.create @element, ghostClass: 'ghost' animation: 150 store: get: (_sortable) => @lastGood = data.order data.order set: (sortable) => @update(sortable)
Improve error handling in FlexibilityOrder
Improve error handling in FlexibilityOrder Restores the order to the last known good settings when an error is returned by ETEngine. The user is most likely not able to correct the error.
CoffeeScript
mit
quintel/etmodel,quintel/etmodel,quintel/etmodel,quintel/etmodel
e1cff04080a30ffa369b159930ecf381a7261cfd
modules/atom/settings/config.cson
modules/atom/settings/config.cson
"*": "atom-beautify": css: indent_size: 2 general: _analyticsUserId: "8bfc3dc2-e55f-4b45-93b6-8b516d108dab" html: indent_size: 2 js: indent_size: 2 "atom-package-deps": ignored: [] core: disabledPackages: [ "metrics" "welcome" "language-javascript" "markdown-preview" ] telemetryConsent: "no" editor: fontSize: 13 showIndentGuide: true "exception-reporting": userId: "e2c17e7a-6562-482a-b326-cd43e0f43b75" linter: disabledProviders: [ "ESLint" ] "linter-eslint": disableWhenNoEslintConfig: true globalNodePath: "/usr/local" useGlobalEslint: false "linter-ui-default": panelHeight: 69 "markdown-preview": useGitHubStyle: true "spell-check": locales: [ "es-ES" ] tabs: enableVcsColoring: true "tree-view": hideVcsIgnoredFiles: true welcome: showOnStartup: false
"*": "atom-beautify": css: indent_size: 2 general: _analyticsUserId: "8bfc3dc2-e55f-4b45-93b6-8b516d108dab" html: indent_size: 2 js: indent_size: 2 "atom-package-deps": ignored: [] core: disabledPackages: [ "metrics" "welcome" "language-javascript" "markdown-preview" ] telemetryConsent: "no" editor: showIndentGuide: true "exception-reporting": userId: "e2c17e7a-6562-482a-b326-cd43e0f43b75" linter: disabledProviders: [ "ESLint" ] "linter-eslint": disableWhenNoEslintConfig: true globalNodePath: "/usr/local" useGlobalEslint: false "linter-ui-default": panelHeight: 69 "markdown-preview": useGitHubStyle: true "spell-check": locales: [ "es-ES" ] tabs: enableVcsColoring: true "tree-view": hideVcsIgnoredFiles: true welcome: showOnStartup: false
Increase font size in Atom
Increase font size in Atom
CoffeeScript
unlicense
guerrero/dotfiles
0bf9b5ae3b628fc865a48ae7595774cb531b5675
core/app/backbone/contrib/monkey_backbone_history.coffee
core/app/backbone/contrib/monkey_backbone_history.coffee
window.addBackboneHistoryCallbacksForDiscussionModal = -> old_navigate = Backbone.History.prototype.navigate Backbone.History.prototype.navigate = (fragment) -> fragment = @getFragment(fragment || '') # copied from Backbone FactlinkApp.DiscussionModalOnFrontend.setBackgroundPageUrl(fragment) old_navigate.apply this, arguments old_loadUrl = Backbone.History.prototype.loadUrl Backbone.History.prototype.loadUrl = (fragmentOverride) -> fragment = @getFragment(fragmentOverride) # copied from Backbone return if FactlinkApp.DiscussionModalOnFrontend.closeDiscussionAndAlreadyOnBackgroundPage(fragment) FactlinkApp.DiscussionModalOnFrontend.setBackgroundPageUrl(fragment) old_loadUrl.apply this, arguments
window.addBackboneHistoryCallbacksForDiscussionModal = -> old_navigate = Backbone.History.prototype.navigate Backbone.History.prototype.navigate = (fragment) -> fragment = @getFragment(fragment || '') # copied from Backbone FactlinkApp.DiscussionModalOnFrontend.setBackgroundPageUrl(fragment) old_navigate.apply this, arguments old_loadUrl = Backbone.History.prototype.loadUrl Backbone.History.prototype.loadUrl = (fragmentOverride) -> fragment = @getFragment(fragmentOverride) # copied from Backbone if FactlinkApp.DiscussionModalOnFrontend.closeDiscussionAndAlreadyOnBackgroundPage(fragment) @fragment = fragment return true FactlinkApp.DiscussionModalOnFrontend.setBackgroundPageUrl(fragment) old_loadUrl.apply this, arguments
Return true when aborting, since we are pretending that we loaded a route.
Return true when aborting, since we are pretending that we loaded a route. Set the fragment, because earlier that was being set by a behaviour in checkUrl that wasn't intended
CoffeeScript
mit
Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core
42a668bd0332ab54f20f35ed13d7aea113849699
apps/authentication/routes.coffee
apps/authentication/routes.coffee
Organization = require '../../models/organization' crypto = require 'crypto' hexDigest = (string)-> sha = crypto.createHash('sha256'); sha.update('awesome') sha.digest('hex') routes = (app) -> app.get '/login', (req, res) -> res.render "#{__dirname}/views/login", title: 'Login', stylesheet: 'login' app.post '/sessions', (req, res, next) -> errMsg = "Org Name or Password is invalid. Try again" if req.body.name and req.body.password Organization.findOne name: req.body.name, (err, org) -> if org and org.hashed_password == hexDigest(req.body.password) req.session.org_id = org.id req.flash 'info', "You are logged in as #{req.session.currentOrg}" res.redirect '/dashboard' else req.flash 'error', errMsg res.redirect '/login' else req.flash 'error', errMsg res.redirect '/login' app.del '/sessions', (req, res) -> req.session.regenerate (err) -> req.flash 'info', 'You have been logged out.' res.redirect '/login' module.exports = routes
Organization = require '../../models/organization' crypto = require 'crypto' hexDigest = (string)-> sha = crypto.createHash('sha256'); sha.update('awesome') sha.digest('hex') routes = (app) -> app.get '/login', (req, res) -> res.render "#{__dirname}/views/login", title: 'Login', stylesheet: 'login' app.post '/sessions', (req, res, next) -> errMsg = "Org Name or Password is invalid. Try again" if req.body.name and req.body.password Organization.findOne name: req.body.name, (err, org) -> if org and org.hashed_password == hexDigest(req.body.password) req.session.org_id = org.id req.flash 'info', "You are logged in as #{org.name}" res.redirect '/dashboard' else req.flash 'error', errMsg res.redirect '/login' else req.flash 'error', errMsg res.redirect '/login' app.del '/sessions', (req, res) -> req.session.regenerate (err) -> req.flash 'info', 'You have been logged out.' res.redirect '/login' module.exports = routes
Fix the flash when logging in
Fix the flash when logging in
CoffeeScript
mit
EverFi/Sash,EverFi/Sash,EverFi/Sash
d2b67e5e1916955ef811619d86626bc8ada5f96e
gulpfile.coffee
gulpfile.coffee
gulp = require 'gulp' babel = require 'gulp-babel' uglify = require 'gulp-uglify' gulp.task 'build', (done)-> gulp.src 'src/dfa.js' .pipe babel({presets:['env']}) .pipe uglify() .pipe gulp.dest('.')
gulp = require 'gulp' babel = require 'gulp-babel' uglify = require 'gulp-uglify' gulp.task 'build', (done)-> gulp.src 'src/dfa.js' .pipe babel({presets:['env']}) .pipe uglify({ keep_fnames: true }) .pipe gulp.dest('.')
Set uglify option 'keep_fname' true
Set uglify option 'keep_fname' true
CoffeeScript
mit
fxfan/dfa.js
eed1fda9cc8f95e5355b3af8ca12d45eaca2df3f
packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.coffee
packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.coffee
if Meteor.isServer url = Npm.require('url') RocketChat.settings.get 'Site_Url', (key, value) -> if value?.trim() isnt '' __meteor_runtime_config__.ROOT_URL = value __meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL = value if Meteor.absoluteUrl.defaultOptions?.rootUrl? Meteor.absoluteUrl.defaultOptions.rootUrl = value if Meteor.isServer RocketChat.hostname = url.parse(value).hostname process.env.MOBILE_ROOT_URL = value process.env.MOBILE_DDP_URL = value if WebAppInternals?.generateBoilerplate WebAppInternals.generateBoilerplate()
if Meteor.isServer url = Npm.require('url') RocketChat.settings.get 'Site_Url', (key, value) -> if value?.trim() isnt '' __meteor_runtime_config__.ROOT_URL = value if Meteor.absoluteUrl.defaultOptions?.rootUrl? Meteor.absoluteUrl.defaultOptions.rootUrl = value if Meteor.isServer RocketChat.hostname = url.parse(value).hostname process.env.MOBILE_ROOT_URL = value process.env.MOBILE_DDP_URL = value if WebAppInternals?.generateBoilerplate WebAppInternals.generateBoilerplate()
Fix problem with ddp connection from some urls
Fix problem with ddp connection from some urls
CoffeeScript
mit
pitamar/Rocket.Chat,yuyixg/Rocket.Chat,nishimaki10/Rocket.Chat,inoxth/Rocket.Chat,tntobias/Rocket.Chat,AlecTroemel/Rocket.Chat,inoxth/Rocket.Chat,k0nsl/Rocket.Chat,capensisma/Rocket.Chat,haoyixin/Rocket.Chat,xboston/Rocket.Chat,snaiperskaya96/Rocket.Chat,mrinaldhar/Rocket.Chat,Deepakkothandan/Rocket.Chat,ziedmahdi/Rocket.Chat,LearnersGuild/Rocket.Chat,karlprieb/Rocket.Chat,BorntraegerMarc/Rocket.Chat,fatihwk/Rocket.Chat,yuyixg/Rocket.Chat,intelradoux/Rocket.Chat,danielbressan/Rocket.Chat,Gudii/Rocket.Chat,4thParty/Rocket.Chat,igorstajic/Rocket.Chat,nishimaki10/Rocket.Chat,OtkurBiz/Rocket.Chat,Deepakkothandan/Rocket.Chat,Gudii/Rocket.Chat,nishimaki10/Rocket.Chat,AlecTroemel/Rocket.Chat,nishimaki10/Rocket.Chat,Gyubin/Rocket.Chat,mccambridge/Rocket.Chat,AlecTroemel/Rocket.Chat,klatys/Rocket.Chat,Dianoga/Rocket.Chat,ealbers/Rocket.Chat,flaviogrossi/Rocket.Chat,JamesHGreen/Rocket_API,Achaikos/Rocket.Chat,intelradoux/Rocket.Chat,yuyixg/Rocket.Chat,LearnersGuild/echo-chat,4thParty/Rocket.Chat,JamesHGreen/Rocket_API,NMandapaty/Rocket.Chat,liuliming2008/Rocket.Chat,xasx/Rocket.Chat,acaronmd/Rocket.Chat,jbsavoy18/rocketchat-1,ziedmahdi/Rocket.Chat,igorstajic/Rocket.Chat,org100h1/Rocket.Panda,abduljanjua/TheHub,cnash/Rocket.Chat,snaiperskaya96/Rocket.Chat,wtsarchive/Rocket.Chat,Dianoga/Rocket.Chat,mwharrison/Rocket.Chat,karlprieb/Rocket.Chat,ahmadassaf/Rocket.Chat,ahmadassaf/Rocket.Chat,marzieh312/Rocket.Chat,haoyixin/Rocket.Chat,marzieh312/Rocket.Chat,pitamar/Rocket.Chat,jbsavoy18/rocketchat-1,intelradoux/Rocket.Chat,mrsimpson/Rocket.Chat,org100h1/Rocket.Panda,JamesHGreen/Rocket_API,VoiSmart/Rocket.Chat,wicked539/Rocket.Chat,snaiperskaya96/Rocket.Chat,mwharrison/Rocket.Chat,pkgodara/Rocket.Chat,matthewshirley/Rocket.Chat,NMandapaty/Rocket.Chat,AimenJoe/Rocket.Chat,cnash/Rocket.Chat,mrsimpson/Rocket.Chat,marzieh312/Rocket.Chat,pkgodara/Rocket.Chat,VoiSmart/Rocket.Chat,jbsavoy18/rocketchat-1,xasx/Rocket.Chat,abduljanjua/TheHub,klatys/Rocket.Chat,timkinnane/Rocket.Chat,k0nsl/Rocket.Chat,fduraibi/Rocket.Chat,JamesHGreen/Rocket.Chat,linnovate/hi,acaronmd/Rocket.Chat,mrinaldhar/Rocket.Chat,alexbrazier/Rocket.Chat,acaronmd/Rocket.Chat,tntobias/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,steedos/chat,jbsavoy18/rocketchat-1,inoio/Rocket.Chat,LearnersGuild/Rocket.Chat,mccambridge/Rocket.Chat,Flitterkill/Rocket.Chat,ealbers/Rocket.Chat,JamesHGreen/Rocket.Chat,ealbers/Rocket.Chat,wtsarchive/Rocket.Chat,ggazzo/Rocket.Chat,haoyixin/Rocket.Chat,Kiran-Rao/Rocket.Chat,Deepakkothandan/Rocket.Chat,ealbers/Rocket.Chat,intelradoux/Rocket.Chat,timkinnane/Rocket.Chat,fatihwk/Rocket.Chat,capensisma/Rocket.Chat,org100h1/Rocket.Panda,Gyubin/Rocket.Chat,galrotem1993/Rocket.Chat,Flitterkill/Rocket.Chat,mwharrison/Rocket.Chat,pkgodara/Rocket.Chat,pachox/Rocket.Chat,capensisma/Rocket.Chat,subesokun/Rocket.Chat,Movile/Rocket.Chat,danielbressan/Rocket.Chat,Sing-Li/Rocket.Chat,wtsarchive/Rocket.Chat,LearnersGuild/echo-chat,Gyubin/Rocket.Chat,Movile/Rocket.Chat,matthewshirley/Rocket.Chat,cnash/Rocket.Chat,pitamar/Rocket.Chat,marzieh312/Rocket.Chat,Flitterkill/Rocket.Chat,tntobias/Rocket.Chat,liuliming2008/Rocket.Chat,abduljanjua/TheHub,Gyubin/Rocket.Chat,wtsarchive/Rocket.Chat,Gudii/Rocket.Chat,liuliming2008/Rocket.Chat,acaronmd/Rocket.Chat,flaviogrossi/Rocket.Chat,PavelVanecek/Rocket.Chat,org100h1/Rocket.Panda,Kiran-Rao/Rocket.Chat,xboston/Rocket.Chat,LearnersGuild/echo-chat,Dianoga/Rocket.Chat,BorntraegerMarc/Rocket.Chat,yuyixg/Rocket.Chat,haoyixin/Rocket.Chat,igorstajic/Rocket.Chat,inoio/Rocket.Chat,Sing-Li/Rocket.Chat,bt/Rocket.Chat,mwharrison/Rocket.Chat,wicked539/Rocket.Chat,AimenJoe/Rocket.Chat,inoio/Rocket.Chat,fduraibi/Rocket.Chat,OtkurBiz/Rocket.Chat,igorstajic/Rocket.Chat,bt/Rocket.Chat,mrsimpson/Rocket.Chat,AimenJoe/Rocket.Chat,galrotem1993/Rocket.Chat,karlprieb/Rocket.Chat,alexbrazier/Rocket.Chat,mrsimpson/Rocket.Chat,steedos/chat,VoiSmart/Rocket.Chat,OtkurBiz/Rocket.Chat,steedos/chat,Sing-Li/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,PavelVanecek/Rocket.Chat,BorntraegerMarc/Rocket.Chat,Achaikos/Rocket.Chat,Movile/Rocket.Chat,wicked539/Rocket.Chat,mrinaldhar/Rocket.Chat,galrotem1993/Rocket.Chat,danielbressan/Rocket.Chat,NMandapaty/Rocket.Chat,alexbrazier/Rocket.Chat,inoxth/Rocket.Chat,Movile/Rocket.Chat,bt/Rocket.Chat,timkinnane/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,ahmadassaf/Rocket.Chat,subesokun/Rocket.Chat,Achaikos/Rocket.Chat,Kiran-Rao/Rocket.Chat,klatys/Rocket.Chat,danielbressan/Rocket.Chat,abhishekshukla0302/trico,mccambridge/Rocket.Chat,wicked539/Rocket.Chat,OtkurBiz/Rocket.Chat,karlprieb/Rocket.Chat,ggazzo/Rocket.Chat,klatys/Rocket.Chat,abhishekshukla0302/trico,LearnersGuild/Rocket.Chat,PavelVanecek/Rocket.Chat,AlecTroemel/Rocket.Chat,cnash/Rocket.Chat,liuliming2008/Rocket.Chat,subesokun/Rocket.Chat,pachox/Rocket.Chat,xasx/Rocket.Chat,pachox/Rocket.Chat,ahmadassaf/Rocket.Chat,ggazzo/Rocket.Chat,abhishekshukla0302/trico,4thParty/Rocket.Chat,fduraibi/Rocket.Chat,linnovate/hi,ggazzo/Rocket.Chat,pitamar/Rocket.Chat,timkinnane/Rocket.Chat,JamesHGreen/Rocket_API,abhishekshukla0302/trico,pkgodara/Rocket.Chat,matthewshirley/Rocket.Chat,fatihwk/Rocket.Chat,Gudii/Rocket.Chat,alexbrazier/Rocket.Chat,flaviogrossi/Rocket.Chat,matthewshirley/Rocket.Chat,Dianoga/Rocket.Chat,galrotem1993/Rocket.Chat,JamesHGreen/Rocket.Chat,4thParty/Rocket.Chat,Achaikos/Rocket.Chat,Sing-Li/Rocket.Chat,xasx/Rocket.Chat,PavelVanecek/Rocket.Chat,fatihwk/Rocket.Chat,BorntraegerMarc/Rocket.Chat,k0nsl/Rocket.Chat,fduraibi/Rocket.Chat,k0nsl/Rocket.Chat,tntobias/Rocket.Chat,snaiperskaya96/Rocket.Chat,ziedmahdi/Rocket.Chat,bt/Rocket.Chat,AimenJoe/Rocket.Chat,Kiran-Rao/Rocket.Chat,mccambridge/Rocket.Chat,inoxth/Rocket.Chat,LearnersGuild/echo-chat,LearnersGuild/Rocket.Chat,steedos/chat,flaviogrossi/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,pachox/Rocket.Chat,ziedmahdi/Rocket.Chat,xboston/Rocket.Chat,abduljanjua/TheHub,xboston/Rocket.Chat,JamesHGreen/Rocket.Chat,Flitterkill/Rocket.Chat,NMandapaty/Rocket.Chat,mrinaldhar/Rocket.Chat,subesokun/Rocket.Chat,Deepakkothandan/Rocket.Chat
93f8bfb80f950c7b7b8e830a8fe32fda1849cf52
hubot-dotnet/index.coffee
hubot-dotnet/index.coffee
{Robot, Adapter, TextMessage, EnterMessage, LeaveMessage, Response} = require 'hubot' DotNetServer = require './dotnet' class DotNet extends Adapter send: (envelope, strings...) -> @server.sendChat envelope.message.client, str for str in strings emote: (envelope, strings...) -> @server.sendEmote envelope.message.client, str for str in strings reply: (envelope, strings...) -> @send envelope, "#{envelope.user.name}: #{str}" for str in strings run: -> @server = new DotNetServer 8880 @server.on 'chat', (user, message, client) => console.log user, ':', message msg = new TextMessage user, message # attach the client so we know who to reply to msg.client = client # pipe the incoming chat into hubot @receive msg @server.start() # tell hubot we're ready @emit 'connected' exports.use = (robot) -> new DotNet robot
{Robot, Adapter, TextMessage, EnterMessage, LeaveMessage, Response} = require 'hubot' DotNetServer = require './server' class DotNet extends Adapter constructor: -> @port = process.env.HUBOT_DOTNET_PORT || 8880 send: (envelope, strings...) -> @server.sendChat envelope.message.client, str for str in strings emote: (envelope, strings...) -> @server.sendEmote envelope.message.client, str for str in strings reply: (envelope, strings...) -> @send envelope, "#{envelope.user.name}: #{str}" for str in strings run: -> @server = new DotNetServer @port @server.on 'chat', (user, message, client) => console.log user, ':', message msg = new TextMessage user, message # attach the client so we know who to reply to msg.client = client # pipe the incoming chat into hubot @receive msg @server.start() # tell hubot we're ready @emit 'connected' exports.use = (robot) -> new DotNet robot
Fix a few adapter issues.
Fix a few adapter issues.
CoffeeScript
mit
VoiDeD/hubot-dotnet
3f920991cdc385a0e55adb7078807b712f4b899a
scripts/programmer-excuses.coffee
scripts/programmer-excuses.coffee
# Description: # Hubot will handle your bug reports now # # Dependencies: # "scraper": "0.0.9" # # Configuration: # None # # Commands: # # Author: # capoferro (shamelessly copied from rrix's archer.coffee) scraper = require 'scraper' action = (msg) -> options = { 'uri': 'http://programmerexcuses.com', 'headers': { 'User-Agent': 'User-Agent: Programmer Excuses Bot for Hubot' } } scraper options, (err, jQuery) -> throw err if err quote = jQuery('.wrapper a').toArray()[0] dialog = '' + jQuery(quote).text().trim() msg.send dialog module.exports = (robot) -> robot.hear /\sbug[\s?.!]/i, action robot.hear /\sexcuse\s/i, action robot.hear /what (is|was) the (problem|bug|issue)/i, action
# Description: # Hubot will handle your bug reports now # # Dependencies: # "scraper": "0.0.9" # # Configuration: # None # # Commands: # # Author: # capoferro (shamelessly copied from rrix's archer.coffee) scraper = require 'scraper' action = (msg) -> options = { 'uri': 'http://programmerexcuses.com', 'headers': { 'User-Agent': 'User-Agent: Programmer Excuses Bot for Hubot' } } scraper options, (err, jQuery) -> throw err if err quote = jQuery('.wrapper a').toArray()[0] dialog = '' + jQuery(quote).text().trim() msg.send dialog module.exports = (robot) -> robot.respond /\sbug[\s?.!]/i, action robot.respond /\sexcuse\s/i, action robot.respond /what (is|was) the (problem|bug|issue)/i, action
Reduce verbosity of programmer excuses
Reduce verbosity of programmer excuses
CoffeeScript
mit
RiotGamesMinions/lefay,RiotGamesMinions/lefay
00271280eb0d5febb9adb46636230c1ce9eb7139
app/models/DialogManager.coffee
app/models/DialogManager.coffee
mediator = require 'mediator' module.exports = class DialogManager constructor: -> @source = document.getElementById 'dialog-template' @template = Handlebars.compile(@source.innerText) mediator.dialogManager = @ showDialog: (data, callback) => result = $ @template(data) that = this result.children('.dialog-option').click (event) -> that.hideDialog() id = parseInt( $(this).prop('id') ) callback(id + 1) if callback $('#dialog').append(result). css('left', 0). css('top', homepageview.canvas.height + 2). css('width', homepageview.canvas.width). fadeIn() hideDialog: () => $('#dialog').empty()
mediator = require 'mediator' module.exports = class DialogManager constructor: -> @source = document.getElementById 'dialog-template' @template = Handlebars.compile(@source.innerText) @canvas = document.getElementById 'game-canvas' mediator.dialogManager = @ showDialog: (data, callback) => result = $ @template(data) that = this result.children('.dialog-option').click (event) -> that.hideDialog() id = parseInt( $(this).prop('id') ) callback(id + 1) if callback $('#dialog').append(result). css('left', 0). css('top', @canvas.height + 2). css('width', @canvas.width). fadeIn() hideDialog: () => $('#dialog').empty()
Fix dialogmanager only working in debug mode
Fix dialogmanager only working in debug mode
CoffeeScript
apache-2.0
despairblue/shiny-wight
43f8b185db3ff3bc176d5e1676261bf60d35c127
api/index.coffee
api/index.coffee
# dom.d.ts: https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts # this fix is needed because these definitions are absent from typescript's official lib.d.ts and are used in dom.d.ts. fix = """ interface ArrayBufferView {} declare var ArrayBufferView: {} interface ArrayBuffer {} declare var ArrayBuffer: {} interface Uint8Array {} declare var Uint8Array: {} interface Int32Array {} declare var Int32Array: {} interface Float32Array {} declare var Float32Array: {} """ fs = require 'fs' SupAPI.addPlugin 'typescript', 'dom', { defs: fs.readFileSync(__dirname + '/dom.d.ts', encoding: 'utf8') + fix }
# dom.d.ts: https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts # This fix is needed because these definitions are absent from typescript's official lib.d.ts and are used in dom.d.ts. # 06 march 2015: these definitions can actually be found in : # https://github.com/Microsoft/TypeScript/blob/master/src/lib/extensions.d.ts # and also in # https://github.com/Microsoft/TypeScript/blob/master/src/lib/es6.d.ts fix = """ interface ArrayBufferView {} declare var ArrayBufferView: {} interface ArrayBuffer {} declare var ArrayBuffer: {} interface Uint8Array {} declare var Uint8Array: {} interface Int32Array {} declare var Int32Array: {} interface Float32Array {} declare var Float32Array: {} """ fs = require 'fs' SupAPI.addPlugin 'typescript', 'dom', { defs: fs.readFileSync(__dirname + '/dom.d.ts', encoding: 'utf8') + fix }
Add comments on missing definitions.
Add comments on missing definitions.
CoffeeScript
mit
florentpoujol/superpowers-dom-plugin
086d19ef6c30d6bbd43e03d6d802e89b000cb66e
keymaps/find-and-replace.cson
keymaps/find-and-replace.cson
'body': 'meta-F': 'project-find:show' 'meta-f': 'find-and-replace:show' '.editor': 'alt-meta-f': 'find-and-replace:show-replace' 'meta-g': 'find-and-replace:find-next' 'meta-G': 'find-and-replace:find-previous' 'meta-e': 'find-and-replace:use-selection-as-find-pattern' '.find-and-replace': 'meta-enter': 'find-and-replace:replace-all' 'alt-meta-/': 'find-and-replace:toggle-regex-option' 'alt-meta-c': 'find-and-replace:toggle-case-option' 'alt-meta-s': 'find-and-replace:toggle-selection-option' '.find-and-replace, .project-find, .project-find .results-view': 'escape': 'core:cancel' 'tab': 'find-and-replace:focus-next' 'shift-tab': 'find-and-replace:focus-previous' '.project-find': 'meta-enter': 'project-find:replace-all'
'body': 'meta-F': 'project-find:show' 'meta-f': 'find-and-replace:show' 'alt-meta-f': 'find-and-replace:show-replace' '.editor': 'meta-g': 'find-and-replace:find-next' 'meta-G': 'find-and-replace:find-previous' 'meta-e': 'find-and-replace:use-selection-as-find-pattern' '.find-and-replace': 'meta-enter': 'find-and-replace:replace-all' 'alt-meta-/': 'find-and-replace:toggle-regex-option' 'alt-meta-c': 'find-and-replace:toggle-case-option' 'alt-meta-s': 'find-and-replace:toggle-selection-option' '.find-and-replace, .project-find, .project-find .results-view': 'escape': 'core:cancel' 'tab': 'find-and-replace:focus-next' 'shift-tab': 'find-and-replace:focus-previous' '.project-find': 'meta-enter': 'project-find:replace-all'
Make replace keymap work in all contexts
Make replace keymap work in all contexts
CoffeeScript
mit
harai/find-and-replace,atom/find-and-replace,bmperrea/find-and-replace,trevdor/find-and-replace
a184116b42792de88285e322dbbf7c4c21e01898
config.coffee
config.coffee
exports.config = # See http://brunch.io/#documentation for docs. files: javascripts: joinTo: 'javascripts/app.js': /^app/ 'javascripts/vendor.js': /^vendor/ 'test/javascripts/test.js': /^test[\\/](?!vendor)/ 'test/javascripts/test-vendor.js': /^test[\\/](?=vendor)/ order: # Files in `vendor` directories are compiled before other files # even if they aren't specified in order.before. before: [ 'vendor/scripts/console-polyfill.js', 'vendor/scripts/jquery-1.9.1.js', 'vendor/scripts/lodash-1.2.0.js', 'vendor/scripts/backbone-1.0.0.js' ] after: [ 'test/vendor/scripts/test-helper.js' ] stylesheets: joinTo: 'stylesheets/app.css': /^(app|vendor)/ 'test/stylesheets/test.css': /^test/ order: after: ['vendor/styles/helpers.css'] templates: joinTo: 'javascripts/app.js' # breaks handlebars # modules: # addSourceURLs: true coffeelint: options: max_line_length: level: "ignore"
exports.config = # See http://brunch.io/#documentation for docs. files: javascripts: joinTo: 'javascripts/app.js': /^app/ 'javascripts/vendor.js': /^vendor/ 'test/javascripts/test.js': /^test[\\/](?!vendor)/ 'test/javascripts/test-vendor.js': /^test[\\/](?=vendor)/ order: # Files in `vendor` directories are compiled before other files # even if they aren't specified in order.before. before: [ 'vendor/scripts/console-polyfill.js', 'vendor/scripts/jquery-1.9.1.js', 'vendor/scripts/lodash-1.2.0.js', 'vendor/scripts/backbone-1.0.0.js' ] after: [ 'test/vendor/scripts/test-helper.js' ] stylesheets: joinTo: 'stylesheets/app.css': /^(app|vendor)/ 'test/stylesheets/test.css': /^test/ order: after: ['vendor/styles/helpers.css'] templates: joinTo: 'javascripts/app.js' modules: addSourceURLs: true coffeelint: options: max_line_length: level: "ignore"
Switch source urls on again
Switch source urls on again Fixed with: https://github.com/despairblue/brunch-with-chaplin/commit/a8bf36c7ac6736324b6821351f9d1a562c0f3c33 and https://github.com/despairblue/handlebars-brunch/commit/5220e5e6a95fe1a9c6e3bd4d6a3d7dfad9cd4c3f
CoffeeScript
apache-2.0
despairblue/scegratoo
04fce8067ff911c7d89924568184e64ad922c615
src/atom/app.coffee
src/atom/app.coffee
Keymap = require 'keymap' $ = require 'jquery' _ = require 'underscore' require 'underscore-extensions' module.exports = class App keymap: null windows: null tabText: null constructor: (@loadPath, nativeMethods)-> @windows = [] @setUpKeymap() @tabText = " " setUpKeymap: -> @keymap = new Keymap() $(document).on 'keydown', (e) => @keymap.handleKeyEvent(e) @keymap.bindDefaultKeys() open: (url) -> $native.open url quit: -> $native.terminate null windowOpened: (window) -> @windows.push window windowClosed: (window) -> _.remove(@windows, window)
Keymap = require 'keymap' $ = require 'jquery' _ = require 'underscore' require 'underscore-extensions' module.exports = class App keymap: null windows: null tabText: null constructor: (@loadPath, nativeMethods)-> @windows = [] @setUpKeymap() @tabText = " " setUpKeymap: -> @keymap = new Keymap() $(document).on 'keydown', (e) => @keymap.handleKeyEvent(e) @keymap.bindDefaultKeys() open: (url) -> $native.open url quit: -> $native.terminate null windowIdCounter: 1 windowOpened: (window) -> id = @windowIdCounter++ console.log "window opened! #{id}" window.id = id @windows.push window windowClosed: (window) -> console.log "windowClosed #{window.id}" console.log "windows length before #{@windows.length}" _.remove(@windows, window) console.log "windows length after #{@windows.length}"
Add some temporary logging to debug intermittent spec failure.
Add some temporary logging to debug intermittent spec failure.
CoffeeScript
mit
tisu2tisu/atom,RobinTec/atom,jtrose2/atom,toqz/atom,ppamorim/atom,sebmck/atom,matthewclendening/atom,devoncarew/atom,Mokolea/atom,yalexx/atom,hagb4rd/atom,G-Baby/atom,stuartquin/atom,deepfox/atom,codex8/atom,bradgearon/atom,deepfox/atom,githubteacher/atom,bryonwinger/atom,Abdillah/atom,acontreras89/atom,sekcheong/atom,Andrey-Pavlov/atom,qskycolor/atom,scv119/atom,prembasumatary/atom,transcranial/atom,Abdillah/atom,elkingtonmcb/atom,matthewclendening/atom,Rychard/atom,devmario/atom,vinodpanicker/atom,me-benni/atom,efatsi/atom,erikhakansson/atom,Jandersolutions/atom,yalexx/atom,rsvip/aTom,ivoadf/atom,basarat/atom,yalexx/atom,anuwat121/atom,nrodriguez13/atom,codex8/atom,Jandersoft/atom,matthewclendening/atom,SlimeQ/atom,jlord/atom,g2p/atom,Shekharrajak/atom,yamhon/atom,ykeisuke/atom,sekcheong/atom,paulcbetts/atom,ali/atom,githubteacher/atom,pombredanne/atom,fang-yufeng/atom,dsandstrom/atom,ivoadf/atom,dsandstrom/atom,devoncarew/atom,dkfiresky/atom,FIT-CSE2410-A-Bombs/atom,omarhuanca/atom,FoldingText/atom,dkfiresky/atom,yamhon/atom,wiggzz/atom,qskycolor/atom,h0dgep0dge/atom,jtrose2/atom,jeremyramin/atom,abe33/atom,jordanbtucker/atom,john-kelly/atom,lovesnow/atom,champagnez/atom,abcP9110/atom,bsmr-x-script/atom,russlescai/atom,cyzn/atom,jordanbtucker/atom,ilovezy/atom,AlbertoBarrago/atom,mrodalgaard/atom,hakatashi/atom,Galactix/atom,NunoEdgarGub1/atom,jjz/atom,folpindo/atom,GHackAnonymous/atom,avdg/atom,me6iaton/atom,chengky/atom,bj7/atom,yomybaby/atom,NunoEdgarGub1/atom,MjAbuz/atom,crazyquark/atom,kjav/atom,Ingramz/atom,ezeoleaf/atom,MjAbuz/atom,avdg/atom,panuchart/atom,omarhuanca/atom,wiggzz/atom,brumm/atom,omarhuanca/atom,Arcanemagus/atom,gontadu/atom,ReddTea/atom,elkingtonmcb/atom,cyzn/atom,scippio/atom,tanin47/atom,davideg/atom,hharchani/atom,amine7536/atom,me6iaton/atom,russlescai/atom,fang-yufeng/atom,pombredanne/atom,KENJU/atom,liuxiong332/atom,Sangaroonaom/atom,Locke23rus/atom,mnquintana/atom,mostafaeweda/atom,jjz/atom,davideg/atom,ReddTea/atom,Sangaroonaom/atom,toqz/atom,brettle/atom,gabrielPeart/atom,lisonma/atom,deepfox/atom,pombredanne/atom,ppamorim/atom,t9md/atom,gontadu/atom,bryonwinger/atom,daxlab/atom,rsvip/aTom,AlbertoBarrago/atom,stinsonga/atom,dannyflax/atom,tjkr/atom,ppamorim/atom,tjkr/atom,Rychard/atom,devoncarew/atom,Dennis1978/atom,0x73/atom,hagb4rd/atom,johnhaley81/atom,ObviouslyGreen/atom,kittens/atom,niklabh/atom,decaffeinate-examples/atom,jordanbtucker/atom,001szymon/atom,scippio/atom,codex8/atom,qiujuer/atom,burodepeper/atom,sotayamashita/atom,deoxilix/atom,amine7536/atom,kjav/atom,nvoron23/atom,woss/atom,Neron-X5/atom,tanin47/atom,execjosh/atom,crazyquark/atom,mertkahyaoglu/atom,kandros/atom,nvoron23/atom,bj7/atom,kjav/atom,Andrey-Pavlov/atom,vinodpanicker/atom,Locke23rus/atom,Ju2ender/atom,jjz/atom,andrewleverette/atom,sebmck/atom,palita01/atom,sillvan/atom,deoxilix/atom,liuxiong332/atom,YunchengLiao/atom,kdheepak89/atom,matthewclendening/atom,BogusCurry/atom,helber/atom,sebmck/atom,lisonma/atom,ralphtheninja/atom,Shekharrajak/atom,crazyquark/atom,xream/atom,h0dgep0dge/atom,Jonekee/atom,hharchani/atom,vjeux/atom,rxkit/atom,constanzaurzua/atom,ilovezy/atom,lpommers/atom,Hasimir/atom,john-kelly/atom,RobinTec/atom,crazyquark/atom,AlexxNica/atom,qskycolor/atom,gisenberg/atom,sillvan/atom,alfredxing/atom,MjAbuz/atom,Mokolea/atom,jtrose2/atom,panuchart/atom,dkfiresky/atom,Huaraz2/atom,hpham04/atom,tisu2tisu/atom,ReddTea/atom,Mokolea/atom,jacekkopecky/atom,toqz/atom,anuwat121/atom,deoxilix/atom,einarmagnus/atom,yomybaby/atom,kittens/atom,anuwat121/atom,rmartin/atom,crazyquark/atom,davideg/atom,chengky/atom,oggy/atom,Hasimir/atom,qiujuer/atom,paulcbetts/atom,pombredanne/atom,prembasumatary/atom,qiujuer/atom,fang-yufeng/atom,stinsonga/atom,Jandersolutions/atom,kevinrenaers/atom,SlimeQ/atom,hpham04/atom,jlord/atom,scv119/atom,ardeshirj/atom,rjattrill/atom,FoldingText/atom,SlimeQ/atom,atom/atom,oggy/atom,folpindo/atom,charleswhchan/atom,liuderchi/atom,phord/atom,chfritz/atom,niklabh/atom,basarat/atom,G-Baby/atom,liuxiong332/atom,Rychard/atom,Neron-X5/atom,niklabh/atom,kjav/atom,Ingramz/atom,dijs/atom,woss/atom,transcranial/atom,YunchengLiao/atom,amine7536/atom,AlbertoBarrago/atom,deepfox/atom,johnhaley81/atom,Galactix/atom,vhutheesing/atom,brettle/atom,alfredxing/atom,sotayamashita/atom,gabrielPeart/atom,sebmck/atom,gisenberg/atom,medovob/atom,execjosh/atom,RobinTec/atom,liuderchi/atom,beni55/atom,synaptek/atom,fedorov/atom,rsvip/aTom,ezeoleaf/atom,johnhaley81/atom,Jdesk/atom,YunchengLiao/atom,abe33/atom,lisonma/atom,fredericksilva/atom,vjeux/atom,abcP9110/atom,bradgearon/atom,erikhakansson/atom,gisenberg/atom,NunoEdgarGub1/atom,bolinfest/atom,0x73/atom,efatsi/atom,MjAbuz/atom,abcP9110/atom,rlugojr/atom,dijs/atom,rxkit/atom,sillvan/atom,sekcheong/atom,gisenberg/atom,atom/atom,tmunro/atom,matthewclendening/atom,lovesnow/atom,charleswhchan/atom,chengky/atom,vcarrera/atom,jeremyramin/atom,ezeoleaf/atom,kc8wxm/atom,vjeux/atom,Huaraz2/atom,ali/atom,seedtigo/atom,nucked/atom,andrewleverette/atom,gzzhanghao/atom,g2p/atom,vcarrera/atom,stinsonga/atom,dsandstrom/atom,vcarrera/atom,hellendag/atom,ashneo76/atom,Austen-G/BlockBuilder,batjko/atom,sxgao3001/atom,Dennis1978/atom,mertkahyaoglu/atom,oggy/atom,rmartin/atom,nrodriguez13/atom,atom/atom,hagb4rd/atom,tmunro/atom,NunoEdgarGub1/atom,oggy/atom,john-kelly/atom,SlimeQ/atom,synaptek/atom,PKRoma/atom,batjko/atom,ilovezy/atom,acontreras89/atom,bj7/atom,basarat/atom,basarat/atom,dannyflax/atom,tony612/atom,tmunro/atom,BogusCurry/atom,ali/atom,mrodalgaard/atom,kjav/atom,devmario/atom,kaicataldo/atom,AdrianVovk/substance-ide,ezeoleaf/atom,Jonekee/atom,helber/atom,erikhakansson/atom,mrodalgaard/atom,gabrielPeart/atom,pengshp/atom,xream/atom,prembasumatary/atom,G-Baby/atom,AlisaKiatkongkumthon/atom,hpham04/atom,bcoe/atom,NunoEdgarGub1/atom,001szymon/atom,targeter21/atom,CraZySacX/atom,john-kelly/atom,Jandersolutions/atom,vinodpanicker/atom,fscherwi/atom,dsandstrom/atom,lisonma/atom,qskycolor/atom,palita01/atom,mnquintana/atom,jjz/atom,transcranial/atom,kdheepak89/atom,FIT-CSE2410-A-Bombs/atom,Galactix/atom,KENJU/atom,me-benni/atom,hharchani/atom,jeremyramin/atom,Jdesk/atom,devoncarew/atom,Andrey-Pavlov/atom,davideg/atom,GHackAnonymous/atom,darwin/atom,pkdevbox/atom,alexandergmann/atom,Abdillah/atom,FIT-CSE2410-A-Bombs/atom,kandros/atom,efatsi/atom,GHackAnonymous/atom,Jandersolutions/atom,PKRoma/atom,brettle/atom,chfritz/atom,me-benni/atom,AdrianVovk/substance-ide,toqz/atom,rjattrill/atom,bryonwinger/atom,Abdillah/atom,mostafaeweda/atom,prembasumatary/atom,yomybaby/atom,jjz/atom,helber/atom,jtrose2/atom,elkingtonmcb/atom,nucked/atom,Jandersolutions/atom,bencolon/atom,githubteacher/atom,hakatashi/atom,tjkr/atom,burodepeper/atom,mdumrauf/atom,Jandersoft/atom,basarat/atom,rxkit/atom,nrodriguez13/atom,Galactix/atom,lovesnow/atom,ReddTea/atom,Neron-X5/atom,davideg/atom,daxlab/atom,basarat/atom,mdumrauf/atom,beni55/atom,n-riesco/atom,FoldingText/atom,RuiDGoncalves/atom,alexandergmann/atom,darwin/atom,deepfox/atom,rmartin/atom,YunchengLiao/atom,einarmagnus/atom,acontreras89/atom,mnquintana/atom,omarhuanca/atom,Austen-G/BlockBuilder,rookie125/atom,bcoe/atom,vcarrera/atom,codex8/atom,florianb/atom,kc8wxm/atom,decaffeinate-examples/atom,alexandergmann/atom,liuxiong332/atom,CraZySacX/atom,0x73/atom,sillvan/atom,constanzaurzua/atom,john-kelly/atom,yomybaby/atom,florianb/atom,ardeshirj/atom,hagb4rd/atom,hharchani/atom,amine7536/atom,acontreras89/atom,AlisaKiatkongkumthon/atom,ykeisuke/atom,amine7536/atom,brumm/atom,nvoron23/atom,t9md/atom,Rodjana/atom,rjattrill/atom,rjattrill/atom,yomybaby/atom,KENJU/atom,AlisaKiatkongkumthon/atom,RuiDGoncalves/atom,charleswhchan/atom,medovob/atom,Jandersoft/atom,einarmagnus/atom,isghe/atom,ilovezy/atom,hpham04/atom,yamhon/atom,dannyflax/atom,tisu2tisu/atom,mertkahyaoglu/atom,russlescai/atom,nucked/atom,Ju2ender/atom,mertkahyaoglu/atom,Ju2ender/atom,medovob/atom,Klozz/atom,Jonekee/atom,Rodjana/atom,wiggzz/atom,rsvip/aTom,sekcheong/atom,GHackAnonymous/atom,einarmagnus/atom,jlord/atom,targeter21/atom,dijs/atom,dkfiresky/atom,rmartin/atom,FoldingText/atom,jacekkopecky/atom,prembasumatary/atom,hpham04/atom,pkdevbox/atom,pombredanne/atom,isghe/atom,dannyflax/atom,phord/atom,batjko/atom,devmario/atom,ilovezy/atom,bencolon/atom,bradgearon/atom,jacekkopecky/atom,originye/atom,ivoadf/atom,decaffeinate-examples/atom,sillvan/atom,execjosh/atom,seedtigo/atom,Austen-G/BlockBuilder,svanharmelen/atom,mostafaeweda/atom,Locke23rus/atom,jtrose2/atom,jlord/atom,johnrizzo1/atom,dannyflax/atom,batjko/atom,hellendag/atom,cyzn/atom,Ju2ender/atom,kdheepak89/atom,russlescai/atom,qiujuer/atom,yangchenghu/atom,paulcbetts/atom,abcP9110/atom,synaptek/atom,lovesnow/atom,jacekkopecky/atom,abcP9110/atom,vinodpanicker/atom,Shekharrajak/atom,FoldingText/atom,RobinTec/atom,hellendag/atom,CraZySacX/atom,scv119/atom,fredericksilva/atom,Neron-X5/atom,DiogoXRP/atom,t9md/atom,folpindo/atom,fang-yufeng/atom,ObviouslyGreen/atom,alfredxing/atom,phord/atom,Hasimir/atom,RobinTec/atom,ardeshirj/atom,originye/atom,splodingsocks/atom,hharchani/atom,nvoron23/atom,vinodpanicker/atom,ironbox360/atom,boomwaiza/atom,pengshp/atom,tony612/atom,devoncarew/atom,florianb/atom,synaptek/atom,gzzhanghao/atom,stuartquin/atom,Klozz/atom,isghe/atom,gisenberg/atom,RuiDGoncalves/atom,ashneo76/atom,kittens/atom,woss/atom,targeter21/atom,SlimeQ/atom,batjko/atom,champagnez/atom,YunchengLiao/atom,champagnez/atom,targeter21/atom,Galactix/atom,sxgao3001/atom,scv119/atom,kdheepak89/atom,liuderchi/atom,ykeisuke/atom,001szymon/atom,omarhuanca/atom,lovesnow/atom,ali/atom,Jdesk/atom,me6iaton/atom,fscherwi/atom,g2p/atom,bcoe/atom,ppamorim/atom,kaicataldo/atom,einarmagnus/atom,bsmr-x-script/atom,chfritz/atom,harshdattani/atom,PKRoma/atom,Klozz/atom,bcoe/atom,bryonwinger/atom,rmartin/atom,qskycolor/atom,xream/atom,GHackAnonymous/atom,Andrey-Pavlov/atom,n-riesco/atom,vjeux/atom,bencolon/atom,originye/atom,vhutheesing/atom,n-riesco/atom,mostafaeweda/atom,ppamorim/atom,svanharmelen/atom,codex8/atom,avdg/atom,MjAbuz/atom,mertkahyaoglu/atom,florianb/atom,fedorov/atom,stuartquin/atom,n-riesco/atom,FoldingText/atom,Sangaroonaom/atom,ironbox360/atom,lpommers/atom,jacekkopecky/atom,fedorov/atom,n-riesco/atom,yalexx/atom,Ingramz/atom,pkdevbox/atom,scippio/atom,charleswhchan/atom,devmario/atom,fredericksilva/atom,devmario/atom,kdheepak89/atom,0x73/atom,tony612/atom,splodingsocks/atom,sekcheong/atom,Abdillah/atom,johnrizzo1/atom,dannyflax/atom,brumm/atom,KENJU/atom,mnquintana/atom,BogusCurry/atom,isghe/atom,svanharmelen/atom,harshdattani/atom,lisonma/atom,Andrey-Pavlov/atom,vjeux/atom,liuxiong332/atom,vhutheesing/atom,woss/atom,rsvip/aTom,gzzhanghao/atom,seedtigo/atom,fredericksilva/atom,sxgao3001/atom,darwin/atom,boomwaiza/atom,ObviouslyGreen/atom,sxgao3001/atom,qiujuer/atom,woss/atom,Neron-X5/atom,Austen-G/BlockBuilder,rookie125/atom,DiogoXRP/atom,tony612/atom,isghe/atom,AdrianVovk/substance-ide,burodepeper/atom,oggy/atom,boomwaiza/atom,toqz/atom,yangchenghu/atom,jacekkopecky/atom,Arcanemagus/atom,andrewleverette/atom,dsandstrom/atom,yalexx/atom,sebmck/atom,Hasimir/atom,Dennis1978/atom,Austen-G/BlockBuilder,kandros/atom,ashneo76/atom,Jdesk/atom,hakatashi/atom,rookie125/atom,jlord/atom,fedorov/atom,Arcanemagus/atom,kc8wxm/atom,mostafaeweda/atom,AlexxNica/atom,sxgao3001/atom,ali/atom,Jandersoft/atom,mdumrauf/atom,Rodjana/atom,kittens/atom,h0dgep0dge/atom,nvoron23/atom,Shekharrajak/atom,fscherwi/atom,daxlab/atom,constanzaurzua/atom,tony612/atom,liuderchi/atom,charleswhchan/atom,panuchart/atom,ironbox360/atom,Hasimir/atom,rlugojr/atom,palita01/atom,targeter21/atom,synaptek/atom,hakatashi/atom,splodingsocks/atom,rlugojr/atom,kaicataldo/atom,Austen-G/BlockBuilder,kittens/atom,bcoe/atom,decaffeinate-examples/atom,pengshp/atom,bolinfest/atom,vcarrera/atom,splodingsocks/atom,ReddTea/atom,lpommers/atom,kc8wxm/atom,johnrizzo1/atom,hagb4rd/atom,florianb/atom,bolinfest/atom,abe33/atom,harshdattani/atom,acontreras89/atom,beni55/atom,h0dgep0dge/atom,me6iaton/atom,Jandersoft/atom,fang-yufeng/atom,AlexxNica/atom,dkfiresky/atom,kc8wxm/atom,yangchenghu/atom,constanzaurzua/atom,Huaraz2/atom,bsmr-x-script/atom,chengky/atom,Shekharrajak/atom,tanin47/atom,fredericksilva/atom,sotayamashita/atom,mnquintana/atom,DiogoXRP/atom,me6iaton/atom,ralphtheninja/atom,Jdesk/atom,stinsonga/atom,kevinrenaers/atom,chengky/atom,ralphtheninja/atom,gontadu/atom,paulcbetts/atom,Ju2ender/atom,fedorov/atom,constanzaurzua/atom,kevinrenaers/atom,KENJU/atom,russlescai/atom
c9e7cfc02ce454ff678463a136d3110835478b2e
src/panel-element.coffee
src/panel-element.coffee
{CompositeDisposable} = require 'event-kit' {callAttachHooks} = require './space-pen-extensions' class PanelElement extends HTMLElement createdCallback: -> @subscriptions = new CompositeDisposable initialize: (@model) -> @appendChild(@getItemView()) @classList.add(@model.getClassName().split(' ')...) if @model.getClassName()? @subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this)) @subscriptions.add @model.onDidDestroy(@destroyed.bind(this)) this getModel: -> @model getItemView: -> atom.views.getView(@model.getItem()) attachedCallback: -> callAttachHooks(@getItemView()) # for backward compatibility with SpacePen views @visibleChanged(@model.isVisible()) visibleChanged: (visible) -> if visible @style.display = null else @style.display = 'none' destroyed: -> @subscriptions.dispose() @parentNode?.removeChild(this) module.exports = PanelElement = document.registerElement 'atom-panel', prototype: PanelElement.prototype
{CompositeDisposable} = require 'event-kit' {callAttachHooks} = require './space-pen-extensions' Panel = require './panel' class PanelElement extends HTMLElement createdCallback: -> @subscriptions = new CompositeDisposable initialize: (@model) -> @appendChild(@getItemView()) @classList.add(@model.getClassName().split(' ')...) if @model.getClassName()? @subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this)) @subscriptions.add @model.onDidDestroy(@destroyed.bind(this)) this getModel: -> @model or= new Panel({}) getItemView: -> atom.views.getView(@getModel().getItem()) attachedCallback: -> callAttachHooks(@getItemView()) # for backward compatibility with SpacePen views @visibleChanged(@getModel().isVisible()) visibleChanged: (visible) -> if visible @style.display = null else @style.display = 'none' destroyed: -> @subscriptions.dispose() @parentNode?.removeChild(this) module.exports = PanelElement = document.registerElement 'atom-panel', prototype: PanelElement.prototype
Allow PanelElements to be instantiated with markup
Allow PanelElements to be instantiated with markup
CoffeeScript
mit
ali/atom,fang-yufeng/atom,hakatashi/atom,Hasimir/atom,dkfiresky/atom,alfredxing/atom,jordanbtucker/atom,bryonwinger/atom,davideg/atom,Neron-X5/atom,jordanbtucker/atom,woss/atom,me6iaton/atom,kjav/atom,scippio/atom,rsvip/aTom,KENJU/atom,vjeux/atom,crazyquark/atom,SlimeQ/atom,yamhon/atom,hellendag/atom,deepfox/atom,yalexx/atom,G-Baby/atom,ashneo76/atom,kandros/atom,SlimeQ/atom,vcarrera/atom,vjeux/atom,gontadu/atom,fscherwi/atom,champagnez/atom,Hasimir/atom,RobinTec/atom,pkdevbox/atom,panuchart/atom,t9md/atom,oggy/atom,bcoe/atom,chengky/atom,001szymon/atom,Rychard/atom,yalexx/atom,DiogoXRP/atom,prembasumatary/atom,woss/atom,acontreras89/atom,Galactix/atom,originye/atom,champagnez/atom,phord/atom,vhutheesing/atom,Locke23rus/atom,matthewclendening/atom,tisu2tisu/atom,Ju2ender/atom,dsandstrom/atom,beni55/atom,gabrielPeart/atom,ezeoleaf/atom,liuderchi/atom,h0dgep0dge/atom,lpommers/atom,folpindo/atom,abcP9110/atom,john-kelly/atom,ali/atom,jacekkopecky/atom,NunoEdgarGub1/atom,kevinrenaers/atom,kdheepak89/atom,acontreras89/atom,Jdesk/atom,avdg/atom,wiggzz/atom,lisonma/atom,yomybaby/atom,bryonwinger/atom,jlord/atom,KENJU/atom,Jdesk/atom,AlbertoBarrago/atom,Abdillah/atom,deoxilix/atom,jacekkopecky/atom,charleswhchan/atom,Dennis1978/atom,Austen-G/BlockBuilder,palita01/atom,rsvip/aTom,sebmck/atom,batjko/atom,charleswhchan/atom,anuwat121/atom,basarat/atom,ObviouslyGreen/atom,yangchenghu/atom,yomybaby/atom,synaptek/atom,Austen-G/BlockBuilder,ivoadf/atom,gzzhanghao/atom,bolinfest/atom,KENJU/atom,originye/atom,KENJU/atom,devoncarew/atom,CraZySacX/atom,vinodpanicker/atom,ppamorim/atom,dsandstrom/atom,splodingsocks/atom,hpham04/atom,basarat/atom,Ju2ender/atom,qiujuer/atom,yangchenghu/atom,constanzaurzua/atom,hagb4rd/atom,brettle/atom,Mokolea/atom,helber/atom,fredericksilva/atom,amine7536/atom,dannyflax/atom,acontreras89/atom,qiujuer/atom,paulcbetts/atom,mrodalgaard/atom,Rodjana/atom,Abdillah/atom,001szymon/atom,rookie125/atom,liuxiong332/atom,vcarrera/atom,constanzaurzua/atom,seedtigo/atom,rsvip/aTom,0x73/atom,florianb/atom,charleswhchan/atom,gontadu/atom,ReddTea/atom,sxgao3001/atom,GHackAnonymous/atom,ralphtheninja/atom,ezeoleaf/atom,nvoron23/atom,RuiDGoncalves/atom,jlord/atom,tanin47/atom,yomybaby/atom,hagb4rd/atom,rmartin/atom,rlugojr/atom,fredericksilva/atom,Galactix/atom,YunchengLiao/atom,dannyflax/atom,gabrielPeart/atom,Jonekee/atom,NunoEdgarGub1/atom,Austen-G/BlockBuilder,liuderchi/atom,sebmck/atom,Arcanemagus/atom,Ju2ender/atom,mrodalgaard/atom,devoncarew/atom,vinodpanicker/atom,sotayamashita/atom,jjz/atom,harshdattani/atom,vinodpanicker/atom,dannyflax/atom,Andrey-Pavlov/atom,jeremyramin/atom,darwin/atom,synaptek/atom,chfritz/atom,Jandersolutions/atom,davideg/atom,matthewclendening/atom,Jandersolutions/atom,xream/atom,codex8/atom,fredericksilva/atom,ashneo76/atom,sotayamashita/atom,svanharmelen/atom,kc8wxm/atom,jacekkopecky/atom,hakatashi/atom,davideg/atom,isghe/atom,decaffeinate-examples/atom,codex8/atom,sxgao3001/atom,targeter21/atom,sekcheong/atom,scv119/atom,ralphtheninja/atom,russlescai/atom,Ju2ender/atom,DiogoXRP/atom,john-kelly/atom,Abdillah/atom,chengky/atom,amine7536/atom,john-kelly/atom,Jandersolutions/atom,CraZySacX/atom,matthewclendening/atom,transcranial/atom,decaffeinate-examples/atom,Andrey-Pavlov/atom,tanin47/atom,cyzn/atom,sillvan/atom,mertkahyaoglu/atom,oggy/atom,prembasumatary/atom,NunoEdgarGub1/atom,ykeisuke/atom,mertkahyaoglu/atom,AlisaKiatkongkumthon/atom,svanharmelen/atom,Ingramz/atom,hagb4rd/atom,abcP9110/atom,ironbox360/atom,bsmr-x-script/atom,kc8wxm/atom,tony612/atom,folpindo/atom,boomwaiza/atom,qskycolor/atom,mnquintana/atom,acontreras89/atom,johnhaley81/atom,splodingsocks/atom,seedtigo/atom,tony612/atom,elkingtonmcb/atom,andrewleverette/atom,codex8/atom,daxlab/atom,hharchani/atom,ali/atom,medovob/atom,n-riesco/atom,Neron-X5/atom,atom/atom,lovesnow/atom,prembasumatary/atom,john-kelly/atom,stuartquin/atom,sxgao3001/atom,Shekharrajak/atom,qskycolor/atom,G-Baby/atom,me-benni/atom,anuwat121/atom,n-riesco/atom,jjz/atom,dsandstrom/atom,Sangaroonaom/atom,pombredanne/atom,bencolon/atom,lisonma/atom,dsandstrom/atom,Jandersoft/atom,liuderchi/atom,atom/atom,dkfiresky/atom,ezeoleaf/atom,dkfiresky/atom,h0dgep0dge/atom,ReddTea/atom,florianb/atom,brumm/atom,john-kelly/atom,Huaraz2/atom,andrewleverette/atom,GHackAnonymous/atom,hpham04/atom,atom/atom,Abdillah/atom,ObviouslyGreen/atom,nvoron23/atom,AdrianVovk/substance-ide,RuiDGoncalves/atom,sxgao3001/atom,mdumrauf/atom,jtrose2/atom,tanin47/atom,alexandergmann/atom,bolinfest/atom,Ingramz/atom,jeremyramin/atom,nrodriguez13/atom,niklabh/atom,gisenberg/atom,omarhuanca/atom,tony612/atom,ilovezy/atom,mostafaeweda/atom,ReddTea/atom,kdheepak89/atom,originye/atom,rmartin/atom,Ingramz/atom,amine7536/atom,dkfiresky/atom,chengky/atom,Jandersoft/atom,paulcbetts/atom,dkfiresky/atom,mnquintana/atom,palita01/atom,liuxiong332/atom,seedtigo/atom,ardeshirj/atom,basarat/atom,jtrose2/atom,Jdesk/atom,russlescai/atom,rxkit/atom,tjkr/atom,MjAbuz/atom,MjAbuz/atom,mostafaeweda/atom,GHackAnonymous/atom,batjko/atom,isghe/atom,ezeoleaf/atom,hellendag/atom,stinsonga/atom,Jonekee/atom,me-benni/atom,jjz/atom,panuchart/atom,chengky/atom,medovob/atom,johnhaley81/atom,bcoe/atom,batjko/atom,deepfox/atom,vhutheesing/atom,devmario/atom,tisu2tisu/atom,deepfox/atom,rookie125/atom,isghe/atom,ironbox360/atom,paulcbetts/atom,bsmr-x-script/atom,liuxiong332/atom,transcranial/atom,AlbertoBarrago/atom,abcP9110/atom,NunoEdgarGub1/atom,rsvip/aTom,chengky/atom,dsandstrom/atom,batjko/atom,prembasumatary/atom,AlexxNica/atom,BogusCurry/atom,MjAbuz/atom,Jandersolutions/atom,fedorov/atom,MjAbuz/atom,charleswhchan/atom,fang-yufeng/atom,hharchani/atom,NunoEdgarGub1/atom,Andrey-Pavlov/atom,panuchart/atom,ReddTea/atom,n-riesco/atom,devoncarew/atom,fang-yufeng/atom,lovesnow/atom,basarat/atom,AlexxNica/atom,chfritz/atom,mostafaeweda/atom,kittens/atom,gisenberg/atom,Hasimir/atom,AlbertoBarrago/atom,hpham04/atom,kittens/atom,Jandersoft/atom,g2p/atom,florianb/atom,Shekharrajak/atom,0x73/atom,omarhuanca/atom,mdumrauf/atom,toqz/atom,vcarrera/atom,devmario/atom,pengshp/atom,pkdevbox/atom,hagb4rd/atom,ObviouslyGreen/atom,hagb4rd/atom,pombredanne/atom,palita01/atom,Rodjana/atom,rsvip/aTom,omarhuanca/atom,woss/atom,toqz/atom,ilovezy/atom,nvoron23/atom,jtrose2/atom,Rychard/atom,dannyflax/atom,me-benni/atom,basarat/atom,johnrizzo1/atom,YunchengLiao/atom,Sangaroonaom/atom,Austen-G/BlockBuilder,Shekharrajak/atom,sebmck/atom,Huaraz2/atom,davideg/atom,bolinfest/atom,RobinTec/atom,cyzn/atom,ironbox360/atom,yamhon/atom,Hasimir/atom,Austen-G/BlockBuilder,woss/atom,dannyflax/atom,qskycolor/atom,chfritz/atom,g2p/atom,alexandergmann/atom,beni55/atom,kdheepak89/atom,jlord/atom,cyzn/atom,Sangaroonaom/atom,jlord/atom,daxlab/atom,phord/atom,ivoadf/atom,0x73/atom,vinodpanicker/atom,deoxilix/atom,synaptek/atom,tmunro/atom,daxlab/atom,RobinTec/atom,charleswhchan/atom,abcP9110/atom,Hasimir/atom,targeter21/atom,mostafaeweda/atom,nvoron23/atom,FoldingText/atom,t9md/atom,vhutheesing/atom,folpindo/atom,burodepeper/atom,sillvan/atom,hakatashi/atom,nvoron23/atom,FoldingText/atom,kaicataldo/atom,jacekkopecky/atom,me6iaton/atom,harshdattani/atom,ilovezy/atom,yalexx/atom,mdumrauf/atom,liuderchi/atom,RobinTec/atom,devoncarew/atom,FIT-CSE2410-A-Bombs/atom,dijs/atom,johnrizzo1/atom,FoldingText/atom,russlescai/atom,Klozz/atom,h0dgep0dge/atom,svanharmelen/atom,Shekharrajak/atom,vjeux/atom,RobinTec/atom,sebmck/atom,elkingtonmcb/atom,alexandergmann/atom,hharchani/atom,Jdesk/atom,alfredxing/atom,wiggzz/atom,splodingsocks/atom,Neron-X5/atom,niklabh/atom,YunchengLiao/atom,nrodriguez13/atom,vcarrera/atom,einarmagnus/atom,omarhuanca/atom,fang-yufeng/atom,batjko/atom,Galactix/atom,Klozz/atom,devoncarew/atom,gzzhanghao/atom,fedorov/atom,constanzaurzua/atom,brumm/atom,YunchengLiao/atom,einarmagnus/atom,burodepeper/atom,crazyquark/atom,stinsonga/atom,RuiDGoncalves/atom,crazyquark/atom,nucked/atom,ralphtheninja/atom,qiujuer/atom,fscherwi/atom,FoldingText/atom,lpommers/atom,bryonwinger/atom,tjkr/atom,YunchengLiao/atom,scippio/atom,Jdesk/atom,gzzhanghao/atom,phord/atom,Andrey-Pavlov/atom,SlimeQ/atom,bcoe/atom,rxkit/atom,kc8wxm/atom,jlord/atom,jeremyramin/atom,kdheepak89/atom,einarmagnus/atom,kandros/atom,Dennis1978/atom,fscherwi/atom,splodingsocks/atom,synaptek/atom,FoldingText/atom,ali/atom,einarmagnus/atom,isghe/atom,kevinrenaers/atom,niklabh/atom,AdrianVovk/substance-ide,alfredxing/atom,h0dgep0dge/atom,bryonwinger/atom,oggy/atom,medovob/atom,deepfox/atom,scv119/atom,oggy/atom,ivoadf/atom,targeter21/atom,tisu2tisu/atom,bcoe/atom,ReddTea/atom,bencolon/atom,Mokolea/atom,dijs/atom,kandros/atom,me6iaton/atom,me6iaton/atom,tmunro/atom,sekcheong/atom,ashneo76/atom,efatsi/atom,pombredanne/atom,russlescai/atom,bencolon/atom,lisonma/atom,deoxilix/atom,gabrielPeart/atom,FIT-CSE2410-A-Bombs/atom,pkdevbox/atom,rlugojr/atom,harshdattani/atom,jacekkopecky/atom,lpommers/atom,tony612/atom,qskycolor/atom,deepfox/atom,basarat/atom,Shekharrajak/atom,champagnez/atom,bj7/atom,Jandersoft/atom,GHackAnonymous/atom,boomwaiza/atom,fang-yufeng/atom,mnquintana/atom,woss/atom,Arcanemagus/atom,BogusCurry/atom,PKRoma/atom,decaffeinate-examples/atom,ppamorim/atom,toqz/atom,rxkit/atom,vinodpanicker/atom,devmario/atom,boomwaiza/atom,Klozz/atom,0x73/atom,SlimeQ/atom,rmartin/atom,targeter21/atom,dannyflax/atom,beni55/atom,kittens/atom,mertkahyaoglu/atom,oggy/atom,Jandersolutions/atom,prembasumatary/atom,decaffeinate-examples/atom,PKRoma/atom,G-Baby/atom,BogusCurry/atom,CraZySacX/atom,paulcbetts/atom,bj7/atom,t9md/atom,mertkahyaoglu/atom,rmartin/atom,stuartquin/atom,hellendag/atom,kdheepak89/atom,vcarrera/atom,einarmagnus/atom,jordanbtucker/atom,FoldingText/atom,Galactix/atom,kjav/atom,kevinrenaers/atom,darwin/atom,Neron-X5/atom,hharchani/atom,pengshp/atom,helber/atom,ppamorim/atom,lovesnow/atom,burodepeper/atom,pombredanne/atom,sebmck/atom,acontreras89/atom,Locke23rus/atom,pengshp/atom,KENJU/atom,jtrose2/atom,mnquintana/atom,kc8wxm/atom,sxgao3001/atom,ilovezy/atom,001szymon/atom,sotayamashita/atom,dijs/atom,qiujuer/atom,stinsonga/atom,liuxiong332/atom,bsmr-x-script/atom,tony612/atom,fredericksilva/atom,kjav/atom,avdg/atom,ali/atom,qskycolor/atom,constanzaurzua/atom,ppamorim/atom,sekcheong/atom,scippio/atom,n-riesco/atom,AdrianVovk/substance-ide,Rodjana/atom,fredericksilva/atom,crazyquark/atom,lisonma/atom,DiogoXRP/atom,synaptek/atom,Dennis1978/atom,florianb/atom,AlisaKiatkongkumthon/atom,avdg/atom,toqz/atom,fedorov/atom,matthewclendening/atom,lovesnow/atom,abcP9110/atom,kc8wxm/atom,stuartquin/atom,lovesnow/atom,g2p/atom,tmunro/atom,yalexx/atom,Ju2ender/atom,amine7536/atom,kjav/atom,codex8/atom,fedorov/atom,bcoe/atom,Jandersoft/atom,n-riesco/atom,hakatashi/atom,johnrizzo1/atom,scv119/atom,tjkr/atom,toqz/atom,isghe/atom,constanzaurzua/atom,pombredanne/atom,anuwat121/atom,brettle/atom,Austen-G/BlockBuilder,SlimeQ/atom,florianb/atom,Arcanemagus/atom,PKRoma/atom,jacekkopecky/atom,kaicataldo/atom,darwin/atom,yomybaby/atom,rlugojr/atom,efatsi/atom,Neron-X5/atom,gontadu/atom,bj7/atom,efatsi/atom,ykeisuke/atom,yamhon/atom,andrewleverette/atom,rookie125/atom,devmario/atom,MjAbuz/atom,qiujuer/atom,brettle/atom,omarhuanca/atom,rmartin/atom,stinsonga/atom,matthewclendening/atom,gisenberg/atom,mertkahyaoglu/atom,mnquintana/atom,sillvan/atom,Galactix/atom,lisonma/atom,FIT-CSE2410-A-Bombs/atom,transcranial/atom,kjav/atom,Jonekee/atom,liuxiong332/atom,amine7536/atom,Rychard/atom,xream/atom,me6iaton/atom,yomybaby/atom,helber/atom,targeter21/atom,davideg/atom,fedorov/atom,wiggzz/atom,devmario/atom,AlisaKiatkongkumthon/atom,hpham04/atom,Abdillah/atom,ppamorim/atom,vjeux/atom,gisenberg/atom,sekcheong/atom,brumm/atom,Locke23rus/atom,Huaraz2/atom,crazyquark/atom,kittens/atom,hpham04/atom,russlescai/atom,Andrey-Pavlov/atom,mostafaeweda/atom,Mokolea/atom,nucked/atom,sekcheong/atom,kittens/atom,ardeshirj/atom,sillvan/atom,ardeshirj/atom,codex8/atom,scv119/atom,gisenberg/atom,ykeisuke/atom,xream/atom,GHackAnonymous/atom,kaicataldo/atom,yalexx/atom,johnhaley81/atom,hharchani/atom,sillvan/atom,elkingtonmcb/atom,jjz/atom,yangchenghu/atom,jjz/atom,vjeux/atom,nucked/atom,jtrose2/atom,ilovezy/atom,mrodalgaard/atom,AlexxNica/atom,nrodriguez13/atom
7457c93746c324dabe064da046fdefcdcd8842b4
src/flux/stores/database.coffee
src/flux/stores/database.coffee
Reflux = require 'reflux' Actions = require '../actions/database' Common = require '../common/application' Executor = new (require('remote').require('../browser/application-executor.coffee')) cache = loading: false connections: [] Store = Reflux.createStore( init: -> @listenToMany(Actions) onCreateConnection: (data) -> cache.loading = true @trigger() Executor.createConnection(data) .then(=> cache.loading = false conn = name: data.name status: true data: data cache.connections.unshift conn @trigger() ) .catch((err) => cache.loading = false Common.beep() Common.createDialog type: 'warning' buttons: ['Ok'] message: "Unable to connect to host #{data.host}" detail: """ Please ensure that your MySQL host is set up to allow TCP/IP connections and is configured to allow connections from the host you are tunnelling via. You may also want to check the port is correct and that you have the necessary privileges. MySQL said: #{err.message} """ @trigger() ) query: (q) -> Executor.query(q) .then((rows) => console.log rows ) getStore: -> cache ) module.exports = Store
Reflux = require 'reflux' Actions = require '../actions/database' Common = require '../common/application' Executor = new (require('remote').require('../browser/application-executor')) cache = loading: false connections: [] Store = Reflux.createStore( init: -> @listenToMany(Actions) onCreateConnection: (data) -> cache.loading = true @trigger() Executor.createConnection(data) .then(=> cache.loading = false conn = name: data.name status: true data: data cache.connections.unshift conn @trigger() ) .catch((err) => cache.loading = false Common.beep() Common.createDialog type: 'warning' buttons: ['Ok'] message: "Unable to connect to host #{data.host}" detail: """ Please ensure that your MySQL host is set up to allow TCP/IP connections and is configured to allow connections from the host you are tunnelling via. You may also want to check the port is correct and that you have the necessary privileges. MySQL said: #{err.message} """ @trigger() ) query: (q) -> Executor.query(q) .then((rows) => console.log rows ) getStore: -> cache ) module.exports = Store
Fix error when calling application executor from packaged app
Fix error when calling application executor from packaged app
CoffeeScript
mit
iiegor/zenit,zenit/zenit,iiegor/zenit,zenit/zenit
3844295135302f001379157e8982762d41f99a5b
src/coffee/controller/SyllabusItemsController.coffee
src/coffee/controller/SyllabusItemsController.coffee
mainModule = angular.module 'meducationFrontEnd' syllabusItemsControllerFunction = ($scope, syllabusItemsService) -> levels = [0 ,1, 2, 3, 4] $scope.init = -> $scope.items = syllabusItemsService.query() $scope.showSelect = (level) -> level?.children?.length > 0 $scope.updateMeshHeadingIds = -> $scope.meshHeadingIds = [] for level in levels if $scope["selected#{level}"]?.id $scope.meshHeadingIds.push $scope["selected#{level}"].id $scope.meshHeadingIds = $scope.meshHeadingIds.join ',' syllabusItemsControllerFunction.$inject = ['$scope', 'syllabusItemsService'] mainModule.controller 'syllabusItemsController', syllabusItemsControllerFunction
mainModule = angular.module 'meducationFrontEnd' syllabusItemsControllerFunction = ($scope, syllabusItemsService) -> levels = [0..4] $scope.init = -> $scope.items = syllabusItemsService.query() $scope.showSelect = (level) -> level?.children?.length > 0 $scope.updateMeshHeadingIds = -> $scope.meshHeadingIds = [] for level in levels if $scope["selected#{level}"]?.id $scope.meshHeadingIds.push $scope["selected#{level}"].id $scope.meshHeadingIds = $scope.meshHeadingIds.join ',' syllabusItemsControllerFunction.$inject = ['$scope', 'syllabusItemsService'] mainModule.controller 'syllabusItemsController', syllabusItemsControllerFunction
Use shorthand array creation for levels
Use shorthand array creation for levels
CoffeeScript
agpl-3.0
meducation/front-end,meducation/front-end
f4d8c84a8e76eacb9e9cab7a735c0bcb6c91803e
src/task-bootstrap.coffee
src/task-bootstrap.coffee
{userAgent, taskPath} = process.env handler = null setupGlobals = -> global.attachEvent = -> console = warn: -> emit 'task:warn', arguments... log: -> emit 'task:log', arguments... error: -> emit 'task:error', arguments... trace: -> global.__defineGetter__ 'console', -> console global.document = createElement: -> setAttribute: -> getElementsByTagName: -> [] appendChild: -> documentElement: insertBefore: -> removeChild: -> getElementById: -> {} createComment: -> {} createDocumentFragment: -> {} global.emit = (event, args...) -> process.send({event, args}) global.navigator = {userAgent} global.window = global handleEvents = -> process.on 'uncaughtException', (error) -> console.error(error.message) process.on 'message', ({args}) -> isAsync = false async = -> isAsync = true (result) -> emit('task:completed', result) result = handler.bind({async})(args...) emit('task:completed', result) unless isAsync setupGlobals() handleEvents() handler = require(taskPath)
{userAgent, taskPath} = process.env handler = null setupGlobals = -> global.attachEvent = -> console = warn: -> emit 'task:warn', arguments... log: -> emit 'task:log', arguments... error: -> emit 'task:error', arguments... trace: -> global.__defineGetter__ 'console', -> console global.document = createElement: -> setAttribute: -> getElementsByTagName: -> [] appendChild: -> documentElement: insertBefore: -> removeChild: -> getElementById: -> {} createComment: -> {} createDocumentFragment: -> {} global.emit = (event, args...) -> process.send({event, args}) global.navigator = {userAgent} global.window = global handleEvents = -> process.on 'uncaughtException', (error) -> console.error(error.message, error.stack) process.on 'message', ({args}) -> isAsync = false async = -> isAsync = true (result) -> emit('task:completed', result) result = handler.bind({async})(args...) emit('task:completed', result) unless isAsync setupGlobals() handleEvents() handler = require(taskPath)
Include stack for uncaught exceptions
Include stack for uncaught exceptions
CoffeeScript
mit
omarhuanca/atom,bencolon/atom,bj7/atom,lovesnow/atom,targeter21/atom,rmartin/atom,jeremyramin/atom,rlugojr/atom,dsandstrom/atom,Jandersolutions/atom,mnquintana/atom,dsandstrom/atom,ilovezy/atom,medovob/atom,helber/atom,florianb/atom,tony612/atom,erikhakansson/atom,beni55/atom,ralphtheninja/atom,AlbertoBarrago/atom,fedorov/atom,Hasimir/atom,ali/atom,chfritz/atom,001szymon/atom,Abdillah/atom,bsmr-x-script/atom,boomwaiza/atom,Ingramz/atom,jacekkopecky/atom,yalexx/atom,abcP9110/atom,bcoe/atom,florianb/atom,chengky/atom,lisonma/atom,codex8/atom,tjkr/atom,bolinfest/atom,alexandergmann/atom,transcranial/atom,mostafaeweda/atom,Shekharrajak/atom,mdumrauf/atom,Arcanemagus/atom,KENJU/atom,KENJU/atom,mdumrauf/atom,targeter21/atom,Jdesk/atom,YunchengLiao/atom,vhutheesing/atom,Ju2ender/atom,hharchani/atom,ilovezy/atom,john-kelly/atom,mertkahyaoglu/atom,alfredxing/atom,scippio/atom,xream/atom,kdheepak89/atom,kandros/atom,CraZySacX/atom,MjAbuz/atom,stinsonga/atom,atom/atom,bcoe/atom,batjko/atom,omarhuanca/atom,g2p/atom,Jdesk/atom,hellendag/atom,fedorov/atom,gzzhanghao/atom,kandros/atom,ardeshirj/atom,YunchengLiao/atom,rookie125/atom,prembasumatary/atom,yamhon/atom,ilovezy/atom,vcarrera/atom,me-benni/atom,rookie125/atom,basarat/atom,medovob/atom,einarmagnus/atom,sillvan/atom,ykeisuke/atom,sebmck/atom,Mokolea/atom,NunoEdgarGub1/atom,kdheepak89/atom,rmartin/atom,devoncarew/atom,BogusCurry/atom,devmario/atom,russlescai/atom,RobinTec/atom,pkdevbox/atom,vhutheesing/atom,Austen-G/BlockBuilder,batjko/atom,ReddTea/atom,FoldingText/atom,gisenberg/atom,DiogoXRP/atom,targeter21/atom,nrodriguez13/atom,pombredanne/atom,vinodpanicker/atom,ali/atom,alexandergmann/atom,Austen-G/BlockBuilder,boomwaiza/atom,vinodpanicker/atom,qiujuer/atom,mnquintana/atom,john-kelly/atom,nucked/atom,yangchenghu/atom,xream/atom,Jdesk/atom,andrewleverette/atom,niklabh/atom,githubteacher/atom,kdheepak89/atom,bcoe/atom,MjAbuz/atom,AlexxNica/atom,lpommers/atom,Dennis1978/atom,isghe/atom,andrewleverette/atom,rsvip/aTom,originye/atom,pombredanne/atom,wiggzz/atom,DiogoXRP/atom,GHackAnonymous/atom,pombredanne/atom,ivoadf/atom,jtrose2/atom,devmario/atom,stuartquin/atom,hellendag/atom,rxkit/atom,yalexx/atom,MjAbuz/atom,Andrey-Pavlov/atom,kjav/atom,sekcheong/atom,codex8/atom,matthewclendening/atom,n-riesco/atom,crazyquark/atom,palita01/atom,Jandersolutions/atom,dkfiresky/atom,Shekharrajak/atom,scv119/atom,mostafaeweda/atom,crazyquark/atom,Andrey-Pavlov/atom,Shekharrajak/atom,tjkr/atom,qskycolor/atom,me6iaton/atom,acontreras89/atom,oggy/atom,pombredanne/atom,splodingsocks/atom,bryonwinger/atom,Abdillah/atom,jacekkopecky/atom,basarat/atom,prembasumatary/atom,batjko/atom,bencolon/atom,amine7536/atom,hagb4rd/atom,GHackAnonymous/atom,liuderchi/atom,helber/atom,charleswhchan/atom,ralphtheninja/atom,Galactix/atom,ppamorim/atom,qiujuer/atom,john-kelly/atom,h0dgep0dge/atom,avdg/atom,splodingsocks/atom,stinsonga/atom,GHackAnonymous/atom,bsmr-x-script/atom,efatsi/atom,jacekkopecky/atom,kevinrenaers/atom,gisenberg/atom,hakatashi/atom,jtrose2/atom,tmunro/atom,john-kelly/atom,scippio/atom,alfredxing/atom,sxgao3001/atom,Neron-X5/atom,Jonekee/atom,bcoe/atom,yomybaby/atom,Hasimir/atom,abe33/atom,gisenberg/atom,sxgao3001/atom,ReddTea/atom,constanzaurzua/atom,Huaraz2/atom,kittens/atom,GHackAnonymous/atom,NunoEdgarGub1/atom,jjz/atom,basarat/atom,kc8wxm/atom,Hasimir/atom,ivoadf/atom,ashneo76/atom,ardeshirj/atom,kittens/atom,charleswhchan/atom,sotayamashita/atom,fedorov/atom,kjav/atom,t9md/atom,jlord/atom,ali/atom,mertkahyaoglu/atom,efatsi/atom,constanzaurzua/atom,Galactix/atom,anuwat121/atom,Neron-X5/atom,yomybaby/atom,nvoron23/atom,burodepeper/atom,originye/atom,rmartin/atom,tmunro/atom,me6iaton/atom,synaptek/atom,boomwaiza/atom,hharchani/atom,PKRoma/atom,Rychard/atom,russlescai/atom,Rodjana/atom,omarhuanca/atom,rjattrill/atom,lisonma/atom,jjz/atom,AdrianVovk/substance-ide,sebmck/atom,Sangaroonaom/atom,decaffeinate-examples/atom,vcarrera/atom,champagnez/atom,rsvip/aTom,johnrizzo1/atom,synaptek/atom,gzzhanghao/atom,jacekkopecky/atom,gontadu/atom,wiggzz/atom,mostafaeweda/atom,ppamorim/atom,liuxiong332/atom,sotayamashita/atom,lpommers/atom,rxkit/atom,mrodalgaard/atom,florianb/atom,pkdevbox/atom,florianb/atom,yalexx/atom,fang-yufeng/atom,fredericksilva/atom,nvoron23/atom,Mokolea/atom,G-Baby/atom,synaptek/atom,deoxilix/atom,dkfiresky/atom,decaffeinate-examples/atom,kaicataldo/atom,liuderchi/atom,amine7536/atom,kc8wxm/atom,Hasimir/atom,lovesnow/atom,harshdattani/atom,h0dgep0dge/atom,codex8/atom,toqz/atom,ReddTea/atom,bolinfest/atom,rookie125/atom,AlisaKiatkongkumthon/atom,ppamorim/atom,nvoron23/atom,Jandersoft/atom,NunoEdgarGub1/atom,originye/atom,bj7/atom,pkdevbox/atom,vinodpanicker/atom,tisu2tisu/atom,Austen-G/BlockBuilder,einarmagnus/atom,KENJU/atom,AdrianVovk/substance-ide,jordanbtucker/atom,Rodjana/atom,xream/atom,targeter21/atom,chengky/atom,bencolon/atom,ali/atom,vjeux/atom,davideg/atom,ilovezy/atom,prembasumatary/atom,transcranial/atom,chengky/atom,Shekharrajak/atom,Locke23rus/atom,n-riesco/atom,Andrey-Pavlov/atom,deepfox/atom,bradgearon/atom,G-Baby/atom,gontadu/atom,paulcbetts/atom,sxgao3001/atom,mostafaeweda/atom,Sangaroonaom/atom,qskycolor/atom,mnquintana/atom,florianb/atom,chfritz/atom,devmario/atom,helber/atom,Klozz/atom,Abdillah/atom,paulcbetts/atom,Galactix/atom,bcoe/atom,basarat/atom,lisonma/atom,jlord/atom,brumm/atom,rlugojr/atom,AdrianVovk/substance-ide,devoncarew/atom,oggy/atom,RobinTec/atom,scv119/atom,fang-yufeng/atom,dijs/atom,acontreras89/atom,ashneo76/atom,constanzaurzua/atom,SlimeQ/atom,fang-yufeng/atom,batjko/atom,johnhaley81/atom,tony612/atom,Galactix/atom,crazyquark/atom,pengshp/atom,AlbertoBarrago/atom,DiogoXRP/atom,bryonwinger/atom,russlescai/atom,ironbox360/atom,yamhon/atom,Jonekee/atom,FIT-CSE2410-A-Bombs/atom,n-riesco/atom,einarmagnus/atom,Neron-X5/atom,toqz/atom,johnrizzo1/atom,fredericksilva/atom,h0dgep0dge/atom,sekcheong/atom,lpommers/atom,hpham04/atom,vinodpanicker/atom,FoldingText/atom,jlord/atom,darwin/atom,stuartquin/atom,hharchani/atom,Ju2ender/atom,mnquintana/atom,tisu2tisu/atom,lovesnow/atom,cyzn/atom,kjav/atom,RuiDGoncalves/atom,lovesnow/atom,abcP9110/atom,FoldingText/atom,seedtigo/atom,Abdillah/atom,Austen-G/BlockBuilder,tanin47/atom,fscherwi/atom,Galactix/atom,Jandersoft/atom,mdumrauf/atom,Abdillah/atom,ReddTea/atom,mertkahyaoglu/atom,liuxiong332/atom,gisenberg/atom,qskycolor/atom,YunchengLiao/atom,jordanbtucker/atom,brumm/atom,hakatashi/atom,001szymon/atom,nvoron23/atom,MjAbuz/atom,qskycolor/atom,brettle/atom,execjosh/atom,ralphtheninja/atom,FoldingText/atom,hellendag/atom,vjeux/atom,dijs/atom,amine7536/atom,devmario/atom,mertkahyaoglu/atom,beni55/atom,wiggzz/atom,burodepeper/atom,decaffeinate-examples/atom,ironbox360/atom,fredericksilva/atom,rsvip/aTom,hakatashi/atom,woss/atom,splodingsocks/atom,erikhakansson/atom,G-Baby/atom,tanin47/atom,Ju2ender/atom,nucked/atom,oggy/atom,Klozz/atom,dsandstrom/atom,YunchengLiao/atom,beni55/atom,ashneo76/atom,qiujuer/atom,yomybaby/atom,ObviouslyGreen/atom,sxgao3001/atom,mostafaeweda/atom,jlord/atom,palita01/atom,gabrielPeart/atom,t9md/atom,basarat/atom,acontreras89/atom,nrodriguez13/atom,kevinrenaers/atom,tony612/atom,fang-yufeng/atom,amine7536/atom,Neron-X5/atom,rmartin/atom,FIT-CSE2410-A-Bombs/atom,h0dgep0dge/atom,rjattrill/atom,kc8wxm/atom,yomybaby/atom,brumm/atom,fedorov/atom,Austen-G/BlockBuilder,hharchani/atom,Rodjana/atom,fang-yufeng/atom,Shekharrajak/atom,champagnez/atom,dkfiresky/atom,Hasimir/atom,batjko/atom,vjeux/atom,yangchenghu/atom,rmartin/atom,Huaraz2/atom,NunoEdgarGub1/atom,RuiDGoncalves/atom,yangchenghu/atom,abcP9110/atom,ardeshirj/atom,ezeoleaf/atom,charleswhchan/atom,jjz/atom,johnrizzo1/atom,kittens/atom,execjosh/atom,gontadu/atom,codex8/atom,panuchart/atom,fredericksilva/atom,bryonwinger/atom,Austen-G/BlockBuilder,kevinrenaers/atom,efatsi/atom,yalexx/atom,elkingtonmcb/atom,avdg/atom,devmario/atom,kaicataldo/atom,SlimeQ/atom,sebmck/atom,ezeoleaf/atom,ivoadf/atom,phord/atom,stuartquin/atom,Jandersolutions/atom,davideg/atom,dannyflax/atom,bryonwinger/atom,davideg/atom,rsvip/aTom,fscherwi/atom,ObviouslyGreen/atom,Ju2ender/atom,acontreras89/atom,davideg/atom,dannyflax/atom,panuchart/atom,rsvip/aTom,svanharmelen/atom,CraZySacX/atom,sebmck/atom,devoncarew/atom,darwin/atom,jtrose2/atom,andrewleverette/atom,me-benni/atom,SlimeQ/atom,me-benni/atom,pengshp/atom,ReddTea/atom,prembasumatary/atom,pengshp/atom,avdg/atom,prembasumatary/atom,mnquintana/atom,woss/atom,tony612/atom,scv119/atom,ppamorim/atom,YunchengLiao/atom,KENJU/atom,vcarrera/atom,qskycolor/atom,hagb4rd/atom,hpham04/atom,brettle/atom,jacekkopecky/atom,Sangaroonaom/atom,nucked/atom,targeter21/atom,kjav/atom,AlexxNica/atom,rjattrill/atom,me6iaton/atom,niklabh/atom,kdheepak89/atom,matthewclendening/atom,bsmr-x-script/atom,ilovezy/atom,PKRoma/atom,kc8wxm/atom,folpindo/atom,vcarrera/atom,fedorov/atom,lisonma/atom,vcarrera/atom,sekcheong/atom,AlisaKiatkongkumthon/atom,mertkahyaoglu/atom,dijs/atom,Jandersoft/atom,liuxiong332/atom,seedtigo/atom,chengky/atom,Andrey-Pavlov/atom,chengky/atom,abe33/atom,einarmagnus/atom,me6iaton/atom,crazyquark/atom,RobinTec/atom,abcP9110/atom,daxlab/atom,lovesnow/atom,AlbertoBarrago/atom,hagb4rd/atom,MjAbuz/atom,CraZySacX/atom,dannyflax/atom,dkfiresky/atom,transcranial/atom,Jandersolutions/atom,toqz/atom,alfredxing/atom,nrodriguez13/atom,brettle/atom,kc8wxm/atom,synaptek/atom,amine7536/atom,ironbox360/atom,yamhon/atom,john-kelly/atom,johnhaley81/atom,tanin47/atom,russlescai/atom,yomybaby/atom,kdheepak89/atom,0x73/atom,mrodalgaard/atom,synaptek/atom,charleswhchan/atom,vjeux/atom,ykeisuke/atom,darwin/atom,ezeoleaf/atom,bolinfest/atom,jacekkopecky/atom,kittens/atom,Ingramz/atom,BogusCurry/atom,Jandersoft/atom,n-riesco/atom,GHackAnonymous/atom,vhutheesing/atom,RuiDGoncalves/atom,pombredanne/atom,ppamorim/atom,kjav/atom,hagb4rd/atom,tony612/atom,dannyflax/atom,kaicataldo/atom,atom/atom,sillvan/atom,Jdesk/atom,me6iaton/atom,FoldingText/atom,fredericksilva/atom,Ingramz/atom,BogusCurry/atom,crazyquark/atom,g2p/atom,daxlab/atom,omarhuanca/atom,omarhuanca/atom,Dennis1978/atom,charleswhchan/atom,kandros/atom,einarmagnus/atom,tjkr/atom,AlisaKiatkongkumthon/atom,scv119/atom,toqz/atom,stinsonga/atom,bradgearon/atom,seedtigo/atom,dannyflax/atom,Andrey-Pavlov/atom,gzzhanghao/atom,hpham04/atom,codex8/atom,isghe/atom,githubteacher/atom,Jonekee/atom,jtrose2/atom,t9md/atom,atom/atom,matthewclendening/atom,constanzaurzua/atom,palita01/atom,execjosh/atom,paulcbetts/atom,decaffeinate-examples/atom,FoldingText/atom,tisu2tisu/atom,gabrielPeart/atom,acontreras89/atom,deepfox/atom,anuwat121/atom,Ju2ender/atom,liuxiong332/atom,SlimeQ/atom,RobinTec/atom,daxlab/atom,qiujuer/atom,ObviouslyGreen/atom,matthewclendening/atom,cyzn/atom,scippio/atom,phord/atom,champagnez/atom,woss/atom,jjz/atom,devoncarew/atom,Klozz/atom,deepfox/atom,niklabh/atom,dkfiresky/atom,Rychard/atom,0x73/atom,woss/atom,isghe/atom,n-riesco/atom,0x73/atom,bj7/atom,ali/atom,oggy/atom,paulcbetts/atom,deoxilix/atom,Locke23rus/atom,ykeisuke/atom,SlimeQ/atom,harshdattani/atom,folpindo/atom,elkingtonmcb/atom,rlugojr/atom,sillvan/atom,fscherwi/atom,NunoEdgarGub1/atom,jordanbtucker/atom,isghe/atom,sekcheong/atom,svanharmelen/atom,devoncarew/atom,sebmck/atom,vinodpanicker/atom,davideg/atom,gisenberg/atom,sillvan/atom,tmunro/atom,Dennis1978/atom,AlexxNica/atom,stinsonga/atom,Arcanemagus/atom,jlord/atom,liuxiong332/atom,hakatashi/atom,toqz/atom,sotayamashita/atom,splodingsocks/atom,lisonma/atom,Huaraz2/atom,deepfox/atom,hpham04/atom,johnhaley81/atom,vjeux/atom,gabrielPeart/atom,cyzn/atom,KENJU/atom,hagb4rd/atom,woss/atom,abe33/atom,chfritz/atom,medovob/atom,anuwat121/atom,001szymon/atom,elkingtonmcb/atom,Neron-X5/atom,jeremyramin/atom,folpindo/atom,liuderchi/atom,erikhakansson/atom,yalexx/atom,FIT-CSE2410-A-Bombs/atom,sillvan/atom,phord/atom,kittens/atom,hpham04/atom,0x73/atom,Jdesk/atom,matthewclendening/atom,isghe/atom,alexandergmann/atom,oggy/atom,ezeoleaf/atom,qiujuer/atom,jtrose2/atom,dsandstrom/atom,RobinTec/atom,githubteacher/atom,rjattrill/atom,panuchart/atom,russlescai/atom,rxkit/atom,deoxilix/atom,Rychard/atom,svanharmelen/atom,sxgao3001/atom,basarat/atom,PKRoma/atom,Locke23rus/atom,abcP9110/atom,nvoron23/atom,dsandstrom/atom,liuderchi/atom,Jandersoft/atom,jjz/atom,Mokolea/atom,burodepeper/atom,bradgearon/atom,Arcanemagus/atom,harshdattani/atom,mrodalgaard/atom,deepfox/atom,Jandersolutions/atom,dannyflax/atom,jeremyramin/atom,sekcheong/atom,hharchani/atom,constanzaurzua/atom,g2p/atom
d64d7ba443c08e03cc9fb760d71e8f3ae10c07e3
t/compiler/harness.coffee
t/compiler/harness.coffee
{Client} = require "mysql" fs = require "fs" context = compiler: require "../../lib/compiler" object: { id: 1, rgt: 1, lft: 2, permalink: "home" } reflector: (callback) -> configuration = JSON.parse fs.readFileSync("#{__dirname}/../../configuration.json", "utf8") mysql = configuration.databases.mysql client = new Client() client.host = mysql.hostname client.user = mysql.user client.password = mysql.password client.database = mysql.name schema = {} client.query """ SELECT columns.* FROM information_schema.tables AS tables JOIN information_schema.columns AS columns USING (table_schema, table_name) WHERE table_type = 'BASE TABLE' AND tables.table_schema = ? """, [ mysql.name ], (error, results, fields) => console.log results if error callback error else for column in results (schema[column.TABLE_NAME] or= []).push(column.COLUMN_NAME) client.destroy() console.log schema callback null, schema module.exports = require("proof") context
{Client} = require "mysql" fs = require "fs" context = compiler: require "../../lib/compiler" object: { id: 1, rgt: 1, lft: 2, permalink: "home" } reflector: (callback) -> configuration = JSON.parse fs.readFileSync("#{__dirname}/../../configuration.json", "utf8") mysql = configuration.databases.mysql client = new Client() client.host = mysql.hostname client.user = mysql.user client.password = mysql.password client.database = mysql.name schema = {} client.query """ SELECT columns.* FROM information_schema.tables AS tables JOIN information_schema.columns AS columns USING (table_schema, table_name) WHERE table_type = 'BASE TABLE' AND tables.table_schema = ? """, [ mysql.name ], (error, results, fields) => if error callback error else for column in results (schema[column.TABLE_NAME] or= []).push(column.COLUMN_NAME) client.destroy() callback null, schema module.exports = require("proof") context
Remove debugging messages for Travis CI.
Remove debugging messages for Travis CI. Removed the debugging messages used to debug the Travis CI build.
CoffeeScript
mit
bigeasy/relatable,bigeasy/relatable
5337f07def498614dbae9245683fff75e22aa296
test/deadline_test.coffee
test/deadline_test.coffee
assert = require 'assertive' Dateline = require '../lib' timekeeper = require 'timekeeper' testNativeMethod = (methodName, dateObj=new Date()) -> it "calls through to native #{methodName} method", -> assert.equal dateObj[methodName](), new Dateline(dateObj)[methodName]() describe 'Dateline', -> before -> timekeeper.freeze(new Date(2013, 1, 1)) after -> timekeeper.reset() describe 'constructor', -> it 'accepts a passed date object', -> expected = new Date(2014, 7, 28, 22, 5) actual = Dateline(expected) assert.equal expected.toDateString(), actual.toDateString() it 'defaults to the current date', -> expected = new Date() assert.equal expected.toDateString(), Dateline().toDateString() describe 'native methods', -> before -> @dl = new Dateline() nativeMethods = [ 'getDate' 'getDay' 'getFullYear' 'getHours' 'getMilliseconds' 'getMinutes' 'getMonth' 'getSeconds' 'getTime' 'getTimezoneOffset' 'getUTCDate' 'getUTCDay' 'getUTCFullYear' 'getUTCHours' 'getUTCMilliseconds' 'getUTCMinutes' 'getUTCMonth' 'getUTCSeconds' 'getYear' ] for method in nativeMethods testNativeMethod(method)
assert = require 'assertive' Dateline = require '../lib' timekeeper = require 'timekeeper' testNativeMethod = (methodName) -> dateObj = new Date() datelineObj = new Dateline(dateObj) it "calls through to native #{methodName} method", -> assert.equal dateObj[methodName](), datelineObj[methodName]() describe 'Dateline', -> before -> timekeeper.freeze(new Date(2013, 1, 1)) after -> timekeeper.reset() describe 'constructor', -> it 'accepts a passed date object', -> expected = new Date(2014, 7, 28, 22, 5) actual = Dateline(expected) assert.equal expected.toDateString(), actual.toDateString() it 'defaults to the current date', -> expected = new Date() assert.equal expected.toDateString(), Dateline().toDateString() describe 'native methods', -> before -> @dl = new Dateline() nativeMethods = [ 'getDate' 'getDay' 'getFullYear' 'getHours' 'getMilliseconds' 'getMinutes' 'getMonth' 'getSeconds' 'getTime' 'getTimezoneOffset' 'getUTCDate' 'getUTCDay' 'getUTCFullYear' 'getUTCHours' 'getUTCMilliseconds' 'getUTCMinutes' 'getUTCMonth' 'getUTCSeconds' 'getYear' ] for method in nativeMethods testNativeMethod(method)
Remove unneeded option from test helper
Remove unneeded option from test helper
CoffeeScript
mit
banterability/dateline
b7d21ef2c484cbbf78cc8d5e52ced27a79d87ebd
scripts/custom.coffee
scripts/custom.coffee
# Description: # Example scripts for you to examine and try out. # # Notes: # They are commented out by default, because most of them are pretty silly and # wouldn't be useful and amusing enough for day to day huboting. # Uncomment the ones you want to try and experiment with. # # These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md module.exports = (robot) -> # robot.hear /badger/i, (res) -> # res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS" # Super simple example: If the robot detects the word "thank you", # it just responds it with "you're welcome". robot.hear /(.*)thank you(.*)/i, (res) -> res.send "you're welcome."
# Description: # Example scripts for you to examine and try out. # # Notes: # They are commented out by default, because most of them are pretty silly and # wouldn't be useful and amusing enough for day to day huboting. # Uncomment the ones you want to try and experiment with. # # These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md module.exports = (robot) -> # robot.hear /badger/i, (res) -> # res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS" # Super simple example: If the robot detects the word "thank you", # it just responds it with "you're welcome". robot.hear /(.*)thank you(.*)/i, (res) -> res.send "you're welcome." robot.hear /(.*)(impossible|impossiburu)(.*)/i, (res) -> imageMe res,'impossiburu', (url) -> msg.send url
Add a method that detects 'impossible/impossiburu'
Add a method that detects 'impossible/impossiburu'
CoffeeScript
mit
pentiumx/hubot-custom
983e5ce539d1716fe5201283c7451a407a2c8637
settings/language-xquery.cson
settings/language-xquery.cson
'.source.xq': 'editor': 'commentStart': '(: ' 'commentEnd': ' :)' 'increaseIndentPattern': '[\\({]\\s*$|<[^>]+>\\s*$|(then|return)\\s*$|let.*:=\\s*$' 'decreaseIndentPattern': '^\\s*</[^>]+>'
'.source.xq': 'editor': 'commentStart': '(: ' 'commentEnd': ' :)' 'increaseIndentPattern': '[\\({]\\s*$|<[^>]+>\\s*$|(then|return)\\s*$|let.*:=\\s*$' 'decreaseIndentPattern': '^\\s*[)}]|^\\s*</[^>]+>'
Add outdent for ) and }
Add outdent for ) and }
CoffeeScript
mit
wolfgangmm/atom-existdb
af03f3c2d056956e78eaf318efe30907c7b531f1
app/assets/javascripts/angular/controllers/result_controller.js.coffee
app/assets/javascripts/angular/controllers/result_controller.js.coffee
angular .module("Poll") .controller "ResultController", ["$scope", "$interval", "Pusher", ($scope, $interval, Pusher) -> $scope.ctx = $('canvas')[0].getContext("2d") $scope.chartData = [] $scope.chartOptions = { responsive: true showTooltips: false } $scope.updateChart = -> $.ajax url: "/#{$scope.question}/results.json" success: (data) -> $scope.$apply -> if $scope.chartData.length != data.length colors = color.randomColors(data.length) $scope.chartData = $.extend true, data, colors else $scope.chartData = $.extend true, $scope.chartData, data total = 0 for datum, index in data total += datum.value console.log "Total = #{total}" if $scope.chart? console.log 'a' for datum, index in data $scope.chart.segments[index].value = datum.value $scope.chart.update() else if total > 0 console.log 'b' $scope.chart = new Chart($scope.ctx).Doughnut($scope.chartData, $scope.chartOptions) $scope.setQuestion = (question) -> $scope.question = question $scope.updateChart() channel = Pusher.subscribe(question) channel.bind "vote", -> $scope.updateChart() ]
angular .module("Poll") .controller "ResultController", ["$scope", "$interval", "Pusher", ($scope, $interval, Pusher) -> $scope.ctx = $('canvas')[0].getContext("2d") $scope.chartData = [] $scope.chartOptions = { responsive: true showTooltips: false animationSteps: 45 } $scope.updateChart = -> $.ajax url: "/#{$scope.question}/results.json" success: (data) -> $scope.$apply -> if $scope.chartData.length != data.length colors = color.randomColors(data.length) $scope.chartData = $.extend true, data, colors else $scope.chartData = $.extend true, $scope.chartData, data total = 0 for datum, index in data total += datum.value console.log "Total = #{total}" if $scope.chart? console.log 'a' for datum, index in data $scope.chart.segments[index].value = datum.value $scope.chart.update() else if total > 0 console.log 'b' $scope.chart = new Chart($scope.ctx).Doughnut($scope.chartData, $scope.chartOptions) $scope.setQuestion = (question) -> $scope.question = question $scope.updateChart() channel = Pusher.subscribe(question) channel.bind "vote", -> $scope.updateChart() ]
Add animationSteps option and set to 45
Add animationSteps option and set to 45
CoffeeScript
mit
maripiyoko/poll,adambutler/poll,maripiyoko/poll,lefred/poll,adambutler/poll,lefred/poll,maripiyoko/poll,adambutler/poll,lefred/poll
b363bfbaaad6ebb4c8e95a2957533dffbf5d218e
app/assets/components/TraceInfo.coffee
app/assets/components/TraceInfo.coffee
import { Component, createElement as $ } from './core' import PropTypes from 'prop-types' export class TraceInfo extends Component @contextTypes = routes: PropTypes.object render: -> { start, application, origin_uuid, origin_url, hostname } = this.props.trace $ 'section', className: 'traceinfo', $ Field, title: 'Started', value: new Date(start) $ Field, title: 'Application', value: application['name'] href: this.context.routes.traces_url(application: application['uuid']) $ Field, title: 'Origin', value: origin_uuid href: origin_url $ Field, title: 'Hostname', value: hostname, href: this.context.routes.traces_url(hostname: hostname) export class Field extends Component render: -> { title, value, href } = this.props if value? value = value.toString() $ 'div', $ 'h4', title do => if value $ 'a', title: value, href: href, value else $ 'a', className: 'empty', '<undefined>'
import { Component, createElement as $ } from './core' import PropTypes from 'prop-types' export class TraceInfo extends Component @contextTypes = routes: PropTypes.object render: -> { start, application, origin, hostname } = this.props.trace $ 'section', className: 'traceinfo', $ Field, title: 'Started', value: new Date(start) $ Field, title: 'Application', value: application['name'] href: this.context.routes.traces_url(application: application['uuid']) $ Field, title: 'Origin', value: origin?['uuid'] href: this.context.routes.traces_url(application: origin['trace']) if origin? $ Field, title: 'Hostname', value: hostname, href: this.context.routes.traces_url(hostname: hostname) export class Field extends Component render: -> { title, value, href } = this.props if value? value = value.toString() $ 'div', $ 'h4', title do => if value $ 'a', title: value, href: href, value else $ 'a', className: 'empty', '<none>'
Fix trace info origin fields
Fix trace info origin fields * Change due to API changes
CoffeeScript
agpl-3.0
jgraichen/mnemosyne-server,jgraichen/mnemosyne-server,jgraichen/mnemosyne-server
9389ebc0fe478db2dc0bddbae72b9e26ebf103e0
test/forecast-test.coffee
test/forecast-test.coffee
chai = require 'chai' sinon = require 'sinon' chai.use require 'sinon-chai' expect = chai.expect describe 'forecast', -> beforeEach -> @robot = respond: sinon.spy() hear: sinon.spy() require('../src/forecast')(@robot) it 'registers a respond listener', -> expect(@robot.respond).to.have.been.calledWith(/hello/) it 'registers a hear listener', -> expect(@robot.hear).to.have.been.calledWith(/orly/)
chai = require 'chai' sinon = require 'sinon' chai.use require 'sinon-chai' expect = chai.expect describe 'forecast', -> beforeEach -> @robot = respond: sinon.spy() hear: sinon.spy() require('../src/forecast')(@robot)
Remove default tests that have no bearing
Remove default tests that have no bearing
CoffeeScript
mit
jeffbyrnes/hubot-forecast
10c3eac35798fdd1bcfd6b1fc896454e8a66dfd6
test/util/data-gen.coffee
test/util/data-gen.coffee
"use strict" ObjectID = require('mongodb').ObjectID Moniker = require('moniker') rand = (min, max) -> Math.floor (Math.random() * (max - min + 1) + min) lisence = [ "CC BY-NC-ND 3.0 NO" "CC BY-NC 3.0 NO" "CC BY-ND 3.0 NO" "CC BY 3.0 NO" ] provider = [ "DNT" "NRK" "TURAPP" ] module.exports = (num) -> now = new Date().getTime() past = now - 100000000000 num = num or 100 ret = [] for i in [1..num] d1 = rand(past, now) d2 = rand(d1, now) ret.push _id: new ObjectID() opprettet: new Date(d1).toISOString() endret: new Date(d2).toISOString() tilbyder: provider[rand(0, provider.length-1)] lisens: lisence[rand(0, lisence.length-1)] navn: Moniker.choose() privat: foo: Moniker.choose() bar: Moniker.choose() ret
"use strict" ObjectID = require('mongodb').ObjectID Moniker = require('moniker') rand = (min, max) -> Math.floor (Math.random() * (max - min + 1) + min) lisence = [ "CC BY-NC-ND 3.0 NO" "CC BY-NC 3.0 NO" "CC BY-ND 3.0 NO" "CC BY 3.0 NO" ] provider = [ "DNT" "NRK" "TURAPP" ] tags = [ 'Sted' 'Hytte' ] module.exports = (num) -> now = new Date().getTime() past = now - 100000000000 num = num or 100 ret = [] for i in [1..num] d1 = rand(past, now) d2 = rand(d1, now) ret.push _id: new ObjectID() opprettet: new Date(d1).toISOString() endret: new Date(d2).toISOString() tilbyder: provider[rand(0, provider.length-1)] lisens: lisence[rand(0, lisence.length-1)] navn: Moniker.choose() tag: [tags[rand(0, tags.length-1)]] privat: foo: Moniker.choose() bar: Moniker.choose() ret
Add tag support to data generator
Add tag support to data generator
CoffeeScript
mit
Turistforeningen/Turbasen,Turbasen/Turbasen
0b462398951a6077ea7f5ecb8ce176567286ba3d
js/libs/placeholder.coffee
js/libs/placeholder.coffee
define [ "outer", "js/vendor/jquery.placeholder" ], () -> $("input, textarea").placeholder()
define [ "js/vendor/jquery.placeholder" ], () -> $("input, textarea").placeholder()
Remove unneeded dependency from Placeholder
Remove unneeded dependency from Placeholder
CoffeeScript
epl-1.0
RayRutjes/frontend,circleci/frontend,circleci/frontend,prathamesh-sonpatki/frontend,circleci/frontend,prathamesh-sonpatki/frontend,RayRutjes/frontend
d9366f34e87c6188eadb01a968bb107011f581f6
Gruntfile.coffee
Gruntfile.coffee
module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: compile: files: 'drop.js': 'drop.coffee' 'docs/welcome/js/welcome.js': 'docs/welcome/coffee/welcome.coffee' watch: coffee: files: ['*.coffee', 'sass/*', 'docs/**/*'] tasks: ['coffee', 'uglify', 'compass'] uglify: drop: src: 'drop.js' dest: 'drop.min.js' options: banner: '/*! drop.js <%= pkg.version %> */\n' compass: dist: options: sassDir: 'sass' cssDir: 'css' welcomeDocs: options: sassDir: 'docs/welcome/sass' cssDir: 'docs/welcome/css' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-compass' grunt.loadNpmTasks 'grunt-bower-task' grunt.registerTask 'default', ['coffee', 'uglify', 'compass', 'bower']
module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: compile: files: 'drop.js': 'drop.coffee' 'docs/welcome/js/welcome.js': 'docs/welcome/coffee/welcome.coffee' watch: coffee: files: ['*.coffee', 'sass/*', 'docs/**/*'] tasks: ['coffee', 'uglify', 'compass'] uglify: drop: src: 'drop.js' dest: 'drop.min.js' options: banner: '/*! drop.js <%= pkg.version %> */\n' compass: dist: options: sassDir: 'sass' cssDir: 'css' welcomeDocs: options: sassDir: 'docs/welcome/sass' cssDir: 'docs/welcome/css' bower: install: options: targetDir: 'deps' cleanup: true layout: 'byComponent' bowerOptions: forceLatest: true production: true grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-compass' grunt.loadNpmTasks 'grunt-bower-task' grunt.registerTask 'default', ['coffee', 'uglify', 'compass', 'bower']
Add bower config to gruntfile
Add bower config to gruntfile
CoffeeScript
mit
chrisdrackett/drop,alihalabyah/drop,dandv/drop,mcanthony/drop,jacemonje/drop,alexananiev/drop,dieface/drop,HubSpot/drop,UmarMughal/drop
a52df404f71e0423130b140275fa7f7546db7203
src/calculator.coffee
src/calculator.coffee
# Description: # Allows Hubot to do mathematics. # # Dependencies: # "mathjs": ">= 0.16.0" # # Configuration: # None # # Commands: # hubot calculate <expression> - Calculate the given math expression. # hubot convert <expression> in <units> - Convert expression to given units. # # Author: # canadianveggie mathjs = require("mathjs")() module.exports = (robot) -> robot.respond /(calc|calculate|calculator|convert|math|maths)( me)? (.*)/i, (msg) -> try msg.send mathjs.eval msg.match[3] catch error msg.send error.message || 'Could not compute.'
# Description: # Allows Hubot to do mathematics. # # Dependencies: # "mathjs": ">= 0.16.0" # # Configuration: # None # # Commands: # hubot calculate <expression> - Calculate the given math expression. # hubot convert <expression> in <units> - Convert expression to given units. # # Author: # canadianveggie mathjs = require("mathjs") module.exports = (robot) -> robot.respond /(calc|calculate|calculator|convert|math|maths)( me)? (.*)/i, (msg) -> try msg.send mathjs.eval msg.match[3] catch error msg.send error.message || 'Could not compute.'
Fix TypeError: object is not a function
Fix TypeError: object is not a function Newer version of mathjs don't return a constructor function anymore, but a singleton.
CoffeeScript
mit
canadianveggie/hubot-calculator,hubot-scripts/hubot-calculator
46f097c81239a59c1485c278a9c0bd843759224e
client/landing/app/CommonViews/linkviews/applinkview.coffee
client/landing/app/CommonViews/linkviews/applinkview.coffee
class AppLinkView extends LinkView constructor:(options = {}, data)-> options.tooltip = title : data.body placement : "above" delayIn : 120 offset : 1 super options, data # FIXME GG, Need to implement AppIsDeleted data.on? "AppIsDeleted", => @destroy() pistachio:-> super "{{#(title)}}" click:-> app = @getData() appManager.tell "Apps", "createContentDisplay", app
class AppLinkView extends LinkView constructor:(options = {}, data)-> super options, data # FIXME something wrong with setTooltip @on "OriginLoadComplete", (data)=> log data @setTooltip title : data.body placement : "above" delayIn : 120 offset : 1 # FIXME GG, Need to implement AppIsDeleted data.on? "AppIsDeleted", => @destroy() pistachio:-> super "{{#(title)}}" click:-> app = @getData() appManager.tell "Apps", "createContentDisplay", app
Update tooltip after loadFromOrigin finished
Update tooltip after loadFromOrigin finished
CoffeeScript
agpl-3.0
acbodine/koding,acbodine/koding,kwagdy/koding-1,cihangir/koding,acbodine/koding,kwagdy/koding-1,jack89129/koding,kwagdy/koding-1,acbodine/koding,usirin/koding,cihangir/koding,andrewjcasal/koding,sinan/koding,szkl/koding,drewsetski/koding,jack89129/koding,mertaytore/koding,koding/koding,usirin/koding,drewsetski/koding,rjeczalik/koding,usirin/koding,koding/koding,andrewjcasal/koding,gokmen/koding,usirin/koding,cihangir/koding,gokmen/koding,rjeczalik/koding,kwagdy/koding-1,drewsetski/koding,rjeczalik/koding,szkl/koding,jack89129/koding,koding/koding,alex-ionochkin/koding,acbodine/koding,koding/koding,cihangir/koding,mertaytore/koding,alex-ionochkin/koding,szkl/koding,jack89129/koding,mertaytore/koding,alex-ionochkin/koding,drewsetski/koding,mertaytore/koding,andrewjcasal/koding,kwagdy/koding-1,mertaytore/koding,drewsetski/koding,jack89129/koding,cihangir/koding,alex-ionochkin/koding,sinan/koding,sinan/koding,szkl/koding,gokmen/koding,andrewjcasal/koding,sinan/koding,koding/koding,alex-ionochkin/koding,gokmen/koding,andrewjcasal/koding,mertaytore/koding,szkl/koding,usirin/koding,koding/koding,usirin/koding,rjeczalik/koding,szkl/koding,szkl/koding,acbodine/koding,rjeczalik/koding,koding/koding,andrewjcasal/koding,andrewjcasal/koding,kwagdy/koding-1,andrewjcasal/koding,sinan/koding,cihangir/koding,sinan/koding,gokmen/koding,alex-ionochkin/koding,drewsetski/koding,acbodine/koding,mertaytore/koding,gokmen/koding,usirin/koding,kwagdy/koding-1,rjeczalik/koding,sinan/koding,acbodine/koding,szkl/koding,sinan/koding,cihangir/koding,drewsetski/koding,jack89129/koding,usirin/koding,koding/koding,cihangir/koding,jack89129/koding,kwagdy/koding-1,gokmen/koding,mertaytore/koding,rjeczalik/koding,rjeczalik/koding,gokmen/koding,jack89129/koding,drewsetski/koding,alex-ionochkin/koding,alex-ionochkin/koding
45873080b39083b5e1214b9a52138944289eb3c5
plugins/pagerduty/index.coffee
plugins/pagerduty/index.coffee
NotificationPlugin = require "../../notification-plugin" class PagerDuty extends NotificationPlugin pagerDutyDetails = (event) -> details = message : event.trigger.message project : event.project.name class : event.error.exceptionClass url : event.error.url stackTrace : event.error.stacktrace details @receiveEvent: (config, event, callback) -> if event.trigger.type == 'projectSpiking' payload = service_key: config.serviceKey event_type: 'trigger' incident_key: event.project.url description: "Spike of #{event.trigger.rate} exceptions/minute in #{event.project.name}" details: pagerDutyDetails(event) else payload = service_key: config.serviceKey event_type: 'trigger' incident_key: event.error.url description: "#{event.error.exceptionClass} in #{event.error.context}" details: pagerDutyDetails(event) # Send the request @request .post('https://events.pagerduty.com/generic/2010-04-15/create_event.json') .timeout(4000) .set('Content-Type', 'application/json') .send(payload) .on "error", (err) -> callback(err) .end (res) -> return callback(res.error) if res.error callback() module.exports = PagerDuty
NotificationPlugin = require "../../notification-plugin" class PagerDuty extends NotificationPlugin pagerDutyDetails = (event) -> details = message : event.trigger.message project : event.project.name class : event.error.exceptionClass url : event.error.url stackTrace : event.error.stacktrace details @receiveEvent: (config, event, callback) -> if event.trigger.type == 'projectSpiking' payload = service_key: config.serviceKey event_type: 'trigger' incident_key: event.project.url description: "Spike of #{event.trigger.rate} exceptions/minute in #{event.project.name}" details: pagerDutyDetails(event) else payload = service_key: config.serviceKey event_type: 'trigger' # Use error url without unique event key to allow pagerduty to de-dupe incident_key: event.error.url.split('?')[0] description: "#{event.error.exceptionClass} in #{event.error.context}" details: pagerDutyDetails(event) # Send the request @request .post('https://events.pagerduty.com/generic/2010-04-15/create_event.json') .timeout(4000) .set('Content-Type', 'application/json') .send(payload) .on "error", (err) -> callback(err) .end (res) -> return callback(res.error) if res.error callback() module.exports = PagerDuty
Allow pagerduty to de-dupe events.
Allow pagerduty to de-dupe events. If the same exception fires many times before a pagerduty incident is resolved then it currently creates multiple pages. This change allows pagerduty to de-dupe and only have one open page based on the grouping in bugsnag. The relevant pagerduty documentation is available here: https://developer.pagerduty.com/documentation/integration/events/trigger
CoffeeScript
mit
6wunderkinder/bugsnag-notification-plugins,korealert/bugsnag-notification-plugins,cagedata/bugsnag-notification-plugins,sharesight/bugsnag-notification-plugins,jacobmarshall/bugsnag-notification-plugins,6wunderkinder/bugsnag-notification-plugins,indirect/bugsnag-notification-plugins,korealert/bugsnag-notification-plugins,kstream001/bugsnag-notification-plugins
b936cddd6db893c74245d534f3e0c08a5b2e503a
menus/merge-conflicts.cson
menus/merge-conflicts.cson
# See https://atom.io/docs/latest/creating-a-package#menus for more details 'context-menu': '.overlayer': 'Enable merge-conflicts': 'merge-conflicts:toggle' 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'merge-conflicts' 'submenu': [ { 'label': 'Toggle', 'command': 'merge-conflicts:toggle' } ] ] } ]
# See https://atom.io/docs/latest/creating-a-package#menus for more details 'context-menu': '.conflicted': 'Resolve: Current': 'merge-conflicts:accept-current' 'Resolve: Ours': 'merge-conflicts:accept-ours' 'Resolve: Theirs': 'merge-conflicts:accept-theirs' 'Resolve: Ours Then Theirs': 'merge-conflicts:ours-then-theirs' 'Resolve: Theirs Then Ours': 'merge-conflicts:theirs-then-ours' 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Merge Conflicts' 'submenu': [ { 'label': 'Detect', 'command': 'merge-conflicts:detect' } ] ] } ]
Add Resolve: entries to the context menu.
Add Resolve: entries to the context menu.
CoffeeScript
mit
smashwilson/merge-conflicts,smashwilson/merge-conflicts,antcodd/merge-conflicts
41c4c260ab8db71eb43c69e733e8cee40e2f91de
test/elvis-backbone-test.coffee
test/elvis-backbone-test.coffee
el = @elvis describe 'el.backbone.model', -> # it 'can handle basic bindings', -> # model = new Backbone.Model(foo: 'bar') # element = el('div', el.bind(model, 'foo')) # expect(element.innerHTML).to.equal('bar') # model.set(foo: 'quux') # expect(element.innerHTML).to.equal('quux') it 'can handle binding in array', -> model = new Backbone.Model(foo: 'bar') element = el('div', [ el.bind(model, 'foo') ]) expect(element.innerHTML).to.equal('bar') model.set(foo: 'quux') expect(element.innerHTML).to.equal('quux') it 'can transform binding value', -> model = new Backbone.Model(foo: 'bar') spy = sinon.spy() element = el('div', [ el.bind(model, 'foo', spy) ]) expect(spy).to.be.calledOnce expect(spy).to.be.calledWith('bar') model.set(foo: 'quux') expect(spy).to.be.calledWith('quux') it 'can bind to attributes', -> model = new Backbone.Model(foo: 'bar') element = el('div', className: el.bind(model, 'foo')) expect(element.className).to.equal('bar') model.set(foo: 'quux') expect(element.className).to.equal('quux')
el = @elvis describe 'el.backbone.model', -> it 'can handle basic bindings', -> model = new Backbone.Model(foo: 'bar') element = el('div', el.bind(model, 'foo')) expect(element.innerHTML).to.equal('bar') model.set(foo: 'quux') expect(element.innerHTML).to.equal('quux') it 'can handle binding in array', -> model = new Backbone.Model(foo: 'bar') element = el('div', [ el.bind(model, 'foo') ]) expect(element.innerHTML).to.equal('bar') model.set(foo: 'quux') expect(element.innerHTML).to.equal('quux') it 'can transform binding value', -> model = new Backbone.Model(foo: 'bar') spy = sinon.spy() element = el('div', [ el.bind(model, 'foo', spy) ]) expect(spy).to.be.calledOnce expect(spy).to.be.calledWith('bar') model.set(foo: 'quux') expect(spy).to.be.calledWith('quux') it 'can bind to attributes', -> model = new Backbone.Model(foo: 'bar') element = el('div', className: el.bind(model, 'foo')) expect(element.className).to.equal('bar') model.set(foo: 'quux') expect(element.className).to.equal('quux')
Enable test for plain argument
Enable test for plain argument
CoffeeScript
isc
myme/elvis
f7e710f8129fd7f6ed3b0322f4c87eb492622d48
app/assets/javascripts/views/components/status-filter-button.component.js.coffee
app/assets/javascripts/views/components/status-filter-button.component.js.coffee
Wheelmap.StatusFilterButtonComponent = Wheelmap.WheelchairPopoverComponent.extend tagName: 'button' classNameBindings: [':btn', 'isActive:active', ':btn-info', 'wheelchair'] wheelchair: null activeFilters: null init: ()-> @_super() popoverOptions: trigger: 'hover' placement: () -> if window.innerWidth <= 767 then 'top' else 'bottom' delay: { show: 400 } container: '#toolbar .status-filter' # Need for not having little spaces between status buttons isActive: (()-> @get('activeFilters').findBy('key', @get('wheelchair'))? ).property('wheelchair', 'activeFilters.@each') wheelchairClass: (()-> 'toolbar-status-filter-icon--' + @get('wheelchair') ).property('wheelchair') click: (event)-> event.preventDefault(); @sendAction('didClick', @get('wheelchair'))
Wheelmap.StatusFilterButtonComponent = Wheelmap.WheelchairPopoverComponent.extend tagName: 'button' classNameBindings: [':btn', 'isActive:active', ':btn-info', 'wheelchair'] wheelchair: null activeFilters: null init: ()-> @_super() popoverOptions: trigger: 'hover' placement: () -> if window.innerWidth <= 767 then 'top' else 'bottom' # Responsivness delay: { show: 400 } container: '.toolbar-status-filter' # Need for not having little spaces between status buttons isActive: (()-> @get('activeFilters').findBy('key', @get('wheelchair'))? ).property('wheelchair', 'activeFilters.@each') wheelchairClass: (()-> 'toolbar-status-filter-icon--' + @get('wheelchair') ).property('wheelchair') click: (event)-> event.preventDefault(); @sendAction('didClick', @get('wheelchair'))
Fix bug where toolbars wheelchair status button tooltips were not displayed.
Fix bug where toolbars wheelchair status button tooltips were not displayed.
CoffeeScript
agpl-3.0
sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap
10de47bef81e961466657ad6505cd92aff3ce98f
atom/config.cson
atom/config.cson
"*": 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" "tree-view" "bookmarks" "autosave" "deprecation-cop" ] projectHome: "~" themes: [ "one-dark-ui" "monokai" ] editor: fontFamily: "Monaco" tabLength: 4 softTabs: false softWrap: true softWrapAtPreferredLineLength: true invisibles: {} autoIndentOnPaste: false welcome: showOnStartup: false linter: showErrorInline: false statusBar: "Show error of the selected line" showInfoMessages: true lintOnChange: false showHighlighting: false autosave: enabled: true script: enableExecTime: false emmet: extensionsPath: "~/.emmet" "linter-jscs": onlyConfig: true preset: "jquery" ".source.viml": editor: commentStart: "\" " ".ini.source": editor: commentStart: "# " ".applescript.source": editor: commentStart: "-- "
"*": 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" "tree-view" "bookmarks" "autosave" "deprecation-cop" "autocomplete-css" "autocomplete-html" "autocomplete-plus" "autocomplete-snippets" "autocomplete-atom-api" ] projectHome: "~" themes: [ "one-dark-ui" "monokai" ] editor: fontFamily: "Monaco" tabLength: 4 softTabs: false softWrap: true softWrapAtPreferredLineLength: true invisibles: {} autoIndentOnPaste: false welcome: showOnStartup: false linter: showErrorInline: false statusBar: "Show error of the selected line" showInfoMessages: true lintOnChange: false showHighlighting: false autosave: enabled: true script: enableExecTime: false emmet: extensionsPath: "~/.emmet" "linter-jscs": onlyConfig: true preset: "jquery" "fuzzy-finder": preserveLastSearch: true ".applescript.source": editor: commentStart: "-- " ".ini.source": editor: commentStart: "# " ".source.viml": editor: commentStart: "\" "
Disable all Atom autocomplete packages
Disable all Atom autocomplete packages
CoffeeScript
mit
caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles
87e47dcda9420107894a87e4355f26e863b8bb2b
atom/keymap.cson
atom/keymap.cson
'atom-workspace': 'ctrl-cmd-r': 'tree-view:reveal-active-file' 'ctrl-cmd-t': 'window:run-package-specs' 'ctrl-shift-alt-t': 'custom:open-todo-list' 'atom-text-editor': 'ctrl-shift-a': 'asciidoc-preview:toggle' '.platform-darwin atom-workspace': 'ctrl-"': 'toggle-quotes:toggle' 'alt-cmd-n': 'advanced-open-file:toggle'
'atom-workspace': 'ctrl-cmd-r': 'tree-view:reveal-active-file' 'ctrl-cmd-t': 'window:run-package-specs' 'ctrl-shift-alt-t': 'custom:open-todo-list' 'atom-text-editor': 'ctrl-shift-a': 'asciidoc-preview:toggle' '.platform-darwin atom-workspace': 'ctrl-"': 'toggle-quotes:toggle' 'alt-cmd-n': 'advanced-open-file:toggle' '.tree-view': 'shift-m': 'chmod:selected-entry'
Add key binding for chmod package
Add key binding for chmod package
CoffeeScript
mit
lee-dohm/dotfiles,lee-dohm/dotfiles,lee-dohm/dotfiles,lee-dohm/dotfiles
7350556d9817db171e31aa3d13d340d699a659f8
app/assets/javascripts/components/overview/inline_users.cjsx
app/assets/javascripts/components/overview/inline_users.cjsx
React = require 'react' EnrollButton = require '../students/enroll_button' InlineUsers = React.createClass( displayName: 'InlineUsers' render: -> key = @props.title + '_' + @props.role last_user_index = @props.users.length - 1 user_list = @props.users.map (user, index) -> link = "https://en.wikipedia.org/wiki/User:#{user.wiki_id}" if user.real_name? extra_info = " (#{user.wiki_id}#{if user.email? then " / " + user.email else ""})" else extra_info = '' extra_info = extra_info + ', ' unless index == last_user_index <span key={user.wiki_id}><a href={link}>{user.wiki_id}</a>{extra_info}</span> user_list = if user_list.length > 0 then user_list else 'None' if @props.users.length > 0 || @props.editable inline_list = <span>{@props.title}: {user_list}</span> allowed = @props.role != 4 || (@props.current_user.role == 4 || @props.current_user.admin) button = <EnrollButton {...@props} users={@props.users} role={@props.role} key={key} inline=true allowed={allowed} show={@props.editable && allowed} /> <p key={key}>{inline_list}{button}</p> ) module.exports = InlineUsers
React = require 'react' EnrollButton = require '../students/enroll_button' InlineUsers = React.createClass( displayName: 'InlineUsers' render: -> key = @props.title + '_' + @props.role last_user_index = @props.users.length - 1 user_list = @props.users.map (user, index) -> link = "https://en.wikipedia.org/wiki/User:#{user.wiki_id}" if user.real_name? extra_info = " (#{user.real_name}#{if user.email? then " / " + user.email else ""})" else extra_info = '' extra_info = extra_info + ', ' unless index == last_user_index <span key={user.wiki_id}><a href={link}>{user.wiki_id}</a>{extra_info}</span> user_list = if user_list.length > 0 then user_list else 'None' if @props.users.length > 0 || @props.editable inline_list = <span>{@props.title}: {user_list}</span> allowed = @props.role != 4 || (@props.current_user.role == 4 || @props.current_user.admin) button = <EnrollButton {...@props} users={@props.users} role={@props.role} key={key} inline=true allowed={allowed} show={@props.editable && allowed} /> <p key={key}>{inline_list}{button}</p> ) module.exports = InlineUsers
Use real name instead of username in parens
Use real name instead of username in parens
CoffeeScript
mit
Wowu/WikiEduDashboard,majakomel/WikiEduDashboard,MusikAnimal/WikiEduDashboard,feelfreelinux/WikiEduDashboard,feelfreelinux/WikiEduDashboard,ragesoss/WikiEduDashboard,MusikAnimal/WikiEduDashboard,sejalkhatri/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,KarmaHater/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,sejalkhatri/WikiEduDashboard,KarmaHater/WikiEduDashboard,alpha721/WikiEduDashboard,WinnySilva/WikiEduDashboard,majakomel/WikiEduDashboard,WinnySilva/WikiEduDashboard,Wowu/WikiEduDashboard,alpha721/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,MusikAnimal/WikiEduDashboard,Wowu/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,ragesoss/WikiEduDashboard,sejalkhatri/WikiEduDashboard,KarmaHater/WikiEduDashboard,MusikAnimal/WikiEduDashboard,sejalkhatri/WikiEduDashboard,WinnySilva/WikiEduDashboard,sejalkhatri/WikiEduDashboard,adamwight/WikiEduDashboard,KarmaHater/WikiEduDashboard,alpha721/WikiEduDashboard,majakomel/WikiEduDashboard,feelfreelinux/WikiEduDashboard,majakomel/WikiEduDashboard,Wowu/WikiEduDashboard,ragesoss/WikiEduDashboard,feelfreelinux/WikiEduDashboard,alpha721/WikiEduDashboard,adamwight/WikiEduDashboard,adamwight/WikiEduDashboard
336bcc2926396c9235968fb456e725c7a4028f54
test/testMount.coffee
test/testMount.coffee
assert = (require 'chai').assert Mount = require '../src/Mount' {Todo, TodoList, NewTodo, TodoApp} = require './fixtures/components' todos = [ { title: 'Go to town' } { title: 'Buy some food' } ] describe 'Mount', -> app = null beforeEach -> elem = document.createElement('div') document.body.appendChild(elem) app = new TodoApp(todos: todos) new Mount(app).mount(elem) describe '.mount', -> it 'mounts component on real dom', -> assert.equal document.querySelectorAll('.todo-title').length, 2 app.todos.push {title: 'hoge'} app.update() assert.equal document.querySelectorAll('.todo-title').length, 3
_ = require 'lodash' assert = (require 'chai').assert Mount = require '../src/Mount' {Todo, TodoList, NewTodo, TodoApp} = require './fixtures/components' todos = [ { title: 'Go to town' } { title: 'Buy some food' } ] todos2 = [ { title: 'foo' } { title: 'bar' } { title: 'baz' } ] describe 'Mount', -> app = null beforeEach -> elem = document.createElement('div') document.body.appendChild(elem) app = new TodoApp(todos: todos) new Mount(app).mount(elem) describe '.mount', -> it 'mounts component on real dom and tracks updates', -> getTodosFromDOM = -> _.pluck(document.querySelectorAll('.todo-title'), 'innerText') assert.deepEqual getTodosFromDOM(), ['Go to town', 'Buy some food'] app.todos = todos2 app.update() assert.deepEqual getTodosFromDOM(), ['foo', 'bar', 'baz'] app.todos = todos app.update() assert.deepEqual getTodosFromDOM(), ['Go to town', 'Buy some food']
Test update tracking of Mount
Test update tracking of Mount
CoffeeScript
mit
seanchas116/decompose
98563dea1131430199ea9ab55a4647828e4c5aae
spec/path-scanner-spec.coffee
spec/path-scanner-spec.coffee
fs = require 'fs' path = require 'path' PathScanner = require '../lib/path-scanner' describe "PathScanner", -> describe "a non-git directory with many files", -> rootPath = fs.realpathSync("spec/fixtures/many-files") it 'lists all non-hidden files', -> scanner = new PathScanner(rootPath) scanner.on('path-found', (pathHandler = jasmine.createSpy())) scanner.on('finished-scanning', (finishedHandler = jasmine.createSpy())) runs -> scanner.scan() waitsFor -> pathHandler.callCount > 0 waitsFor -> finishedHandler.callCount > 0 runs -> expect(scanner.paths.length).toBe 13 expect(scanner.paths).toContain path.join(rootPath, 'file1.txt') expect(scanner.paths).toContain path.join(rootPath, 'dir', 'file7_ignorable.rb')
fs = require 'fs' path = require 'path' PathScanner = require '../lib/path-scanner' describe "PathScanner", -> describe "a non-git directory with many files", -> rootPath = fs.realpathSync("spec/fixtures/many-files") it 'lists all non-hidden files', -> scanner = new PathScanner(rootPath) scanner.on('path-found', (pathHandler = jasmine.createSpy())) scanner.on('finished-scanning', (finishedHandler = jasmine.createSpy())) runs -> scanner.scan() waitsFor -> pathHandler.callCount > 0 waitsFor -> finishedHandler.callCount > 0 runs -> expect(scanner.paths.length).toBe 13 expect(scanner.paths).toContain path.join(rootPath, 'file1.txt') expect(scanner.paths).toContain path.join(rootPath, 'dir', 'file7_ignorable.rb') describe "including file paths", -> it "lists only paths specified by file pattern", -> scanner = new PathScanner(rootPath, inclusions: ['*.js']) scanner.on('finished-scanning', (finishedHandler = jasmine.createSpy())) runs -> scanner.scan() waitsFor -> finishedHandler.callCount > 0 runs -> expect(scanner.paths.length).toBe 2 expect(scanner.paths).toContain path.join(rootPath, 'newdir', 'deep_dir.js') expect(scanner.paths).toContain path.join(rootPath, 'sample.js') dirs = ['dir', 'dir/', 'dir/*'] for dir in dirs it "lists only paths specified in #{dir}", -> scanner = new PathScanner(rootPath, inclusions: [dir]) scanner.on('finished-scanning', (finishedHandler = jasmine.createSpy())) runs -> scanner.scan() waitsFor -> finishedHandler.callCount > 0 runs -> expect(scanner.paths.length).toBe 1 expect(scanner.paths).toContain path.join(rootPath, 'dir', 'file7_ignorable.rb')
Add tests for path inclusion
Add tests for path inclusion
CoffeeScript
mit
pombredanne/scandal,atom/scandal,pombredanne/scandal
cc6141b54a4a94e6a5c8eee3825ec59f982533e9
server/models/entry.coffee
server/models/entry.coffee
mongoose = require 'mongoose' chrono = require 'chrono-node' db = require '../lib/database' Schema = mongoose.Schema entrySchema = new Schema title: type: String required: yes description: String slug: type: String status: type: String enum: ['hidden', 'draft', 'live'] required: yes default: 'draft' lastModified: type: Date publishDate: type: Date default: Date.now createdDate: type: Date default: Date.now author: type: Schema.Types.ObjectId ref: 'User' bucket: type: Schema.Types.ObjectId ref: 'Bucket' keywords: [ type: String ] , strict: no entrySchema.pre 'save', (next) -> @lastModified = Date.now() next() entrySchema.path('publishDate').set (val) -> parsed = chrono.parse(val) if parsed?[0]?.startDate parsed[0].startDate else Date.now() entrySchema.path('description').validate (val) -> val?.length < 140 , 'Descriptions must be less than 140 characters.' entrySchema.set 'toJSON', virtuals: true module.exports = db.model 'Entry', entrySchema
mongoose = require 'mongoose' chrono = require 'chrono-node' db = require '../lib/database' Schema = mongoose.Schema entrySchema = new Schema title: type: String required: yes description: String slug: type: String status: type: String enum: ['hidden', 'draft', 'live', 'pending'] required: yes default: 'draft' lastModified: type: Date publishDate: type: Date default: Date.now createdDate: type: Date default: Date.now author: type: Schema.Types.ObjectId ref: 'User' bucket: type: Schema.Types.ObjectId ref: 'Bucket' keywords: [ type: String ] , strict: no entrySchema.pre 'save', (next) -> @lastModified = Date.now() next() entrySchema.path('publishDate').set (val) -> parsed = chrono.parse(val) if parsed?[0]?.startDate parsed[0].startDate else Date.now() entrySchema.path('description').validate (val) -> val?.length < 140 , 'Descriptions must be less than 140 characters.' entrySchema.set 'toJSON', virtuals: true module.exports = db.model 'Entry', entrySchema
Add pending as a status type
Add pending as a status type
CoffeeScript
agpl-3.0
mikesmithmsm/buckets,edolyne/hive,asm-products/buckets,edolyne/buckets,nishant8BITS/buckets,bucketsio/buckets,artelse/buckets,mamute/buckets,bucketsio/buckets,dut3062796s/buckets,edolyne/hive,asm-products/buckets,artelse/buckets,edolyne/buckets,dut3062796s/buckets,mikesmithmsm/buckets,nishant8BITS/buckets,mamute/buckets
5047ab05393a6a0ac62513f60f1fe85450812cd6
app/assets/javascripts/offline/synchronizer.js.coffee
app/assets/javascripts/offline/synchronizer.js.coffee
Backbone.backendSync = Backbone.sync Backbone.sync = (method, model, options) -> url = _.result(model, 'url') if method is 'read' if navigator.onLine # Store the fetched result also in our local cache Backbone.backendSync(arguments...).then (data) -> localStorage[url] = JSON.stringify(data) else # Return the result from our local cache defer = $.Deferred() data = JSON.parse(localStorage[url]) setTimeout( => defer.resolveWith(this, [data]) 0 ) defer.promise().then (data) -> options.success(data) else Backbone.backendSync(arguments...)
Backbone.backendSync = Backbone.sync Backbone.sync = (method, model, options) -> url = _.result(model, 'url') synclist = JSON.parse(localStorage['toSync'] || '[]') if method is 'read' getData = (method, model, options) -> defer = $.Deferred() if navigator.onLine # Store the fetched result also in our local cache #console.log 'data from backend' Backbone.backendSync(method, model).then (data) -> localStorage[url] = JSON.stringify(data) defer.resolveWith(this, [data]) else #console.log 'data from cache' # Return the result from our local cache data = JSON.parse(localStorage[url]) setTimeout( => defer.resolveWith(this, [data]) 0 ) defer.promise() getData(method, model, options).then (data) -> # synchronize data with synclist for sync in synclist if sync.url is url data.push sync.data options.success(data) else synclist.push { url: url, data: model.toJSON(), method: method } localStorage['toSync'] = JSON.stringify synclist #Backbone.backendSync(arguments...)
Update fetched data with yet to sync data
Update fetched data with yet to sync data
CoffeeScript
mit
matthijsgroen/backbone-offline
d3b152613e96fb27e17074a42b39c106199af1d2
client/landing/app/MainApp/sidebar/groupavatar.coffee
client/landing/app/MainApp/sidebar/groupavatar.coffee
class GroupAvatar extends JView constructor:(options = {}, data)-> options.cssClass = 'group-avatar-drop' groupsController = KD.getSingleton 'groupsController' super options, groupsController.getCurrentGroupData() groupsController.on 'GroupChanged', @bound 'render' render:(slug, group)-> if group @setTooltip title : """You are now in <strong>#{group.title}</strong> group. <br> Click here to see group's homepage""" if slug is 'koding' @$().css backgroundImage : "url(images/logos/50.png)" else @$().css backgroundImage : \ "url(#{group.avatar or 'http://lorempixel.com/60/60/?' + @utils.getRandomNumber()})" click:-> super if KD.config.groupEntryPoint? KD.getSingleton('lazyDomController').showLandingPage()
class GroupAvatar extends JView constructor:(options = {}, data)-> options.cssClass = 'group-avatar-drop hidden' groupsController = KD.getSingleton 'groupsController' super options, groupsController.getCurrentGroupData() groupsController.on 'GroupChanged', @bound 'render' render:(slug, group)-> if group @$().css backgroundImage : \ "url(#{group.avatar or 'http://lorempixel.com/60/60/?' + @utils.getRandomNumber()})" @setTooltip title : """You are now in <strong>#{group.title}</strong> group. <br> Click here to see group's homepage.""" @show() unless slug is 'koding' click:-> super if KD.config.groupEntryPoint? KD.getSingleton('lazyDomController').showLandingPage()
Hide if slug is koding
Hide if slug is koding
CoffeeScript
agpl-3.0
koding/koding,cihangir/koding,acbodine/koding,drewsetski/koding,drewsetski/koding,usirin/koding,drewsetski/koding,szkl/koding,andrewjcasal/koding,acbodine/koding,jack89129/koding,sinan/koding,rjeczalik/koding,cihangir/koding,andrewjcasal/koding,sinan/koding,kwagdy/koding-1,usirin/koding,koding/koding,jack89129/koding,usirin/koding,acbodine/koding,szkl/koding,jack89129/koding,kwagdy/koding-1,rjeczalik/koding,cihangir/koding,gokmen/koding,alex-ionochkin/koding,andrewjcasal/koding,koding/koding,drewsetski/koding,szkl/koding,gokmen/koding,rjeczalik/koding,drewsetski/koding,gokmen/koding,alex-ionochkin/koding,acbodine/koding,mertaytore/koding,koding/koding,usirin/koding,rjeczalik/koding,sinan/koding,gokmen/koding,acbodine/koding,gokmen/koding,sinan/koding,andrewjcasal/koding,kwagdy/koding-1,alex-ionochkin/koding,mertaytore/koding,szkl/koding,koding/koding,gokmen/koding,mertaytore/koding,gokmen/koding,jack89129/koding,acbodine/koding,acbodine/koding,mertaytore/koding,jack89129/koding,andrewjcasal/koding,jack89129/koding,mertaytore/koding,andrewjcasal/koding,alex-ionochkin/koding,cihangir/koding,sinan/koding,rjeczalik/koding,kwagdy/koding-1,usirin/koding,usirin/koding,cihangir/koding,sinan/koding,koding/koding,mertaytore/koding,andrewjcasal/koding,kwagdy/koding-1,sinan/koding,szkl/koding,cihangir/koding,drewsetski/koding,alex-ionochkin/koding,mertaytore/koding,alex-ionochkin/koding,alex-ionochkin/koding,kwagdy/koding-1,drewsetski/koding,sinan/koding,szkl/koding,rjeczalik/koding,cihangir/koding,cihangir/koding,szkl/koding,mertaytore/koding,usirin/koding,kwagdy/koding-1,rjeczalik/koding,koding/koding,gokmen/koding,kwagdy/koding-1,jack89129/koding,jack89129/koding,acbodine/koding,alex-ionochkin/koding,rjeczalik/koding,koding/koding,andrewjcasal/koding,usirin/koding,drewsetski/koding,szkl/koding
93f8bfecd8418617b7ed1c6f4a9bd94cf05c8e1b
cgFileUploadWorker.coffee
cgFileUploadWorker.coffee
uploadChunk = (blob, url, filename, chunk, chunks) -> xhr = new XMLHttpRequest xhr.open 'POST', url, false xhr.onerror = -> throw new Error 'error while uploading' formData = new FormData formData.append 'name', filename formData.append 'chunk', chunk formData.append 'chunks', chunks formData.append 'file', blob xhr.send formData return xhr.responseText @onmessage = (e) -> file = e.data.file url = e.data.url blobs = [] bytes_per_chunk = 1024 * 1024 * 10 # 10MB start = 0 end = bytes_per_chunk size = file.size name = file.name.replace /[^a-zA-Z-_.0-9]/g, '_' while start < size blobs.push file.slice(start, end) start = end end = start + bytes_per_chunk for blob, i in blobs response = uploadChunk(blob, url, name, i, blobs.length) data = message: 'progress' body: ((i + 1) * 100 / blobs.length).toFixed(0) @postMessage data data = message: 'load' body: response @postMessage data
uploadChunk = (blob, url, filename, chunk, chunks) -> xhr = new XMLHttpRequest xhr.open 'POST', url, false xhr.onerror = -> throw new Error 'error while uploading' formData = new FormData formData.append 'name', filename formData.append 'chunk', chunk formData.append 'chunks', chunks formData.append 'file', blob xhr.send formData return xhr.responseText @onmessage = (e) -> file = e.data.file url = e.data.url blobs = [] bytes_per_chunk = 1024 * 1024 * 10 # 10MB start = 0 end = bytes_per_chunk size = file.size name = file.name.replace /[^a-zA-Z-_.0-9]/g, '_' name = "#{ Date.now() }-#{ name }" while start < size blobs.push file.slice(start, end) start = end end = start + bytes_per_chunk for blob, i in blobs response = uploadChunk(blob, url, name, i, blobs.length) data = message: 'progress' body: ((i + 1) * 100 / blobs.length).toFixed(0) @postMessage data data = message: 'load' body: response @postMessage data
Add current timestamp to filename
Add current timestamp to filename
CoffeeScript
mit
Gutenberg-Technology/cg-file-upload
485e74a803ca6f442a6998d2cb11cf16936fdfb1
ObjectLogger.coffee
ObjectLogger.coffee
class ObjectLogger constructor:(@className, @defaultLevel = 'info')-> @log = loglevel.createLogger(@className, @defaultLevel) @callStack = [] @log.enter = @enter.bind(@, 'debug') @log.fineEnter = @enter.bind(@, 'fine') @log.return = @return.bind(@, 'debug') @log.fineReturn = @return.bind(@, 'fine') return @log enter: (level, args...)-> throw new Error ('ObjectLogger: No method name provided to enter') if args.length is 0 methodName = args.shift() @callStack.unshift methodName @log.setPrefix "#{@className}.#{methodName}:" args.unshift 'ENTER' @log[level].apply @log, args return: (level)-> @log[level].call @log, 'RETURN' @callStack.shift() if @callStack.length > 0 methodName = @callStack[0] @log.setPrefix "#{@className}.#{methodName}:"
class ObjectLogger constructor:(@className, @defaultLevel = 'info')-> @log = loglevel.createLogger(@className, @defaultLevel) @callStack = [] @log.enter = @bindMethod(@enter, 'debug') @log.fineEnter = @bindMethod(@enter, 'fine') @log.return = @bindMethod(@return, 'debug') @log.fineReturn = @bindMethod(@return, 'fine') return @log enter: (level, args...)-> throw new Error ('ObjectLogger: No method name provided to enter') if args.length is 0 methodName = args.shift() @callStack.unshift methodName @log.setPrefix "#{@className}.#{methodName}:" args.unshift 'ENTER' @log[level].apply @log, args return: (level)-> @log[level].call @log, 'RETURN' @callStack.shift() if @callStack.length > 0 methodName = @callStack[0] @log.setPrefix "#{@className}.#{methodName}:" bindMethod: (method, level) -> if typeof method.bind == 'function' return method.bind(@, level) else try return Function::bind.call(method, @, level) catch e # Missing bind shim or IE8 + Modernizr, fallback to wrapping console.log 'Missing bind shim or IE8 + Modernizr, fallback to wrapping' return (args...)=> args.unshift(level) Function::apply.apply method, [ @ args ]
Fix method bind problems in phantomjs
Fix method bind problems in phantomjs
CoffeeScript
mit
solderzzc/meteor-loglevel,practicalmeteor/meteor-loglevel
8e34b13c9134137ede7343b7b7be41d475e634e9
app/lib/view-helper.coffee
app/lib/view-helper.coffee
Chaplin = require 'chaplin' # Application-specific view helpers # http://handlebarsjs.com/#helpers # -------------------------------- # Map helpers # ----------- # Make 'with' behave a little more mustachey. Handlebars.registerHelper 'with', (context, options) -> if not context or Handlebars.Utils.isEmpty context options.inverse(this) else options.fn(context) # Inverse for 'with'. Handlebars.registerHelper 'without', (context, options) -> inverse = options.inverse options.inverse = options.fn options.fn = inverse Handlebars.helpers.with.call(this, context, options) # Get Chaplin-declared named routes. {{#url "like" "105"}}{{/url}} Handlebars.registerHelper 'url', (routeName, params..., options) -> Chaplin.helpers.reverse routeName, params Handlebars.registerHelper 'match', (first, second, options) -> if first is second options.fn(this)
Chaplin = require 'chaplin' Handlebars = require 'Handlebars' unless Handlebars? # Application-specific view helpers # http://handlebarsjs.com/#helpers # -------------------------------- # Map helpers # ----------- # Make 'with' behave a little more mustachey. Handlebars.registerHelper 'with', (context, options) -> if not context or Handlebars.Utils.isEmpty context options.inverse(this) else options.fn(context) # Inverse for 'with'. Handlebars.registerHelper 'without', (context, options) -> inverse = options.inverse options.inverse = options.fn options.fn = inverse Handlebars.helpers.with.call(this, context, options) # Get Chaplin-declared named routes. {{#url "like" "105"}}{{/url}} Handlebars.registerHelper 'url', (routeName, params..., options) -> Chaplin.helpers.reverse routeName, params Handlebars.registerHelper 'match', (first, second, options) -> if first is second options.fn(this)
Update view helpers to work with my fixed brunch-handlebars plugin
Update view helpers to work with my fixed brunch-handlebars plugin Fixes handlebars when used with source maps.
CoffeeScript
apache-2.0
despairblue/scegratoo
70388e4686fc5de2f07cabec53571660b91f364f
views/coffee/timer.coffee
views/coffee/timer.coffee
'use strict' @start = (limit) -> window.startDate = new Date().getTime() window.seconds = 0 window.minutes = 0 window.limit = limit window.timerID = setInterval(timeCounter, 1000) return @stop = -> clearInterval timerID return timeCounter = -> if seconds >= limit stop() return time = new Date().getTime() - startDate window.seconds = parseInt(Math.floor(time / 100) / 10) if seconds % 60 == 0 minutes += 1 document.getElementById('seconds').innerHTML = seconds document.getElementById('minutes').innerHTML = minutes return
'use strict' @start = (limit) -> window.startDate = new Date().getTime() window.elapsedSeconds = 0 window.seconds = 0 window.minutes = 0 window.limit = limit window.timerID = setInterval(timeCounter, 1000) return @stop = -> clearInterval timerID return timeCounter = -> if elapsedSeconds >= limit stop() return time = new Date().getTime() - startDate window.elapsedSeconds = parseInt(Math.floor(time / 100) / 10) allTheTime = elapsedSeconds minutes = parseInt(allTheTime/60) allTheTime -= minutes * 60 seconds = parseInt(allTheTime) document.getElementById('seconds').innerHTML = seconds document.getElementById('minutes').innerHTML = minutes return
Set proper value to seconds if it passed 60
Set proper value to seconds if it passed 60
CoffeeScript
mit
aasare/panadora
64e68f4ce34d02059bbf912286b00a23917637ee
js-library/app/js/jail_iframe/classes/notification.coffee
js-library/app/js/jail_iframe/classes/notification.coffee
FactlinkJailRoot.showShouldSelectTextNotification = -> showNotification message: 'To create an annotation, select a statement and click the Factlink button.' type_classes: 'fl-message-icon-add' FactlinkJailRoot.showLoadedNotification = -> showNotification message: 'Factlink is loaded!' type_classes: 'fl-message-icon-time fl-message-success' in_screen_time = 3000 removal_delay = 1000 # Should be larger than notification_transition_time content = """ <div class="fl-message"> <div class="fl-message-icon"></div><span class="fl-message-content fl-js-message"></span> </div> """.trim() showNotification = (options) -> $el = $(content) setMessage = -> $el.find('.fl-js-message').text(options.message) render = -> $el.addClass(options.type_classes) setMessage() FactlinkJailRoot.$factlinkCoreContainer.append($el) positionElement() $el.addClass 'factlink-control-visible' setTimeout(remove, in_screen_time) positionElement = -> $el.css top: '65px', left: '50%', marginLeft: "-#{$el.width()/2}px" remove = -> $el.removeClass 'factlink-control-visible' setTimeout (-> $el.remove()), removal_delay render() return
FactlinkJailRoot.showShouldSelectTextNotification = -> showNotification message: 'To create an annotation, select a statement and click the Factlink button.' type_classes: 'fl-message-icon-add' FactlinkJailRoot.showLoadedNotification = -> showNotification message: 'Factlink is loaded!' type_classes: 'fl-message-icon-time fl-message-success' in_screen_time = 3000 removal_delay = 350 # Should be larger than notification_transition_time content = """ <div class="fl-message"> <div class="fl-message-icon"></div><span class="fl-message-content fl-js-message"></span> </div> """.trim() showNotification = (options) -> $el = $(content) setMessage = -> $el.find('.fl-js-message').text(options.message) render = -> $el.addClass(options.type_classes) setMessage() FactlinkJailRoot.$factlinkCoreContainer.append($el) positionElement() $el.addClass 'factlink-control-visible' setTimeout(remove, in_screen_time) positionElement = -> $el.css top: '65px', left: '50%', marginLeft: "-#{$el.width()/2}px" remove = -> $el.removeClass 'factlink-control-visible' setTimeout (-> $el.remove()), removal_delay render() return
Trim remove_delay down closer to transition duration
Trim remove_delay down closer to transition duration
CoffeeScript
mit
Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core
abd7b983e34929bceb37005f8ab9f92e2df20cb1
src/code/stores/nodes-store.coffee
src/code/stores/nodes-store.coffee
PaletteStore = require './palette-store' GraphStore = require './graph-store' nodeActions = Reflux.createActions( [ "nodesChanged" ] ) nodeStore = Reflux.createStore listenables: [nodeActions] init: -> @nodes = [] @paletteItemHasNodes = false @selectedPaletteItem = null PaletteStore.store.listen @paletteChanged GraphStore.store.listen @graphChanged onNodesChanged: (nodes) -> @nodes = nodes @internalUpdate() graphChanged: (status) -> @nodes = status.nodes @internalUpdate() paletteChanged: -> @selectedPaletteItem = PaletteStore.store.selectedPaletteItem @internalUpdate() internalUpdate: -> @paletteItemHasNodes = false return unless @selectedPaletteItem _.each @nodes, (node) => if node.paletteItemIs @selectedPaletteItem @paletteItemHasNodes = true @notifyChange() notifyChange: -> data = nodes: @nodes paletteItemHasNodes: @paletteItemHasNodes @trigger(data) mixin = getInitialState: -> nodes: nodeStore.nodes paletteItemHasNodes: nodeStore.paletteItemHasNodes componentDidMount: -> nodeStore.listen @onNodesChange onNodesChange: (status) -> @setState # nodes: status.nodes paletteItemHasNodes: status.paletteItemHasNodes module.exports = actions: nodeActions store: nodeStore mixin: mixin
PaletteStore = require './palette-store' GraphActions = require '../actions/graph-actions' nodeActions = Reflux.createActions( [ "nodesChanged" ] ) nodeStore = Reflux.createStore listenables: [nodeActions] init: -> @nodes = [] @paletteItemHasNodes = false @selectedPaletteItem = null PaletteStore.store.listen @paletteChanged GraphActions.graphChanged.listen @graphChanged onNodesChanged: (nodes) -> @nodes = nodes @internalUpdate() graphChanged: (status) -> @nodes = status.nodes @internalUpdate() paletteChanged: -> @selectedPaletteItem = PaletteStore.store.selectedPaletteItem @internalUpdate() internalUpdate: -> @paletteItemHasNodes = false return unless @selectedPaletteItem _.each @nodes, (node) => if node.paletteItemIs @selectedPaletteItem @paletteItemHasNodes = true @notifyChange() notifyChange: -> data = nodes: @nodes paletteItemHasNodes: @paletteItemHasNodes @trigger(data) mixin = getInitialState: -> nodes: nodeStore.nodes paletteItemHasNodes: nodeStore.paletteItemHasNodes componentDidMount: -> nodeStore.listen @onNodesChange onNodesChange: (status) -> @setState # nodes: status.nodes paletteItemHasNodes: status.paletteItemHasNodes module.exports = actions: nodeActions store: nodeStore mixin: mixin
Fix regression: Deleting items from the pallete doesn't replace them.
Fix regression: Deleting items from the pallete doesn't replace them. [#105213716] https://www.pivotaltracker.com/story/show/105213716
CoffeeScript
mit
concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models
132fc488b3ff711a1fff092b81769b6b341c1297
client/Finder/fs/fsfolder.coffee
client/Finder/fs/fsfolder.coffee
class FSFolder extends FSFile fetchContents:(callback, dontWatch=yes)-> { treeController } = @getOptions() @emit "fs.job.started" @vmController.run method : 'fs.readDirectory' vmName : @vmName withArgs : onChange : if dontWatch then null else (change)=> FSHelper.folderOnChange @vmName, @path, change, treeController path : FSHelper.plainPath @path , (err, response)=> if not err and response?.files files = FSHelper.parseWatcher @vmName, @path, response.files, treeController @registerWatcher response @emit "fs.job.finished", err, files else @emit "fs.job.finished", err callback? err, files save:(callback)-> @emit "fs.save.started" @vmController.run vmName : @vmName method : 'fs.createDirectory' withArgs : path : FSHelper.plainPath @path , (err, res)=> if err then warn err @emit "fs.save.finished", err, res callback? err, res saveAs:(callback)-> log 'Not implemented yet.' callback? null remove:(callback)-> @off 'fs.delete.finished' @on 'fs.delete.finished', => return unless finder = KD.getSingleton 'finderController' finder.stopWatching @path super callback, yes registerWatcher:(response)-> {@stopWatching} = response finder = KD.getSingleton 'finderController' return unless finder finder.registerWatcher @path, @stopWatching if @stopWatching
class FSFolder extends FSFile fetchContents:(callback, dontWatch=yes)-> { treeController } = @getOptions() @emit "fs.job.started" @vmController.run method : 'fs.readDirectory' vmName : @vmName withArgs : onChange : if dontWatch then null else (change)=> FSHelper.folderOnChange @vmName, @path, change, treeController path : FSHelper.plainPath @path , (err, response)=> if not err and response?.files files = FSHelper.parseWatcher @vmName, @path, response.files, treeController @registerWatcher response @emit "fs.job.finished", err, files else @emit "fs.job.finished", err callback? err, files save:(callback)-> @emit "fs.save.started" @vmController.run vmName : @vmName method : 'fs.createDirectory' withArgs : path : FSHelper.plainPath @path , (err, res)=> if err then warn err @emit "fs.save.finished", err, res callback? err, res saveAs:(callback)-> log 'Not implemented yet.' callback? null remove:(callback)-> @off 'fs.delete.finished' @on 'fs.delete.finished', => finder = @treeController.delegate finder?.stopWatching @path super callback, yes registerWatcher:(response)-> {@stopWatching} = response finder = @treeController.delegate finder?.registerWatcher @path, @stopWatching if @stopWatching
Use treeController's delegate as FinderController since there is no more FinderController singleton
FSFolder: Use treeController's delegate as FinderController since there is no more FinderController singleton
CoffeeScript
agpl-3.0
jack89129/koding,alex-ionochkin/koding,acbodine/koding,jack89129/koding,gokmen/koding,andrewjcasal/koding,andrewjcasal/koding,szkl/koding,drewsetski/koding,drewsetski/koding,acbodine/koding,usirin/koding,acbodine/koding,szkl/koding,rjeczalik/koding,jack89129/koding,koding/koding,sinan/koding,koding/koding,alex-ionochkin/koding,szkl/koding,drewsetski/koding,cihangir/koding,acbodine/koding,kwagdy/koding-1,cihangir/koding,cihangir/koding,gokmen/koding,sinan/koding,koding/koding,gokmen/koding,cihangir/koding,szkl/koding,szkl/koding,rjeczalik/koding,kwagdy/koding-1,alex-ionochkin/koding,rjeczalik/koding,alex-ionochkin/koding,szkl/koding,rjeczalik/koding,cihangir/koding,gokmen/koding,jack89129/koding,szkl/koding,cihangir/koding,andrewjcasal/koding,koding/koding,mertaytore/koding,drewsetski/koding,drewsetski/koding,szkl/koding,cihangir/koding,jack89129/koding,jack89129/koding,rjeczalik/koding,andrewjcasal/koding,gokmen/koding,sinan/koding,koding/koding,drewsetski/koding,andrewjcasal/koding,alex-ionochkin/koding,usirin/koding,mertaytore/koding,kwagdy/koding-1,kwagdy/koding-1,acbodine/koding,sinan/koding,kwagdy/koding-1,mertaytore/koding,usirin/koding,koding/koding,rjeczalik/koding,jack89129/koding,mertaytore/koding,acbodine/koding,mertaytore/koding,alex-ionochkin/koding,alex-ionochkin/koding,andrewjcasal/koding,acbodine/koding,mertaytore/koding,mertaytore/koding,rjeczalik/koding,mertaytore/koding,gokmen/koding,usirin/koding,usirin/koding,drewsetski/koding,kwagdy/koding-1,acbodine/koding,cihangir/koding,kwagdy/koding-1,sinan/koding,koding/koding,sinan/koding,andrewjcasal/koding,kwagdy/koding-1,gokmen/koding,drewsetski/koding,usirin/koding,sinan/koding,alex-ionochkin/koding,rjeczalik/koding,usirin/koding,gokmen/koding,jack89129/koding,koding/koding,usirin/koding,andrewjcasal/koding,sinan/koding
9c3e7499eefa4d72a7dccc5d1a13aa2bcd7a2563
app/client/questions/questions.coffee
app/client/questions/questions.coffee
Parse = require 'parse' Sort = require 'sortablejs' {updateSortOrder} = require '../../imports/helpers' {Question} = require '../../imports/models' Template.questions.onCreated -> @fetched = new ReactiveVar false @survey = @data.survey @questions = @data.questions @form = @data.form instance = @ @form.getQuestions(true, @questions).then (questions) -> instance.fetched.set true instance.questions = questions Template.questions.onRendered -> instance = @ instance.autorun -> if instance.fetched.get() and instance.questions?.findOne() Meteor.defer -> Sort.create questionList, handle: '.sortable-handle' onSort: (event) -> updateSortOrder event, instance.form, 'questions' Template.questions.helpers surveyId: -> Template.instance().survey.id formId: -> Template.instance().form.id hasQuestions: -> Template.instance().questions?.findOne() questions: -> Template.instance().questions?.find {}, sort: {order: 1} Template.questions.events 'click .delete': (event, instance) -> query = new Parse.Query Question query.get(@parseId).then (question) => question.destroy().then () => instance.questions.remove @_id
Sort = require 'sortablejs' {updateSortOrder} = require '../../imports/helpers' {Question} = require '../../imports/models' Template.questions.onCreated -> @fetched = new ReactiveVar false @survey = @data.survey @questions = @data.questions @form = @data.form instance = @ @form.getQuestions(true, @questions).then (questions) -> instance.fetched.set true instance.questions = questions Template.questions.onRendered -> instance = @ instance.autorun -> if instance.fetched.get() and instance.questions?.findOne() Meteor.defer -> Sort.create questionList, handle: '.sortable-handle' onSort: (event) -> updateSortOrder event, instance.form, 'questions' Template.questions.helpers surveyId: -> Template.instance().survey.id formId: -> Template.instance().form.id hasQuestions: -> Template.instance().questions?.findOne() questions: -> Template.instance().questions?.find {}, sort: {order: 1} Template.questions.events 'click .delete': (event, instance) -> query = new Parse.Query Question query.get(@parseId).then (question) => question.destroy().then () => instance.questions.remove @_id
Remove required Parse causing error on question delete
Remove required Parse causing error on question delete
CoffeeScript
apache-2.0
ecohealthalliance/mobile-survey,ecohealthalliance/mobile-survey,ecohealthalliance/mobile-survey
17dcc919d04d11c2415f93bc4e85e83bbf74608f
test/javascripts/paper_test.coffee
test/javascripts/paper_test.coffee
#= require test_helper emq.globalize() ETahi.setupForTesting() ETahi.injectTestHelpers() ETahi.Resolver = Ember.DefaultResolver.extend namespace: ETahi setResolver ETahi.Resolver.create() ETahi.setupForTesting() moduleForModel 'paper', 'Unit: Paper Model' moduleForModel 'user', 'Unit: User Model' test 'displayTitle displays short title if title is missing', -> paper = @subject title: '' shortTitle: 'test short title' displayTitle = paper.get('displayTitle') equal displayTitle, 'test short title'
#= require test_helper emq.globalize() ETahi.injectTestHelpers() ETahi.Resolver = Ember.DefaultResolver.extend namespace: ETahi setResolver ETahi.__container__ ETahi.setupForTesting() moduleForModel 'paper', 'Unit: Paper Model', needs: ['model:user', 'model:declaration', 'model:figure', 'model:journal', 'model:phase'] test 'displayTitle displays short title if title is missing', -> debugger paper = @subject title: '' shortTitle: 'test short title' equal paper.get('displayTitle'), 'test short title' paper.setProperties title: 'Hello world' equal paper.get('displayTitle'), 'Hello world'
Use preferred way of testing computed properties
Use preferred way of testing computed properties
CoffeeScript
mit
johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi
aa162766accd13dd961eeb08638ba7d85b65e92c
src/index.coffee
src/index.coffee
require 'postmortem/register' path = require 'path' # Ensure local node_modules bin is on the front of $PATH binPath = path.join process.cwd(), 'node_modules/', '.bin' process.env.PATH = ([binPath].concat process.env.PATH.split ':').join ':' global.cp = require './cp' global.exec = require 'executive' global.invoke = require './invoke' global.running = require './running' global.task = require './task' global.tasks = require './tasks' global.use = require './use' module.exports = cp: cp exec: exec invoke: invoke running: running task: task tasks: tasks use: use
require 'postmortem/register' require 'vigil' path = require 'path' # Ensure local node_modules bin is on the front of $PATH binPath = path.join process.cwd(), 'node_modules/', '.bin' process.env.PATH = ([binPath].concat process.env.PATH.split ':').join ':' global.cp = require './cp' global.exec = require 'executive' global.invoke = require './invoke' global.running = require './running' global.task = require './task' global.tasks = require './tasks' global.use = require './use' global.walk = vigil.walk global.watch = vigil.watch module.exports = cp: cp exec: exec invoke: invoke running: running task: task tasks: tasks use: use
Add default walk and watch options.
Add default walk and watch options.
CoffeeScript
mit
zeekay/shortcake
b93d666f2b1d5f699287dfe37d69fdbd2e53fac2
atom/.atom/config.cson
atom/.atom/config.cson
"*": "atom-beautify": analytics: false "autocomplete-plus": autoActivationDelay: 150 core: telemetryConsent: "no" themes: [ "atom-dark-ui" "atom-dark-syntax" ] editor: fontSize: 12 invisibles: {} showIndentGuide: true showInvisibles: true "exception-reporting": userId: "f8b42441-9e5a-b0a5-3076-474dbe6b2797" "gist-it": newGistsDefaultToPrivate: true linter: errorPanelHeight: 160 showErrorPanel: false "linter-flake8": ignoreErrorCodes: [ "E128" "E501" ] "linter-pydocstyle": ignoreCodes: "D100,D101,D102,D103,D104,D105" "linter-ui-default": {} welcome: showOnStartup: false
"*": "atom-beautify": analytics: false "autocomplete-plus": autoActivationDelay: 150 core: telemetryConsent: "no" themes: [ "atom-dark-ui" "atom-dark-syntax" ] editor: fontSize: 12 preferredLineLength: 79 invisibles: {} showIndentGuide: true showInvisibles: true "exception-reporting": userId: "f8b42441-9e5a-b0a5-3076-474dbe6b2797" "gist-it": newGistsDefaultToPrivate: true linter: errorPanelHeight: 160 showErrorPanel: false "linter-flake8": ignoreErrorCodes: [ "E128" "E501" ] "linter-pydocstyle": ignoreCodes: "D100,D101,D102,D103,D104,D105" "linter-ui-default": {} welcome: showOnStartup: false
Set line length to 79 (per PEP8)
Set line length to 79 (per PEP8) Feel the :heart: @jianbin-wei
CoffeeScript
mit
jeffwidman/dotfiles
e6ee0dd1b58bc8d779d6803e463d9182276c535e
test/js/totodoo.coffee
test/js/totodoo.coffee
selenium = require 'selenium-webdriver' chai = require 'chai' chai.use require 'chai-as-promised' expect = chai.expect before -> @driver = new selenium.Builder() .withCapabilities(selenium.Capabilities.phantomjs()) .build() @driver.getWindowHandle() after -> @driver.quit() describe 'Totodoo App', -> @timeout 30000 beforeEach -> @driver.get 'http://127.0.0.1/' it 'has the title of the application in the window\'s title', (done) -> expect(@driver.getTitle()).to.eventually.contain 'Totodoo - Sample todo application with StormPath user management service' @timeout 10000, done()
selenium = require 'selenium-webdriver' chai = require 'chai' chai.use require 'chai-as-promised' expect = chai.expect before -> @driver = new selenium.Builder() .withCapabilities(selenium.Capabilities.phantomjs()) .build() @driver.getWindowHandle() after -> @driver.quit() describe 'Totodoo App', -> @timeout 12000 beforeEach -> @driver.get 'http://127.0.0.1/' describe 'Init', -> it 'has the title of the application in the window\'s title', (done) -> expect(@driver.getTitle()).to.eventually.contain 'Totodoo - Sample todo application with StormPath user management service' @timeout 4000, done()
Revert to the last working test
Revert to the last working test
CoffeeScript
mit
markomanninen/totodoo,markomanninen/totodoo
0055911af6f40f3d2ad75b8d4fe6661ffabf801d
app/coffee/filters/common.coffee
app/coffee/filters/common.coffee
angular.module('greenmine.filters.common', []). filter('onlyVisible', -> return (input) -> return _.filter input, (item) -> return item.__hidden != true ). filter('truncate', -> return (input, num) -> num = 25 if num == undefined return _.str.prune(input, num) ). filter('slugify', -> return (input) -> return _.str.slugify(input) ). filter("momentFormat", -> return (input, format) -> return moment(input).format(format) ). filter("lowercase", -> return (input) -> if input return input.toLowerCase() return "" )
angular.module('greenmine.filters.common', []). filter('onlyVisible', -> return (input) -> return _.filter input, (item) -> return item.__hidden != true ). filter('truncate', -> return (input, num) -> num = 25 if num == undefined return _.str.prune(input, num) ). filter('slugify', -> return (input) -> return _.str.slugify(input) ). filter("momentFormat", -> return (input, format) -> return moment(input).format(format) ). filter("lowercase", -> return (input) -> if input return input.toLowerCase() return "" ) OnlyVisibleFilter = -> return (input) -> return _.filter input, (item) -> return item.__hidden != true TruncateFilter = -> return (input, num) -> num = 25 if num is undefined return _.str.prune(input, num) SlugifyFilter = -> return (input) -> return _.str.slugify(input)
Add partial refactor of filters.
Add partial refactor of filters.
CoffeeScript
agpl-3.0
taigaio/taiga-front-old
ac984e5d8c6dab3a387202651f613c185d568194
gulp/helper/child_process.coffee
gulp/helper/child_process.coffee
gutil = require 'gulp-util' child_process = require 'child_process' module.exports = (name, command, callback = ->) -> child_process.exec( command (error, stdout, stderr) -> if error and error.code customError = message: "Failed: #{name}" gutil.log stdout gutil.log stderr gutil.log gutil.colors.red error gutil.log gutil.colors.red customError.message gutil.beep() if process.env.NODE_ENV isnt 'workstation' process.exit 1 else callback() else gutil.log stdout gutil.log stderr gutil.log gutil.colors.green "Finished: #{name}" callback() )
gutil = require 'gulp-util' child_process = require 'child_process' module.exports = (name, command, callback = ->) -> child_process.exec( command (error, stdout, stderr) -> if error and error.code customError = message: "Failed: #{name}" gutil.log stdout gutil.log stderr gutil.log gutil.colors.red error gutil.log gutil.colors.red customError.message gutil.beep() if process.env.CI process.exit 1 else callback() else gutil.log stdout gutil.log stderr gutil.log gutil.colors.green "Finished: #{name}" callback() )
Change ci-env-detection from "workstation" to "CI"
Change ci-env-detection from "workstation" to "CI"
CoffeeScript
mit
efacilitation/eventric
0b5d70f645b56d7c98c0c067fc80cdc3ea7a3e78
app/assets/javascripts/active_admin/lib/per_page.js.coffee
app/assets/javascripts/active_admin/lib/per_page.js.coffee
class ActiveAdmin.PerPage constructor: (@options, @element)-> @$element = $(@element) @_init() @_bind() _init: -> @$params = @_queryParams() _bind: -> @$element.change => @$params['per_page'] = @$element.val() delete @$params['page'] location.search = $.param(@$params) _queryParams: -> query = window.location.search.substring(1) params = {} re = /([^&=]+)=([^&]*)/g while m = re.exec(query) params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]) params $.widget.bridge 'perPage', ActiveAdmin.PerPage $ -> $('.pagination_per_page select').perPage()
class ActiveAdmin.PerPage constructor: (@options, @element)-> @$element = $(@element) @_init() @_bind() _init: -> @$params = @_queryParams() _bind: -> @$element.change => @$params['per_page'] = @$element.val() delete @$params['page'] location.search = $.param(@$params) _queryParams: -> query = window.location.search.substring(1) params = {} re = /([^&=]+)=([^&]*)/g while m = re.exec(query) params[@_decode(m[1])] = @_decode(m[2]) params _decode: (value) -> #replace "+" before decodeURIComponent decodeURIComponent(value.replace(/\+/g, '%20')) $.widget.bridge 'perPage', ActiveAdmin.PerPage $ -> $('.pagination_per_page select').perPage()
Remove plus sign (+) in URL query string while per_page switching
Remove plus sign (+) in URL query string while per_page switching
CoffeeScript
mit
Davidzhu001/activeadmin,hyperoslo/activeadmin,quikly/active_admin,gogovan/activeadmin,mediebruket/activeadmin,siutin/activeadmin,hobbes37/activeadmin,mateusg/active_admin,Davidzhu001/activeadmin,wspurgin/activeadmin,vraravam/activeadmin,hiroponz/activeadmin,quikly/active_admin,krautcomputing/activeadmin,jclay/active_admin,yijiasu/activeadmin,scarver2/activeadmin,scarver2/activeadmin,maysam/activeadmin,bolshakov/activeadmin,javierjulio/activeadmin,ishumilova/activeadmin,waymondo/active_admin,ampinog/activeadmin,yeti-switch/active_admin,MohamedHegab/activeadmin,sanyaade-iot/activeadmin,mynksngh/activeadmin,Ryohu/activeadmin,dhartoto/activeadmin,halilim/activeadmin,timoschilling/activeadmin,vytenis-s/activeadmin,rubixware/activeadmin,yijiasu/activeadmin,totzyuta/activeadmin,zfben/activeadmin,westonplatter/activeadmin,Andrekra/activeadmin,dannyshafer/activeadmin,seanski/activeadmin,vytenis-s/activeadmin,lampo/activeadmin,iuriandreazza/activeadmin,Skulli/activeadmin,bloomrain/activeadmin,deivid-rodriguez/activeadmin,activeadmin/activeadmin,ishumilova/activeadmin,lampo/activeadmin,varyonic/activeadmin,sharma1nitish/activeadmin,davydovanton/activeadmin,gogovan/activeadmin,chrisseldo/activeadmin,chdem/activeadmin,sanyaade-iot/activeadmin,JeffreyATW/activeadmin,shishir127/activeadmin,siutin/activeadmin,senid231/activeadmin,FundingGates/activeadmin,mauriciopasquier/active_admin,saiqulhaq/activeadmin,iuriandreazza/activeadmin,dannyshafer/activeadmin,yeti-switch/active_admin,bolshakov/activeadmin,Amandeepsinghghai/activeadmin,presskey/activeadmin,danielevans/activeadmin,chdem/activeadmin,Ibotta/activeadmin,vytenis-s/activeadmin,beyondthestory/activeadmin,mynksngh/activeadmin,mohitnatoo/activeadmin,seanski/activeadmin,maysam/activeadmin,whatcould/active_admin,maysam/activeadmin,Pollywog23/activeadmin,totzyuta/activeadmin,Ryohu/activeadmin,shishir127/activeadmin,strivedi183/activeadmin,saveav/activeadmin,iuriandreazza/activeadmin,timoschilling/activeadmin,Some1Else/activeadmin,FundingGates/activeadmin,buren/activeadmin,Skulli/activeadmin,hobbes37/activeadmin,timoschilling/activeadmin,varyonic/activeadmin,Some1Else/activeadmin,bcavileer/activeadmin,mrjman/activeadmin,getkiwicom/activeadmin,hyperoslo/activeadmin,mauriciopasquier/active_admin,whatcould/active_admin,artofhuman/activeadmin,dalegregory/activeadmin,danielevans/activeadmin,rtrepo/activeadmin,chrisseldo/activeadmin,javierjulio/activeadmin,zfben/activeadmin,rtrepo/activeadmin,whatcould/active_admin,getkiwicom/activeadmin,mediebruket/activeadmin,MohamedHegab/activeadmin,mateusg/active_admin,javierjulio/activeadmin,vraravam/activeadmin,JeffreyATW/activeadmin,beyondthestory/activeadmin,bcavileer/activeadmin,iguchi1124/activeadmin,iguchi1124/activeadmin,saveav/activeadmin,h2ocube/active_admin,vraravam/activeadmin,senid231/activeadmin,yeti-switch/active_admin,mwlang/active_admin,dannyshafer/activeadmin,krautcomputing/activeadmin,mauriciopasquier/active_admin,iuriandreazza/activeadmin,keichan34/active_admin,getkiwicom/activeadmin,quikly/active_admin,dalegregory/activeadmin,bolshakov/activeadmin,artofhuman/activeadmin,mateusg/active_admin,Ibotta/activeadmin,applexiaohao/activeadmin,saiqulhaq/activeadmin,saveav/activeadmin,waymondo/active_admin,halilim/activeadmin,iuriandreazza/activeadmin,alonerage/activeadmin,tjgrathwell/activeadmin,dhartoto/activeadmin,mynksngh/activeadmin,activeadmin/activeadmin,hobbes37/activeadmin,sharma1nitish/activeadmin,rubixware/activeadmin,tjgrathwell/activeadmin,westonplatter/activeadmin,cmunozgar/activeadmin,ishumilova/activeadmin,mrjman/activeadmin,Some1Else/activeadmin,adibsaad/activeadmin,bloomrain/activeadmin,applexiaohao/activeadmin,ampinog/activeadmin,deivid-rodriguez/activeadmin,mwlang/active_admin,beyondthestory/activeadmin,dhartoto/activeadmin,hiroponz/activeadmin,shishir127/activeadmin,westonplatter/activeadmin,artofhuman/activeadmin,Davidzhu001/activeadmin,jethroo/activeadmin,bloomrain/activeadmin,adibsaad/activeadmin,mediebruket/activeadmin,buren/activeadmin,danielevans/activeadmin,thomascarterx/activeadmin,totzyuta/activeadmin,thomascarterx/activeadmin,jclay/active_admin,sharma1nitish/activeadmin,davydovanton/activeadmin,adibsaad/activeadmin,deivid-rodriguez/activeadmin,SoftSwiss/active_admin,chdem/activeadmin,Amandeepsinghghai/activeadmin,wspurgin/activeadmin,activeadmin/activeadmin,Pollywog23/activeadmin,Amandeepsinghghai/activeadmin,Skulli/activeadmin,halilim/activeadmin,FundingGates/activeadmin,buren/activeadmin,ampinog/activeadmin,cmunozgar/activeadmin,keichan34/active_admin,cmunozgar/activeadmin,h2ocube/active_admin,chrisseldo/activeadmin,davydovanton/activeadmin,Andrekra/activeadmin,wspurgin/activeadmin,mohitnatoo/activeadmin,Ibotta/activeadmin,alonerage/activeadmin,yijiasu/activeadmin,siutin/activeadmin,sanyaade-iot/activeadmin,applexiaohao/activeadmin,seanski/activeadmin,rtrepo/activeadmin,lampo/activeadmin,scarver2/activeadmin,JeffreyATW/activeadmin,hiroponz/activeadmin,strivedi183/activeadmin,jclay/active_admin,strivedi183/activeadmin,varyonic/activeadmin,rubixware/activeadmin,saiqulhaq/activeadmin,senid231/activeadmin,SoftSwiss/active_admin,Andrekra/activeadmin,waymondo/active_admin,mohitnatoo/activeadmin,krautcomputing/activeadmin,mrjman/activeadmin,Ryohu/activeadmin,keichan34/active_admin,iuriandreazza/activeadmin,gogovan/activeadmin,jethroo/activeadmin,presskey/activeadmin,tjgrathwell/activeadmin,dalegregory/activeadmin,bcavileer/activeadmin,MohamedHegab/activeadmin,iuriandreazza/activeadmin,zfben/activeadmin,Pollywog23/activeadmin,mwlang/active_admin,jethroo/activeadmin,hyperoslo/activeadmin,alonerage/activeadmin,presskey/activeadmin,SoftSwiss/active_admin,thomascarterx/activeadmin,iguchi1124/activeadmin,h2ocube/active_admin
0778ea6367432c64c6beef4a1cb047305fe1a0f5
keymaps/rubocop.cson
keymaps/rubocop.cson
# 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://atom.io/docs/latest/behind-atom-keymaps-in-depth 'atom-text-editor': 'ctrl-shift-a': 'rubocop:autocorrect-current-file'
# 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://atom.io/docs/latest/behind-atom-keymaps-in-depth 'atom-text-editor': 'alt-shift-a': 'rubocop:autocorrect-current-file'
Change default shortcut to 'alt-shift-a'
Change default shortcut to 'alt-shift-a'
CoffeeScript
mit
asux/atom-rubocop
6aba7bb3557975045e90b4a36f0f8f7cd795c91a
static/scripts/models.coffee
static/scripts/models.coffee
define ['angular', 'underscore', 'underscoreString'], (angular, _, _s) -> _.mixin _s.exports() module = angular.module 'coviolations.models', [] getTaskModel = ($http) -> class Tasks ### Tasks model ### constructor: (@limit=20, @options={}) -> @items = [] @canLoad = true @offset = 0 load: (callback=->@) -> if @canLoad $http.get(@getUrl()).success (data) => @onLoaded(data, callback) @offset += @limit getUrl: -> base = [ '/api/v1/tasks/task/', '?limit=', @limit, '&offset=', @offset, ] @addOption base, 'withViolations', 'with_violations' @addOption base, 'self' @addOption base, 'project' @addOption base, 'branch' base.join('') addOption: (base, option, uriName=option) -> if @options[option] base.push _.sprintf '&%s=', uriName base.push @options[option] onLoaded: (data, callback) -> _.each data.objects, (item) => @items.push @prepareItem item if data.meta.total_count <= @offset @canLoad = false callback.call @ prepareItem: (item) -> item.created = item.created.replace('T', ' ').slice(0, -7) item module.factory 'Tasks', getTaskModel getTaskModel: getTaskModel
define ['angular', 'underscore', 'underscoreString'], (angular, _, _s) -> _.mixin _s.exports() module = angular.module 'coviolations.models', [] getTaskModel = ($http) -> class Tasks ### Tasks model ### constructor: (@limit=20, @options={}) -> @items = [] @canLoad = true @offset = 0 @loadLock = false load: (callback=->@) -> if @canLoad if @loadLock setTimeout 100, => @load(callback) else @loadLock = true $http.get(@getUrl()).success (data) => @onLoaded(data, callback) @loadLock = false @offset += @limit getUrl: -> base = [ '/api/v1/tasks/task/', '?limit=', @limit, '&offset=', @offset, ] @addOption base, 'withViolations', 'with_violations' @addOption base, 'self' @addOption base, 'project' @addOption base, 'branch' base.join('') addOption: (base, option, uriName=option) -> if @options[option] base.push _.sprintf '&%s=', uriName base.push @options[option] onLoaded: (data, callback) -> _.each data.objects, (item) => @items.push @prepareItem item if data.meta.total_count <= @offset @canLoad = false callback.call @ prepareItem: (item) -> item.created = item.created.replace('T', ' ').slice(0, -7) item module.factory 'Tasks', getTaskModel getTaskModel: getTaskModel
Add lock for preventing concurrent tasks loading
Add lock for preventing concurrent tasks loading
CoffeeScript
mit
nvbn/coviolations_web,nvbn/coviolations_web
3814491cf299bb1cc14b1cc13149dd7d8c850a7a
coffee/db/mongo.coffee
coffee/db/mongo.coffee
EventEmitter = require('events').EventEmitter MongoClient = require('mongodb').MongoClient inherits = require('util').inherits Mongo = (uri) -> EventEmitter.call @ new MongoClient.connect uri, (err, database) => throw err if err @db = database for col in ['arrangementer', 'bilder', 'grupper', 'områder', 'turer', 'steder'] @[col] = @db.collection col @emit 'ready' @ inherits Mongo, EventEmitter module.exports = new Mongo(process.env.MONGO_URI)
EventEmitter = require('events').EventEmitter MongoClient = require('mongodb').MongoClient inherits = require('util').inherits Mongo = (uri) -> EventEmitter.call @ new MongoClient.connect uri, (err, database) => throw err if err @db = database for col in ['arrangementer', 'bilder', 'grupper', 'områder', 'turer', 'steder', 'api.users'] @[col] = @db.collection col @emit 'ready' @ inherits Mongo, EventEmitter module.exports = new Mongo(process.env.MONGO_URI)
Add short hand for api.user collection
Add short hand for api.user collection
CoffeeScript
mit
Turbasen/Turbasen,Turistforeningen/Turbasen
039fe78abc52dbf57a03126a9b3d18a1683496b2
app/src/controllers/update/update_index_view_controller.coffee
app/src/controllers/update/update_index_view_controller.coffee
class @UpdateIndexViewController extends @UpdateViewController navigation: nextRoute: "/update/seed" previousRoute: "/onboarding/device/plug" previousParams: {animateIntro: no} localizablePageSubtitle: "update.index.important_notice" navigatePrevious: -> ledger.app.setExecutionMode(ledger.app.Modes.Wallet) super
class @UpdateIndexViewController extends @UpdateViewController navigation: nextRoute: "/update/seed" #previousRoute: "/onboarding/device/plug" previousParams: {animateIntro: no} localizablePageSubtitle: "update.index.important_notice" navigatePrevious: -> ledger.app.setExecutionMode(ledger.app.Modes.Wallet) super
Hide previous button in update index view controller
Hide previous button in update index view controller
CoffeeScript
mit
Morveus/ledger-wallet-doge-chrome,LedgerHQ/ledger-wallet-chrome,LedgerHQ/ledger-wallet-chrome,Morveus/ledger-wallet-doge-chrome
18277bbc94774f58ba185c6d13a661fb6ff07156
core/app/backbone/views/evidence/evidence_bottom_view.coffee
core/app/backbone/views/evidence/evidence_bottom_view.coffee
class window.EvidenceBottomView extends Backbone.Marionette.ItemView className: 'evidence-bottom bottom-base' template: 'facts/bottom_base' triggers: 'click .js-sub-comments-link': 'toggleSubCommentsList' ui: subCommentsLink: '.js-sub-comments-link' subCommentsContainer: '.js-sub-comments-container' initialize: -> @count = 0 @bindTo @model, 'change', @render, @ templateHelpers: -> showTime: false showRepost: false showShare: false showSubComments: true showDiscussion: -> Factlink.Global.signed_in && @fact_base? showFactInfo: -> @fact_base?.scroll_to_link? fact_url_host: -> new Backbone.Factlink.Url(@fact_url).host() if @fact_url? onRender: -> @bindTo @model, 'change:sub_comments_count', @updateSubCommentsLink, @ @updateSubCommentsLink() updateSubCommentsLink: -> @count = @model.get('sub_comments_count') if @count > 0 @ui.subCommentsContainer.show() @ui.subCommentsLink.text "Comments (#{@count})" else if Factlink.Global.signed_in @ui.subCommentsContainer.show() @ui.subCommentsLink.text "Comments" else @ui.subCommentsContainer.hide()
class window.EvidenceBottomView extends Backbone.Marionette.ItemView className: 'evidence-bottom bottom-base' template: 'facts/bottom_base' triggers: 'click .js-sub-comments-link': 'toggleSubCommentsList' ui: subCommentsLink: '.js-sub-comments-link' subCommentsContainer: '.js-sub-comments-container' initialize: -> @count = 0 @bindTo @model, 'change', @render, @ templateHelpers: -> showTime: false showRepost: false showShare: false showSubComments: true showDiscussion: -> Factlink.Global.signed_in && @fact_base? showFactInfo: -> @fact_base?.scroll_to_link? fact_url_host: -> new Backbone.Factlink.Url(@fact_url).host() if @fact_url? onRender: -> @bindTo @model, 'change:sub_comments_count', @updateSubCommentsLink, @ @updateSubCommentsLink() updateSubCommentsLink: -> @count = @model.get('sub_comments_count') if @count > 0 @ui.subCommentsContainer.removeClass 'hide' @ui.subCommentsLink.text "Comments (#{@count})" else if Factlink.Global.signed_in @ui.subCommentsContainer.removeClass 'hide' @ui.subCommentsLink.text "Comments" else @ui.subCommentsContainer.addClass 'hide'
Use css class 'hide' instead of jQuery show/hide methods to prevent jQuery weirdness.
Use css class 'hide' instead of jQuery show/hide methods to prevent jQuery weirdness.
CoffeeScript
mit
daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core
4b7f8ba8820cc315596c45909ec69630d1688a81
components/DispatchAction.coffee
components/DispatchAction.coffee
noflo = require 'noflo' findHandler = (actionParts, routes) -> normalized = routes.map (route) -> if route.indexOf('*') is -1 # No wildcards here return route routeParts = route.split ':' for part, idx in routeParts continue unless part is '*' continue unless actionParts[idx] routeParts[idx] = actionParts[idx] return routeParts.join ':' return normalized.indexOf actionParts.join(':') exports.getComponent = -> c = new noflo.Component c.inPorts.add 'routes', datatype: 'string' required: true control: true c.inPorts.add 'in', datatype: 'all' c.outPorts.add 'pass', datatype: 'all' c.outPorts.add 'handle', datatype: 'all' addressable: true c.outPorts.add 'handling', datatype: 'integer' c.process (input, output) -> return unless input.hasData 'routes', 'in' [routes, data] = input.getData 'routes', 'in' unless data?.action output.done new Error 'No action provided in payload' return handled = routes.split ',' handler = findHandler data.action.split(':'), handled if handler is -1 output.sendDone pass: data return output.send handling: handler output.send handle: new noflo.IP 'data', data, index: handler output.done()
noflo = require 'noflo' findHandler = (actionParts, routes) -> normalized = routes.map (route) -> if route.indexOf('*') is -1 # No wildcards here return route routeParts = route.split ':' for part, idx in routeParts continue unless part is '*' continue unless actionParts[idx] routeParts[idx] = actionParts[idx] return routeParts.join ':' return normalized.indexOf actionParts.join(':') exports.getComponent = -> c = new noflo.Component c.inPorts.add 'routes', datatype: 'string' required: true control: true c.inPorts.add 'in', datatype: 'all' c.outPorts.add 'pass', datatype: 'all' c.outPorts.add 'handle', datatype: 'all' addressable: true c.outPorts.add 'handling', datatype: 'integer' c.process (input, output) -> return unless input.hasData 'routes', 'in' [routes, data] = input.getData 'routes', 'in' unless data?.action output.sendDone pass: data return handled = routes.split ',' handler = findHandler data.action.split(':'), handled if handler is -1 output.sendDone pass: data return output.send handling: handler output.send handle: new noflo.IP 'data', data, index: handler output.done()
Send all unhandled to PASS port
Send all unhandled to PASS port
CoffeeScript
mit
noflo/noflo-ui,noflo/noflo-ui
f7e68d87183e1a80c891e9deb40cd6936d6cc0ca
app/controllers/sessions.coffee
app/controllers/sessions.coffee
module.exports = new: (req, res) -> res.render('sessions/new') create: (passport) -> -> passport.authenticate 'local', successRedirect: '/' failureRedirect: '/login' successFlash: 'You have successfully logged in!' failureFlash: true destroy: (req, res) -> req.logout() req.flash 'info', 'You have successfully logged out!' res.redirect '/'
module.exports = new: (req, res) -> res.render('sessions/new') create: (passport) -> -> passport.authenticate 'local', successRedirect: '/' failureRedirect: '/login' successFlash: 'You have successfully logged in!' failureFlash: true destroy: (req, res) -> req.logout() req.flash 'info', 'You have successfully logged out!' res.redirect '/login'
Fix redirect path after loggin out
Fix redirect path after loggin out
CoffeeScript
mit
webzepter/node-tt
88256918ae1c1eae4310e2d058b9bb2a5d37453d
app/coffee/DockerRunner.coffee
app/coffee/DockerRunner.coffee
spawn = require("child_process").spawn logger = require "logger-sharelatex" Settings = require "settings-sharelatex" module.exports = DockerRunner = _docker: Settings.clsi?.docker?.binary or 'docker' _baseCommand: ['run', '--rm=true', '-t', '-v', '$COMPILE_DIR:/source', '--name=texlive-$PROJECT_ID'] run: (project_id, command, directory, timeout, callback = (error) ->) -> logger.log project_id: project_id, command: command, directory: directory, "running docker command" if command[0] != 'latexmk' throw 'Invalid command' docker_cmd = (arg.replace('$COMPILE_DIR', directory).replace('$PROJECT_ID', project_id) \ for arg in DockerRunner._baseCommand) docker_cmd.push Settings.clsi?.docker?.image or "texlive" docker_cmd = docker_cmd.concat (arg.replace('$COMPILE_DIR', '/source') for arg in command.slice(1)) proc = spawn DockerRunner._docker, docker_cmd, stdio: "inherit", cwd: directory timer = setTimeout () -> logger.warn "timeout achieved, stopping docker instance" proc = spawn 'docker', ['stop', "texlive-#{project_id}"] proc.on "close", -> callback timedout: true , (timeout ?= 30) * 1000 proc.on "close", () -> clearTimeout timer callback()
spawn = require("child_process").spawn logger = require "logger-sharelatex" Settings = require "settings-sharelatex" module.exports = DockerRunner = _docker: Settings.clsi?.docker?.binary or 'docker' _baseCommand: ['run', '--rm=true', '-t', '-v', '$COMPILE_DIR:/source', '--name=texlive-$PROJECT_ID'] run: (project_id, command, directory, timeout, callback = (error) ->) -> logger.log project_id: project_id, command: command, directory: directory, "running docker command" if command[0] != 'latexmk' throw 'Invalid command' docker_cmd = (arg.replace('$COMPILE_DIR', directory).replace('$PROJECT_ID', project_id) \ for arg in DockerRunner._baseCommand) docker_cmd.push Settings.clsi?.docker?.image or "texlive" docker_cmd = docker_cmd.concat (arg.replace('$COMPILE_DIR', '/source') for arg in command.slice(1)) proc = spawn DockerRunner._docker, docker_cmd, stdio: "inherit", cwd: directory timer = setTimeout () -> logger.warn "timeout achieved, stopping docker instance" proc = spawn 'docker', ['stop', "texlive-#{project_id}"] proc.on "close", -> callback timedout: true , timeout proc.on "close", () -> clearTimeout timer callback()
Revert the timeout change in the docker runner
Revert the timeout change in the docker runner Revert the timeout change in the docker runner as the conversion from seconds to milliseconds as well as the default timeout are already handled in the Request parser.
CoffeeScript
agpl-3.0
EDP-Sciences/clsi-sharelatex
9852cc2c9e4adb6593f5b0dcdd632399c3b1d6b4
Source/ExpectedWrite.coffee
Source/ExpectedWrite.coffee
# @Compiler-Output "../Dist/ExceptedWrite.js" EventEmitter = require('events').EventEmitter Promise = require('a-promise') Buffer = require('buffer').Buffer class ExpectedWrite extends EventEmitter constructor: (@stream) -> super @status = true @expected = null @callback = null @data = stdout: new Buffer("", "utf8"), stderr: new Buffer("", "utf8") @stream.on 'close', => @emit('end') if @stream.stdout @stream.stdout.on 'data', (data) => @data.stdout = Buffer.concat([@data.stdout, data]) else @stream.on 'data', (data) => @data.stdout = Buffer.concat([@data.stdout, data]) @stream.stderr.on 'data', (data) => @data.stderr = Buffer.concat([@data.stderr, data]) onEnd: -> return new Promise (Resolve)=> if @status @once('end', Resolve) else Resolve() module.exports = ExpectedWrite
# @Compiler-Output "../Dist/ExceptedWrite.js" EventEmitter = require('events').EventEmitter Promise = require('a-promise') Buffer = require('buffer').Buffer class ExpectedWrite extends EventEmitter constructor: (@stream) -> super @status = true @expected = null @callback = null @data = stdout: '', stderr: '' @stream.on 'close', => @emit('end') if @stream.stdout @stream.stdout.on 'data', (data) => @data.stdout += data else @stream.on 'data', (data) => @data.stdout += data @stream.stderr.on 'data', (data) => @data.stderr += data onEnd: -> return new Promise (Resolve)=> if @status @once('end', Resolve) else Resolve() module.exports = ExpectedWrite
Use raw strings instead of buffers
:art: Use raw strings instead of buffers
CoffeeScript
mit
steelbrain/node-ssh
4a48109e1628995d10740ee359aaa52b0d7dd1f9
app/server/js/react/app.coffee
app/server/js/react/app.coffee
goog.provide 'server.react.App' class server.react.App ###* @constructor ### constructor: -> {html,head,meta,title,link,body} = React.DOM @create = React.createClass render: -> html lang: 'en', head null, meta charSet: 'utf-8' meta name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' title null, this.props.title link href: '/app/client/img/favicon.ico', rel: 'shortcut icon' link href: '/app/client/build/app.css?v=' + this.props.version, rel: 'stylesheet' # TODO(steida): Base64 inline. link href: 'http://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin,latin-ext', rel: 'stylesheet' body dangerouslySetInnerHTML: __html: this.props.bodyHtml
goog.provide 'server.react.App' class server.react.App ###* @constructor ### constructor: -> {html,head,meta,title,link,body} = React.DOM @create = React.createClass render: -> html lang: 'en', head null, meta charSet: 'utf-8' # NOTE(steida): http://www.mobilexweb.com/blog/ios-7-1-safari-minimal-ui-bugs meta name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimal-ui, maximum-scale=1.0, user-scalable=no' title null, this.props.title link href: '/app/client/img/favicon.ico', rel: 'shortcut icon' link href: '/app/client/build/app.css?v=' + this.props.version, rel: 'stylesheet' # TODO(steida): Base64 inline. link href: 'http://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin,latin-ext', rel: 'stylesheet' body dangerouslySetInnerHTML: __html: this.props.bodyHtml
Add minimal-ui for iOS Safari.
Add minimal-ui for iOS Safari.
CoffeeScript
mit
steida/songary
f20be1deef998ae8e66646b9c5a44e30826f83e4
app/middlewares/auth.coffee
app/middlewares/auth.coffee
module.exports = isLoggedIn: (req, res, next) -> if req.user next() else req.flash 'error', 'You must be logged in!' res.redirect '/login' isNotLoggedIn: (req, res, next) -> if req.user req.flash 'error', 'You are already logged in!' res.redirect '/' else next()
module.exports = isLoggedIn: (req, res, next) -> if req.isAuthenticated() next() else req.flash 'error', 'You must be logged in!' res.redirect '/login' isNotLoggedIn: (req, res, next) -> if req.isAuthenticated() req.flash 'error', 'You are already logged in!' res.redirect '/' else next()
Replace property with method to improve intelligibility
Replace property with method to improve intelligibility
CoffeeScript
mit
webzepter/node-tt
b21c678e93aad97b8c939f741b30fd9ebfff44e0
lib/status-bar-view.coffee
lib/status-bar-view.coffee
{_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback)
{_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> atom.rootView.statusBar = this @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback)
Add itself as a global on rootView
Add itself as a global on rootView
CoffeeScript
mit
pombredanne/status-bar,TShapinsky/status-bar,mertkahyaoglu/status-bar,ali/status-bar,devoncarew/status-bar,Abdillah/status-bar
65701ccd46dd2d0f86fee8ccf03e73c9dbf5580d
client/templates/results/chart/chart.js.coffee
client/templates/results/chart/chart.js.coffee
Template.chart.helpers nonNumberDataColumnSpec: -> for spec in @header.slice(1) if spec.chartType isnt "number" return spec reactivityHack: -> _.defer => $chart = $(".chart[data-id='" + @_id + "']") $chart.empty() $chartContainer = $("<div class='chart-container'></div>") $chart.append($chartContainer) data = new google.visualization.DataTable() for spec in @header # if @output is "rwstats" and spec.isPercentage # continue data.addColumn(spec.chartType, i18n.t("rwcut.fields." + spec.name)) data.addRows(@rows) chart = new google.visualization[@chartType]($chartContainer.get(0)) chart.draw(data, curveType: "function" vAxis: logScale: true ) Template.chart.rendered = -> Template.chart.events # "click .selector": (event, template) ->
Template.chart.helpers nonNumberDataColumnSpec: -> for spec in @header.slice(1) if spec.chartType isnt "number" return spec reactivityHack: -> _.defer => $chart = $(".chart[data-id='" + @_id + "']") $chart.empty() $chartContainer = $("<div class='chart-container'></div>") $chart.append($chartContainer) data = new google.visualization.DataTable() for spec in @header if @output is "rwstats" and (spec.isPercentage or spec.name is "cumul_%") continue data.addColumn(spec.chartType, i18n.t("rwcut.fields." + spec.name)) for row in @rows values = [] for value, index in row spec = @header[index] if @output is "rwstats" and (spec.isPercentage or spec.name is "cumul_%") continue values.push(value) data.addRow(values) chart = new google.visualization[@chartType]($chartContainer.get(0)) chart.draw(data, curveType: "function" vAxis: logScale: true ) Template.chart.rendered = -> Template.chart.events # "click .selector": (event, template) ->
Remove percentage values from chart output
Remove percentage values from chart output
CoffeeScript
agpl-3.0
rbouqueau/FlowBAT,rbouqueau/FlowBAT,rbouqueau/FlowBAT,chrissanders/FlowBAT,chrissanders/FlowBAT,chrissanders/FlowBAT
3be298d96e76f171d231e28269ec8a23902abe54
server/controllers/deploy.coffee
server/controllers/deploy.coffee
AppConfig = require('../initializers/config') Deploy = require('../lib/deploy') range_check = require('range_check') tagRefersToServer = (tag, serverName) -> return new RegExp("^#{serverName}").test(tag) getIpFromRequest = (req) -> req.connection.remoteAddress GITHUB_IP_RANGE = "192.30.252.0/22" ipIsFromGithub = (ip) -> range_check.in_range(ip, GITHUB_IP_RANGE) exports.index = (req, res) -> remoteIp = getIpFromRequest(req) envIsNotDevelopment = process.env.NODE_ENV isnt 'development' if !ipIsFromGithub(remoteIp) and envIsNotDevelopment return res.send 401 parsedPayload = req.body console.log "Got deploy message from #{parsedPayload.ref}" serverName = AppConfig.get('server_name') tagName = parsedPayload.ref unless tagRefersToServer(tagName, serverName) errMessage = "Only deploys for this server (#{serverName}) are accepted" console.log errMessage return res.send 500, errMessage console.log "Updating code from #{tagName}..." Deploy.deploy(tagName).then(-> console.log "Code update finished, restarting server" process.exit() ).catch((err)-> console.log "Error updating code:" console.error err ) res.send 200
AppConfig = require('../initializers/config') Deploy = require('../lib/deploy') range_check = require('range_check') tagRefersToServer = (tag, serverName) -> return new RegExp("^#{serverName}").test(tag) getIpFromRequest = (req) -> req.connection.remoteAddress GITHUB_IP_RANGE = "192.30.252.0/22" ipIsFromGithub = (ip) -> range_check.in_range(ip, GITHUB_IP_RANGE) exports.index = (req, res) -> remoteIp = getIpFromRequest(req) env = process.env.NODE_ENV env ||= 'development' if env isnt 'development' return res.send 401 unless ipIsFromGithub(remoteIp) parsedPayload = req.body console.log "Got deploy message from #{parsedPayload.ref}" serverName = AppConfig.get('server_name') tagName = parsedPayload.ref unless tagRefersToServer(tagName, serverName) errMessage = "Only deploys for this server (#{serverName}) are accepted" console.log errMessage return res.send 500, errMessage console.log "Updating code from #{tagName}..." Deploy.deploy(tagName).then(-> console.log "Code update finished, restarting server" process.exit() ).catch((err)-> console.log "Error updating code:" console.error err ) res.send 200
Make "don't check github ip in development" work
Make "don't check github ip in development" work
CoffeeScript
bsd-3-clause
unepwcmc/NRT,unepwcmc/NRT
e59dc2a922034dc5b618c039b41d00791603e58b
app/assets/javascripts/components/truncate_text.js.coffee
app/assets/javascripts/components/truncate_text.js.coffee
Hummingbird.TruncateTextComponent = Ember.Component.extend expanded: false isTruncated: (-> @get('text').length > @get('length') + 10 ).property('text', 'length') truncatedText: (-> if @get('isTruncated') and not @get('expanded') jQuery.trim(@get('text')).substring(0, @get('length')).trim(this) + "..." else @get('text') ).property('text', 'length', 'expanded') actions: toggleExpansion: -> @toggleProperty 'expanded'
Hummingbird.TruncateTextComponent = Ember.Component.extend expanded: false isTruncated: (-> @get('text').length > @get('length') + 10 ).property('text', 'length') truncatedText: (-> if @get('isTruncated') and not @get('expanded') jQuery.trim(@get('text')).substring(0, @get('length')).trim(this) + "…" else @get('text') ).property('text', 'length', 'expanded') actions: toggleExpansion: -> @toggleProperty 'expanded'
Use actual ellipsis unicode character for truncation.
Use actual ellipsis unicode character for truncation.
CoffeeScript
apache-2.0
Snitzle/hummingbird,qgustavor/hummingbird,erengy/hummingbird,vevix/hummingbird,erengy/hummingbird,hummingbird-me/hummingbird,cybrox/hummingbird,paladique/hummingbird,saintsantos/hummingbird,wlads/hummingbird,jcoady9/hummingbird,qgustavor/hummingbird,saintsantos/hummingbird,MiLk/hummingbird,jcoady9/hummingbird,xhocquet/hummingbird,MiLk/hummingbird,jcoady9/hummingbird,Snitzle/hummingbird,astraldragon/hummingbird,hummingbird-me/hummingbird,jcoady9/hummingbird,xhocquet/hummingbird,astraldragon/hummingbird,paladique/hummingbird,NuckChorris/hummingbird,Snitzle/hummingbird,Snitzle/hummingbird,wlads/hummingbird,erengy/hummingbird,sidaga/hummingbird,wlads/hummingbird,synthtech/hummingbird,saintsantos/hummingbird,vevix/hummingbird,sidaga/hummingbird,xhocquet/hummingbird,paladique/hummingbird,sidaga/hummingbird,astraldragon/hummingbird,NuckChorris/hummingbird,MiLk/hummingbird,paladique/hummingbird,saintsantos/hummingbird,sidaga/hummingbird,xhocquet/hummingbird,synthtech/hummingbird,astraldragon/hummingbird,erengy/hummingbird,qgustavor/hummingbird,wlads/hummingbird,xhocquet/hummingbird,vevix/hummingbird,NuckChorris/hummingbird,NuckChorris/hummingbird,MiLk/hummingbird,xhocquet/hummingbird,xhocquet/hummingbird,vevix/hummingbird,qgustavor/hummingbird
2c3fc0795c013ca255a4c5d25539df8fd8154833
lib/path_finder.coffee
lib/path_finder.coffee
path = require 'path' fs = require 'fs-plus' _ = require 'underscore-plus' module.exports = class PathFinder railsRootPathChildren: ['app', 'config', 'lib'] ignores: /(?:\/.git\/|\.keep$|\.DS_Store$|\.eot$|\.otf$|\.ttf$|\.woff$|\.png$|\.svg$|\.jpg$|\.gif$|\.mp4$|\.eps$|\.psd$)/ constructor: (currentPath) -> @railsRootPath = @getRailsRootPath(currentPath) getPathes: (key) -> return [] unless @railsRootPath pathes = [] for relativeRootPath in atom.config.get("rails-finder.#{key}Pathes") rootPath = path.join(@railsRootPath, relativeRootPath) appendPathes = _.filter(fs.listTreeSync(rootPath), (candidatePath) => fs.isFileSync(candidatePath) && !@ignores.test(candidatePath) ) pathes = pathes.concat(appendPathes) return _.uniq(pathes) getRailsRootPath: (currentPath) -> candidatePath = path.dirname(currentPath) while candidatePath != '/' candidatePath = path.resolve(path.join(candidatePath, '..')) children = _.map(fs.listSync(candidatePath), (child) -> path.basename(child) ) isRailsRootPath = _.all(@railsRootPathChildren, (railsRootPathChild)-> _.contains(children, railsRootPathChild) ) if isRailsRootPath return candidatePath return atom.project.rootDirectories[0].path
path = require 'path' fs = require 'fs-plus' _ = require 'underscore-plus' module.exports = class PathFinder railsRootPathChildren: ['app', 'config', 'lib'] ignores: /(?:\/.git\/|\.(?:git)?keep$|\.DS_Store$|\.eot$|\.otf$|\.ttf$|\.woff$|\.png$|\.svg$|\.jpg$|\.gif$|\.mp4$|\.eps$|\.psd$)/ constructor: (currentPath) -> @railsRootPath = @getRailsRootPath(currentPath) getPathes: (key) -> return [] unless @railsRootPath pathes = [] for relativeRootPath in atom.config.get("rails-finder.#{key}Pathes") rootPath = path.join(@railsRootPath, relativeRootPath) appendPathes = _.filter(fs.listTreeSync(rootPath), (candidatePath) => fs.isFileSync(candidatePath) && !@ignores.test(candidatePath) ) pathes = pathes.concat(appendPathes) return _.uniq(pathes) getRailsRootPath: (currentPath) -> candidatePath = path.dirname(currentPath) while candidatePath != '/' candidatePath = path.resolve(path.join(candidatePath, '..')) children = _.map(fs.listSync(candidatePath), (child) -> path.basename(child) ) isRailsRootPath = _.all(@railsRootPathChildren, (railsRootPathChild)-> _.contains(children, railsRootPathChild) ) if isRailsRootPath return candidatePath return atom.project.rootDirectories[0].path
Fix tiny bug in ignores
Fix tiny bug in ignores
CoffeeScript
mit
negipo/rails-finder
36be656c6271caec841bc1c57b98c6d3c3b1ea73
app/utils/location.coffee
app/utils/location.coffee
`import Ember from 'ember'` Location = Ember.HistoryLocation.extend init: -> @_super.apply this, arguments if auth = @get('auth') # location's getURL is first called before we even # get to routes, so autoSignIn won't be called in # such case auth.autoSignIn() unless auth.get('signedIn') getURL: -> url = this._super.apply(this, arguments) if location.pathname == '/' if @get('auth.signedIn') return '/repositories' else return '/home' url formatURL: (logicalPath) -> if logicalPath == '/repositories' || logicalPath == '/home' '/' else @_super.apply this, arguments `export default Location`
`import Ember from 'ember'` `import config from 'travis/config/environment'` Location = Ember.HistoryLocation.extend init: -> @_super.apply this, arguments if auth = @get('auth') # location's getURL is first called before we even # get to routes, so autoSignIn won't be called in # such case auth.autoSignIn() unless auth.get('signedIn') getURL: -> url = this._super.apply(this, arguments) unless config.pro if location.pathname == '/' if @get('auth.signedIn') return '/repositories' else return '/home' url formatURL: (logicalPath) -> if logicalPath == '/repositories' || logicalPath == '/home' '/' else @_super.apply this, arguments `export default Location`
Disable landing page on pro for now
Disable landing page on pro for now
CoffeeScript
mit
fotinakis/travis-web,fauxton/travis-web,jlrigau/travis-web,travis-ci/travis-web,2947721120/travis-web,fauxton/travis-web,2947721120/travis-web,Tiger66639/travis-web,fauxton/travis-web,fotinakis/travis-web,fotinakis/travis-web,Tiger66639/travis-web,mjlambert/travis-web,travis-ci/travis-web,travis-ci/travis-web,Tiger66639/travis-web,travis-ci/travis-web,Tiger66639/travis-web,mjlambert/travis-web,fotinakis/travis-web,mjlambert/travis-web,jlrigau/travis-web,fauxton/travis-web,jlrigau/travis-web,2947721120/travis-web,mjlambert/travis-web,2947721120/travis-web,jlrigau/travis-web
9b9fda428d47cf30c974112b832ae337349c0bb6
prototypes/load_maps/coffeescripts/main.coffee
prototypes/load_maps/coffeescripts/main.coffee
jQuery -> myOptions = center: new google.maps.LatLng(-34.397, 150.644) zoom: 8 mapTypeId: google.maps.MapTypeId.ROADMAP map = new google.maps.Map(document.getElementById("centermap"), myOptions)
$ -> myOptions = center: new google.maps.LatLng(-34.397, 150.644) zoom: 8 disableDefaultUI: true mapTypeId: google.maps.MapTypeId.ROADMAP map = new google.maps.Map(document.getElementById("centermap"), myOptions)
Disable default Google Maps controls
Disable default Google Maps controls
CoffeeScript
bsd-2-clause
akurzhan/scenario-editor,calpath/scenario-editor,akurzhan/scenario-editor,calpath/scenario-editor,calpath/scenario-editor,akurzhan/scenario-editor
078bb0044150da1b499ccc3ea7196a5ad3207782
spec/link-spec.coffee
spec/link-spec.coffee
RootView = require 'root-view' Editor = require 'editor' ChildProcess = require 'child_process' describe "link package", -> [editor] = [] beforeEach -> atom.activatePackage('javascript.tmbundle', sync: true) atom.activatePackage('hyperlink-helper.tmbundle', sync: true) window.rootView = new RootView rootView.open('sample.js') atom.activatePackage('link') rootView.attachToDom() editor = rootView.getActiveView() editor.insertText("// http://github.com\n") describe "when the cursor is on a link", -> it "opens the link using the 'open' command", -> spyOn(ChildProcess, 'spawn') editor.trigger('link:open') expect(ChildProcess.spawn).not.toHaveBeenCalled() editor.setCursorBufferPosition([0,5]) editor.trigger('link:open') expect(ChildProcess.spawn).toHaveBeenCalled() expect(ChildProcess.spawn.argsForCall[0][1][0]).toBe "http://github.com"
RootView = require 'root-view' Editor = require 'editor' ChildProcess = require 'child_process' describe "link package", -> [editor] = [] beforeEach -> atom.activatePackage('javascript-tmbundle', sync: true) atom.activatePackage('hyperlink-helper-tmbundle', sync: true) window.rootView = new RootView rootView.open('sample.js') atom.activatePackage('link') rootView.attachToDom() editor = rootView.getActiveView() editor.insertText("// http://github.com\n") describe "when the cursor is on a link", -> it "opens the link using the 'open' command", -> spyOn(ChildProcess, 'spawn') editor.trigger('link:open') expect(ChildProcess.spawn).not.toHaveBeenCalled() editor.setCursorBufferPosition([0,5]) editor.trigger('link:open') expect(ChildProcess.spawn).toHaveBeenCalled() expect(ChildProcess.spawn.argsForCall[0][1][0]).toBe "http://github.com"
Use correct textmate package names
Use correct textmate package names
CoffeeScript
mit
atom/link
a115d2d9e61c8c3c61fd60549fb2f66a2356e099
app/assets/javascripts/views/forms/chosen-select.js.coffee
app/assets/javascripts/views/forms/chosen-select.js.coffee
ETahi.ChosenView = Ember.Select.extend multiple: false width: '200px' disableSearchThreshold: 0 searchContains: true attributeBindings:['multiple', 'width', 'disableSearchThreshold', 'searchContains', 'data-placeholder'] changeAction: null change: -> action = @get('changeAction') @get('controller').send(action, @get('value')) if action setup: (-> options = multiple: @get('multiple') width: @get('width') disable_search_threshold: @get('disableSearchThreshold') search_contains: @get('searchContains') no_results_text: @get('noResultsText') max_selected_options: @get('maxSelectedOptions') allow_single_deselect: @get('allowSingleDeselect') inherit_select_classes: true options.clean_search_text = @cleanSearchText options.calling_context = @ @.$().chosen(options) @addObserver @get("optionLabelPath").replace(/^content/, "content.@each"), => @rerenderChosen() ).on('didInsertElement') teardown: (-> @.$().chosen('destroy') ).on('willDestroyElement') cleanSearchText: (option, context) -> option.text rerenderChosen: -> # Don't trigger Chosen update until after DOM elements have finished rendering. Ember.run.scheduleOnce 'afterRender', @, -> if @.$() @.$().trigger('chosen:updated') Ember.Handlebars.helper('chosen', ETahi.ChosenView)
ETahi.ChosenView = Ember.Select.extend multiple: false width: '200px' disableSearchThreshold: 0 searchContains: true attributeBindings:['multiple', 'width', 'disableSearchThreshold', 'searchContains', 'data-placeholder'] changeAction: null change: -> action = @get('changeAction') @get('controller').send(action, @get('value')) if action setup: (-> options = multiple: @get('multiple') width: @get('width') disable_search_threshold: @get('disableSearchThreshold') search_contains: @get('searchContains') no_results_text: @get('noResultsText') max_selected_options: @get('maxSelectedOptions') allow_single_deselect: @get('allowSingleDeselect') inherit_select_classes: true options.clean_search_text = @cleanSearchText options.calling_context = @ @.$().chosen(options) @addObserver @get("optionLabelPath").replace(/^content/, "content.@each"), => @rerenderChosen() @addObserver "value", => @rerenderChosen() ).on('didInsertElement') teardown: (-> @.$().chosen('destroy') ).on('willDestroyElement') cleanSearchText: (option, context) -> option.text rerenderChosen: -> # Don't trigger Chosen update until after DOM elements have finished rendering. Ember.run.scheduleOnce 'afterRender', @, -> if @.$() @.$().trigger('chosen:updated') Ember.Handlebars.helper('chosen', ETahi.ChosenView)
Fix issue where chosen wouldn't update if bound selected value changed elsewhere
Fix issue where chosen wouldn't update if bound selected value changed elsewhere
CoffeeScript
mit
johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi
71d62e7a17874df3eb50cd2336fb9312b86d2080
lib/atom-python-test-view.coffee
lib/atom-python-test-view.coffee
{$, ScrollView} = require 'atom-space-pen-views' module.exports = class AtomPythonTestView extends ScrollView message: '' maximized: false @content: -> @div class: 'atom-python-test-view native-key-bindings', outlet: 'atomTestView', tabindex: -1, overflow: "auto", => @div class: 'btn-toolbar', outlet:'toolbar', => @button outlet: 'closeBtn', class: 'btn inline-block-tight right', click: 'destroy', style: 'float: right', => @span class: 'icon icon-x' @pre class: 'output', outlet: 'output' initialize: -> @panel ?= atom.workspace.addBottomPanel(item: this) addLine: (line) -> @message += line @find(".output").text(@message) clear: -> @message = '' finish: -> console.log('finish') destroy: -> @panel.hide() reset: -> @message = defaultMessage toggle: -> @find(".output").height(500) @addLine 'Running tests... \n' @panel.show()
{$, ScrollView} = require 'atom-space-pen-views' module.exports = class AtomPythonTestView extends ScrollView message: '' maximized: false @content: -> @div class: 'atom-python-test-view native-key-bindings', outlet: 'atomTestView', tabindex: -1, overflow: "auto", => @div class: 'btn-toolbar', outlet:'toolbar', => @button outlet: 'closeBtn', class: 'btn inline-block-tight right', click: 'destroy', style: 'float: right', => @span class: 'icon icon-x' @pre class: 'output', outlet: 'output' initialize: -> @panel ?= atom.workspace.addBottomPanel(item: this) @panel.hide() addLine: (line) -> @message += line @find(".output").text(@message) clear: -> @message = '' finish: -> console.log('finish') destroy: -> @panel.hide() reset: -> @message = defaultMessage toggle: -> @find(".output").height(500) @addLine 'Running tests... \n' @panel.show()
Hide atom python test panel on Atom opening.
Hide atom python test panel on Atom opening.
CoffeeScript
mit
pghilardi/atom-python-test
82a5b0e69bcd6e83a904e477bf8ffa6c3ec3f588
app/assets/javascripts/sprangular/controllers/account.coffee
app/assets/javascripts/sprangular/controllers/account.coffee
Sprangular.controller 'AccountCtrl', ($scope, $location, $routeParams, Status, Account) -> Status.pageTitle = 'My Account' user = Account.user $scope.editing = false $scope.user = user refreshAccount = -> Account.init().then -> user = Account.user user.password = '' user.password_confirmation = '' $scope.edit = -> $scope.editing = true $scope.stopEdit = -> $scope.editing = false $scope.save = -> user.errors = {} Account.save(user) .then (content) -> $scope.editing = false $location.path('/') if !Account.isLogged , (errors) -> user.errors = errors refreshAccount()
Sprangular.controller 'AccountCtrl', ($scope, $location, $routeParams, Status, Account) -> Status.pageTitle = 'My Account' user = Account.user $scope.editing = false $scope.user = user refreshAccount = -> Account.reload().then -> user = Account.user user.password = '' user.password_confirmation = '' $scope.edit = -> $scope.editing = true $scope.stopEdit = -> $scope.editing = false $scope.save = -> user.errors = {} Account.save(user) .then (content) -> $scope.editing = false $location.path('/') if !Account.isLogged , (errors) -> user.errors = errors refreshAccount()
Use `Account.reload` instead of `init`
Use `Account.reload` instead of `init`
CoffeeScript
mit
sprangular/sprangular,sprangular/sprangular,sprangular/sprangular
117ae6e12deea89fbd85053549655a7c9a3d69ff
app/assets/javascripts/components/inline_edit_body_part.js.coffee
app/assets/javascripts/components/inline_edit_body_part.js.coffee
ETahi.InlineEditBodyPartComponent = Em.Component.extend editing: false snapshot: [] confirmDelete: false createSnapshot: (-> @set('snapshot', Em.copy(@get('block'), true)) ).observes('editing') hasContent: (-> @get('block').any(@_isEmpty) ).property('block.@each.value') hasNoContent: Em.computed.not('hasContent') bodyPartType: (-> @get('block.firstObject.type') ).property('block.@each.type') _isEmpty: (item) -> item && !Ember.isEmpty(item.value) actions: toggleEdit: -> @sendAction('cancel', @get('block'), @get('snapshot')) if @get('editing') @toggleProperty 'editing' deleteBlock: -> @sendAction('delete', @get('block')) save: -> if @get('hasContent') @sendAction('save', @get('block')) @toggleProperty 'editing' confirmDeletion: -> @set('confirmDelete', true) cancelDestroy: -> @set('confirmDelete', false) addItem: -> @sendAction('addItem', @get('block'))
ETahi.InlineEditBodyPartComponent = Em.Component.extend editing: false snapshot: [] confirmDelete: false createSnapshot: (-> @set('snapshot', Em.copy(@get('block'), true)) ).observes('editing') hasContent: (-> @get('block').any(@_isNotEmpty) ).property('block.@each.value') hasNoContent: Em.computed.not('hasContent') bodyPartType: (-> @get('block.firstObject.type') ).property('block.@each.type') _isNotEmpty: (item) -> item && !Em.isEmpty(item.value) actions: toggleEdit: -> @sendAction('cancel', @get('block'), @get('snapshot')) if @get('editing') @toggleProperty 'editing' deleteBlock: -> @sendAction('delete', @get('block')) save: -> if @get('hasContent') @sendAction('save', @get('block')) @toggleProperty 'editing' confirmDeletion: -> @set('confirmDelete', true) cancelDestroy: -> @set('confirmDelete', false) addItem: -> @sendAction('addItem', @get('block'))
Correct poorly named private method
Correct poorly named private method
CoffeeScript
mit
johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi
8c29410a89ab373e7a387cfc9acb49e42c81da84
lib/assets/javascripts/google-analytics-turbolinks.js.coffee
lib/assets/javascripts/google-analytics-turbolinks.js.coffee
if window.history?.pushState and window.history.replaceState document.addEventListener 'page:change', (event) => # Google Analytics if window._gaq != undefined _gaq.push(['_trackPageview']) else if window.pageTracker != undefined pageTracker._trackPageview();
if window.history?.pushState and window.history.replaceState document.addEventListener 'page:change', (event) => # Google Analytics if window.ga != undefined ga('set', 'location', location.href.split('#')[0]) ga('send', 'pageview') else if window._gaq != undefined _gaq.push(['_trackPageview']) else if window.pageTracker != undefined pageTracker._trackPageview();
Add Google Universal Analytics support In order to send the correct 'location', I used ga('set', 'location') method.
Add Google Universal Analytics support In order to send the correct 'location', I used ga('set', 'location') method.
CoffeeScript
mit
shukydvir/google-analytics-turbolinks,joshdvir/google-analytics-turbolinks
f6526ccec1973f1f43c72086845dc21ae80179c4
src/api/visualizers.coffee
src/api/visualizers.coffee
logger = require 'winston' Visualizer = require('../model/visualizer').Visualizer authorisation = require './authorisation' utils = require '../utils' exports.getAllVisualizers = -> # Must be admin if not authorisation.inGroup 'admin', this.authenticated utils.logAndSetResponse this, 403, "User #{this.authenticated.email} is not an admin, API access to getAllVisualizers denied.", 'info' return try v = yield Visualizer.find().exec() this.body = v catch err utils.logAndSetResponse this, 500, "Could not fetch visualizers via the API: #{err}", 'error' exports.removeVisualizer = (name) -> # Must be admin if not authorisation.inGroup 'admin', this.authenticated utils.logAndSetResponse this, 403, "User #{this.authenticated.email} is not an admin, API access to removeVisualizer denied.", 'info' return name = unescape name try v = yield Visualizer.findOneAndRemove(name: name).exec() if not v return utils.logAndSetResponse this, 404, "Could not find visualizer with #{name}", 'info' this.body = "Successfully removed visualizer with name #{name}" logger.info "User #{this.authenticated.name} removed visualizer #{name}" catch e utils.logAndSetResponse this, 500, "Could not remove visualizer #{name} via the API #{e}", 'error'
logger = require 'winston' Visualizer = require('../model/visualizer').Visualizer authorisation = require './authorisation' utils = require '../utils' exports.getAllVisualizers = -> # Must be admin if not authorisation.inGroup 'admin', this.authenticated utils.logAndSetResponse this, 403, "User #{this.authenticated.email} is not an admin, API access to getAllVisualizers denied.", 'info' return try v = yield Visualizer.find().exec() this.body = v catch err utils.logAndSetResponse this, 500, "Could not fetch visualizers via the API: #{err}", 'error' exports.removeVisualizer = (name) -> # Must be admin if not authorisation.inGroup 'admin', this.authenticated utils.logAndSetResponse this, 403, "User #{this.authenticated.email} is not an admin, API access to removeVisualizer denied.", 'info' return name = unescape name try v = yield Visualizer.findOneAndRemove(name: name).exec() if not v return utils.logAndSetResponse this, 404, "Could not find visualizer with #{name}", 'info' this.body = "Successfully removed visualizer with name #{name}" logger.info "User #{this.authenticated.email} removed visualizer #{name}" catch e utils.logAndSetResponse this, 500, "Could not remove visualizer #{name} via the API #{e}", 'error'
Fix user name in log
Fix user name in log
CoffeeScript
mpl-2.0
jembi/openhim-core-js,jembi/openhim-core-js
7a6417d4e62ab053be8ac4f8b56c4771cf823b5e
src/scripts/workbench/views/datastream/show_view.js.coffee
src/scripts/workbench/views/datastream/show_view.js.coffee
class Workbench.Views.DatastreamShowView extends Backbone.View template: JST["workbench/templates/datastream"] tagName: "li" className: "datastream" initialize: -> @renderDeferred = $.Deferred() @chartView = new Workbench.Views.DatastreamChartView model: @model @latestView = new Workbench.Views.DatastreamLatestView model: @model @listenTo @model, "change:seriesData", => # Defer until after main element is rendered @renderDeferred.done(=> # Render the chart _.delay(=> @chartView.setElement(@$(".chart")).render() , 0) # Render the latest view @latestView.setElement(@$("#latest_#{@model.id}")).render() ) remove: -> @chartView.remove() @latestView.remove() super() render: -> @$el.animate("min-height": 200).promise().done(=> @$el.html(@template(@model.toJSON())) @renderDeferred.resolve() ) this
class Workbench.Views.DatastreamShowView extends Backbone.Marionette.ItemView template: "workbench/templates/datastream" tagName: "li" className: "datastream" initialize: -> @renderDeferred = $.Deferred() @chartView = new Workbench.Views.DatastreamChartView model: @model @latestView = new Workbench.Views.DatastreamLatestView model: @model @listenTo @model, "change:seriesData", => # Defer until after main element is rendered @renderDeferred.done(=> # Render the chart _.delay(=> @chartView.setElement(@$(".chart")).render() , 0) # Render the latest view @latestView.setElement(@$("#latest_#{@model.id}")).render() ) onBeforeDestroy: -> @chartView.remove() @latestView.remove() onRender: -> @renderDeferred.resolve()
Update Datastream view to ItemView
Update Datastream view to ItemView
CoffeeScript
mit
GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench
13662ca329348098106a051468e0051c7af49835
app/src/controllers/wallet/pairing/wallet_pairing_progress_dialog_view_controller.coffee
app/src/controllers/wallet/pairing/wallet_pairing_progress_dialog_view_controller.coffee
class @WalletPairingProgressDialogViewController extends DialogViewController view: contentContainer: "#content_container" onAfterRender: -> super # launch request @_request = @params.request @_request?.onComplete (screen, error) => @_request = null if screen? dialog = new CommonDialogsMessageDialogViewController(kind: "success", title: t("wallet.pairing.errors.pairing_succeeded"), subtitle: _.str.sprintf(t("wallet.pairing.errors.dongle_is_now_paired"), screen.name)) else dialog = new CommonDialogsMessageDialogViewController(kind: "error", title: t("wallet.pairing.errors.pairing_failed"), subtitle: t("wallet.pairing.errors." + error)) dialog.show() @_request?.on 'finalizing', @_onFinalizing # show spinner @view.spinner = ledger.spinners.createLargeSpinner(@view.contentContainer[0]) onDetach: -> super @_request?.off 'finalizing', @_onFinalizing onDismiss: -> super @_request?.cancel() _onFinalizing: -> ledger.m2fa.PairedSecureScreen.getScreensByUuidFromSyncedStore @_request.getDeviceUuid(), (screens, error) => if screens?.length is 0 @getDialog().push new WalletPairingFinalizingDialogViewController(request: @_request) else @_request.setSecureScreenName(screens[0].name)
class @WalletPairingProgressDialogViewController extends DialogViewController view: contentContainer: "#content_container" onAfterRender: -> super # launch request @_request = @params.request @_request?.onComplete (screen, error) => @_request = null @dismiss () => if screen? dialog = new CommonDialogsMessageDialogViewController(kind: "success", title: t("wallet.pairing.errors.pairing_succeeded"), subtitle: _.str.sprintf(t("wallet.pairing.errors.dongle_is_now_paired"), screen.name)) else dialog = new CommonDialogsMessageDialogViewController(kind: "error", title: t("wallet.pairing.errors.pairing_failed"), subtitle: t("wallet.pairing.errors." + error)) dialog.show() @_request?.on 'finalizing', @_onFinalizing # show spinner @view.spinner = ledger.spinners.createLargeSpinner(@view.contentContainer[0]) onDetach: -> super @_request?.off 'finalizing', @_onFinalizing onDismiss: -> super @_request?.cancel() _onFinalizing: -> ledger.m2fa.PairedSecureScreen.getScreensByUuidFromSyncedStore @_request.getDeviceUuid(), (screens, error) => if screens?.length is 0 @getDialog().push new WalletPairingFinalizingDialogViewController(request: @_request) else @_request.setSecureScreenName(screens[0].name)
Fix "don't dismiss pairing progress dialog when displaying success"
Fix "don't dismiss pairing progress dialog when displaying success"
CoffeeScript
mit
LedgerHQ/ledger-wallet-chrome,Morveus/ledger-wallet-doge-chrome,Morveus/ledger-wallet-doge-chrome,LedgerHQ/ledger-wallet-chrome
fe7c5e42a62385c4b1c89734867b8cdef1519021
app/assets/javascripts/hyper_admin/angularjs/config.js.coffee
app/assets/javascripts/hyper_admin/angularjs/config.js.coffee
angular.module("hyperadmin", [ "ui.router" ])
angular.module("hyperadmin", [ "ui.router" ]) .config ($httpProvider) -> authToken = $("meta[name=\"csrf-token\"]").attr("content") $httpProvider.defaults.headers.common["X-CSRF-TOKEN"] = authToken $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest" $httpProvider.defaults.headers.common["Accept"] = "text/html,application/json"
Configure $http service for Rails
Configure $http service for Rails
CoffeeScript
mit
hyperoslo/hyper_admin,hyperoslo/hyper_admin,hyperoslo/hyper_admin