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 |
|---|---|---|---|---|---|---|---|---|---|
b9aa77905f396a769cf3aeebb8e0f755edef192b | server/stream/streamBroadcast.coffee | server/stream/streamBroadcast.coffee | @connections = {}
@startStreamBroadcast = (streams) ->
console.log 'startStreamBroadcast'
# connections = {}
InstanceStatus.getCollection().find().observe
added: (record) ->
if record.extraInformation.port is process.env.PORT
return
console.log 'connecting in', "localhost:#{record.extraInformation.port}"
connections[record.extraInformation.port] = DDP.connect("localhost:#{record.extraInformation.port}", {_dontPrintErrors: true})
removed: (record) ->
if connections[record.extraInformation.port]?
console.log 'disconnecting from', "localhost:#{record.extraInformation.port}"
connections[record.extraInformation.port].disconnect()
delete connections[record.extraInformation.port]
broadcast = (streamName, eventName, args, userId) ->
for port, connection of connections
if connection.status().connected is true
connection.call 'stream', streamName, eventName, args
emitters = {}
for streamName, stream of streams
do (streamName, stream) ->
emitters[streamName] = stream.emit
stream.emit = (eventName, args...) ->
broadcast streamName, eventName, args
emitters[streamName].call {}, arguments
Meteor.methods
stream: (streamName, eventName, args) ->
args.unshift eventName
emitters[streamName]?.apply {}, args
Meteor.startup ->
startStreamBroadcast
'webrtc.stream': webrtc.stream
| @connections = {}
@startStreamBroadcast = (streams) ->
console.log 'startStreamBroadcast'
# connections = {}
InstanceStatus.getCollection().find().observe
added: (record) ->
if record.extraInformation.port is process.env.PORT
return
console.log 'connecting in', "localhost:#{record.extraInformation.port}"
connections[record.extraInformation.port] = DDP.connect("localhost:#{record.extraInformation.port}", {_dontPrintErrors: true})
removed: (record) ->
if connections[record.extraInformation.port]?
console.log 'disconnecting from', "localhost:#{record.extraInformation.port}"
connections[record.extraInformation.port].disconnect()
delete connections[record.extraInformation.port]
broadcast = (streamName, eventName, args, userId) ->
for port, connection of connections
if connection.status().connected is true
connection.call 'stream', streamName, eventName, args
emitters = {}
for streamName, stream of streams
do (streamName, stream) ->
emitters[streamName] = stream.emit
stream.emit = (eventName, args...) ->
broadcast streamName, eventName, args
emitters[streamName].apply {}, arguments
Meteor.methods
stream: (streamName, eventName, args) ->
args.unshift eventName
emitters[streamName]?.apply {}, args
Meteor.startup ->
startStreamBroadcast
'webrtc.stream': webrtc.stream
| Fix emitter in same server | Fix emitter in same server
| CoffeeScript | mit | pitamar/Rocket.Chat,tzellman/Rocket.Chat,callmekatootie/Rocket.Chat,qnib/Rocket.Chat,ludiculous/Rocket.Chat,callblueday/Rocket.Chat,abhishekshukla0302/trico,thswave/Rocket.Chat,marzieh312/Rocket.Chat,JisuPark/Rocket.Chat,glnarayanan/Rocket.Chat,parkmap/Rocket.Chat,igorstajic/Rocket.Chat,apnero/tactixteam,pitamar/Rocket.Chat,klatys/Rocket.Chat,org100h1/Rocket.Panda,Achaikos/Rocket.Chat,uniteddiversity/Rocket.Chat,abduljanjua/TheHub,matthewshirley/Rocket.Chat,JamesHGreen/Rocket_API,ziedmahdi/Rocket.Chat,icaromh/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,LearnersGuild/echo-chat,lucasgolino/Rocket.Chat,alexbrazier/Rocket.Chat,wolfika/Rocket.Chat,ggazzo/Rocket.Chat,bt/Rocket.Chat,erikmaarten/Rocket.Chat,subesokun/Rocket.Chat,xboston/Rocket.Chat,biomassives/Rocket.Chat,JamesHGreen/Rocket_API,tzellman/Rocket.Chat,apnero/tactixteam,acidicX/Rocket.Chat,jonathanhartman/Rocket.Chat,subesokun/Rocket.Chat,arvi/Rocket.Chat,org100h1/Rocket.Panda,tntobias/Rocket.Chat,ealbers/Rocket.Chat,mohamedhagag/Rocket.Chat,KyawNaingTun/Rocket.Chat,ndarilek/Rocket.Chat,gitaboard/Rocket.Chat,madmanteam/Rocket.Chat,ZBoxApp/Rocket.Chat,freakynit/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,apnero/tactixteam,nrhubbar/Rocket.Chat,mwharrison/Rocket.Chat,ut7/Rocket.Chat,matthewshirley/Rocket.Chat,slava-sh/Rocket.Chat,ealbers/Rocket.Chat,arvi/Rocket.Chat,klatys/Rocket.Chat,jbsavoy18/rocketchat-1,abduljanjua/TheHub,k0nsl/Rocket.Chat,Flitterkill/Rocket.Chat,cdwv/Rocket.Chat,bt/Rocket.Chat,BorntraegerMarc/Rocket.Chat,ZBoxApp/Rocket.Chat,ealbers/Rocket.Chat,Gromby/Rocket.Chat,andela-cnnadi/Rocket.Chat,LeonardOliveros/Rocket.Chat,liemqv/Rocket.Chat,inoxth/Rocket.Chat,fduraibi/Rocket.Chat,cnash/Rocket.Chat,sargentsurg/Rocket.Chat,HeapCity/Heap.City,atyenoria/Rocket.Chat,christmo/Rocket.Chat,tlongren/Rocket.Chat,Sing-Li/Rocket.Chat,Achaikos/Rocket.Chat,katopz/Rocket.Chat,pachox/Rocket.Chat,galrotem1993/Rocket.Chat,thswave/Rocket.Chat,Kiran-Rao/Rocket.Chat,ahmadassaf/Rocket.Chat,ut7/Rocket.Chat,timkinnane/Rocket.Chat,nrhubbar/Rocket.Chat,HeapCity/Heap.City,intelradoux/Rocket.Chat,pitamar/Rocket.Chat,acaronmd/Rocket.Chat,andela-cnnadi/Rocket.Chat,ziedmahdi/Rocket.Chat,jadeqwang/Rocket.Chat,fatihwk/Rocket.Chat,ZBoxApp/Rocket.Chat,bopjesvla/chatmafia,TribeMedia/Rocket.Chat,amaapp/ama,princesust/Rocket.Chat,PavelVanecek/Rocket.Chat,karlprieb/Rocket.Chat,wtsarchive/Rocket.Chat,coreyaus/Rocket.Chat,slava-sh/Rocket.Chat,danielbressan/Rocket.Chat,mhurwi/Rocket.Chat,sikofitt/Rocket.Chat,alexbrazier/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,xboston/Rocket.Chat,karlprieb/Rocket.Chat,Jandersolutions/Rocket.Chat,flaviogrossi/Rocket.Chat,nishimaki10/Rocket.Chat,nishimaki10/Rocket.Chat,greatdinosaur/Rocket.Chat,pkgodara/Rocket.Chat,kkochubey1/Rocket.Chat,umeshrs/rocket-chat-integration,haoyixin/Rocket.Chat,Dianoga/Rocket.Chat,warcode/Rocket.Chat,Flitterkill/Rocket.Chat,VoiSmart/Rocket.Chat,timkinnane/Rocket.Chat,4thParty/Rocket.Chat,jbsavoy18/rocketchat-1,fonsich/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,haoyixin/Rocket.Chat,tlongren/Rocket.Chat,lukaroski/traden,parkmap/Rocket.Chat,linnovate/hi,mitar/Rocket.Chat,wolfika/Rocket.Chat,litewhatever/Rocket.Chat,LearnersGuild/Rocket.Chat,atyenoria/Rocket.Chat,intelradoux/Rocket.Chat,JamesHGreen/Rocket.Chat,umeshrs/rocket-chat-integration,snaiperskaya96/Rocket.Chat,hazio/Rocket.Chat,Deepakkothandan/Rocket.Chat,wangleihd/Rocket.Chat,psadaic/Rocket.Chat,AimenJoe/Rocket.Chat,freakynit/Rocket.Chat,haoyixin/Rocket.Chat,xasx/Rocket.Chat,inoxth/Rocket.Chat,Movile/Rocket.Chat,jeanmatheussouto/Rocket.Chat,callblueday/Rocket.Chat,callmekatootie/Rocket.Chat,Jandersolutions/Rocket.Chat,mohamedhagag/Rocket.Chat,matthewshirley/Rocket.Chat,subesokun/Rocket.Chat,callmekatootie/Rocket.Chat,osxi/Rocket.Chat,wtsarchive/Rocket.Chat,nrhubbar/Rocket.Chat,JisuPark/Rocket.Chat,liuliming2008/Rocket.Chat,galrotem1993/Rocket.Chat,Deepakkothandan/Rocket.Chat,greatdinosaur/Rocket.Chat,soonahn/Rocket.Chat,tradetiger/Rocket.Chat,acaronmd/Rocket.Chat,TribeMedia/Rocket.Chat,OtkurBiz/Rocket.Chat,capensisma/Rocket.Chat,adamteece/Rocket.Chat,andela-cnnadi/Rocket.Chat,coreyaus/Rocket.Chat,ndarilek/Rocket.Chat,tntobias/Rocket.Chat,flaviogrossi/Rocket.Chat,flaviogrossi/Rocket.Chat,bopjesvla/chatmafia,k0nsl/Rocket.Chat,igorstajic/Rocket.Chat,tlongren/Rocket.Chat,abhishekshukla0302/trico,AlecTroemel/Rocket.Chat,mccambridge/Rocket.Chat,nishimaki10/Rocket.Chat,4thParty/Rocket.Chat,acaronmd/Rocket.Chat,Sing-Li/Rocket.Chat,PavelVanecek/Rocket.Chat,himeshp/Rocket.Chat,princesust/Rocket.Chat,wangleihd/Rocket.Chat,Maysora/Rocket.Chat,NMandapaty/Rocket.Chat,PavelVanecek/Rocket.Chat,sunhaolin/Rocket.Chat,christmo/Rocket.Chat,mrinaldhar/Rocket.Chat,jhou2/Rocket.Chat,ziedmahdi/Rocket.Chat,flaviogrossi/Rocket.Chat,snaiperskaya96/Rocket.Chat,ealbers/Rocket.Chat,cdwv/Rocket.Chat,Jandersoft/Rocket.Chat,lonbaker/Rocket.Chat,greatdinosaur/Rocket.Chat,jessedhillon/Rocket.Chat,jessedhillon/Rocket.Chat,lucasgolino/Rocket.Chat,mccambridge/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,janmaghuyop/Rocket.Chat,lukaroski/traden,parkmap/Rocket.Chat,jonathanhartman/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,LearnersGuild/Rocket.Chat,Gudii/Rocket.Chat,Kiran-Rao/Rocket.Chat,marzieh312/Rocket.Chat,ludiculous/Rocket.Chat,fatihwk/Rocket.Chat,sikofitt/Rocket.Chat,adamteece/Rocket.Chat,JamesHGreen/Rocket_API,liemqv/Rocket.Chat,LearnersGuild/echo-chat,gitaboard/Rocket.Chat,Gudii/Rocket.Chat,gitaboard/Rocket.Chat,rasata/Rocket.Chat,OtkurBiz/Rocket.Chat,xasx/Rocket.Chat,coreyaus/Rocket.Chat,bt/Rocket.Chat,ahmadassaf/Rocket.Chat,ziedmahdi/Rocket.Chat,wicked539/Rocket.Chat,icaromh/Rocket.Chat,lihuanghai/Rocket.Chat,haosdent/Rocket.Chat,pitamar/Rocket.Chat,wicked539/Rocket.Chat,erikmaarten/Rocket.Chat,glnarayanan/Rocket.Chat,fduraibi/Rocket.Chat,Movile/Rocket.Chat,intelradoux/Rocket.Chat,alenodari/Rocket.Chat,kkochubey1/Rocket.Chat,inoxth/Rocket.Chat,acidsound/Rocket.Chat,himeshp/Rocket.Chat,celloudiallo/Rocket.Chat,fduraibi/Rocket.Chat,danielbressan/Rocket.Chat,tradetiger/Rocket.Chat,Sing-Li/Rocket.Chat,mohamedhagag/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,webcoding/Rocket.Chat,liuliming2008/Rocket.Chat,fonsich/Rocket.Chat,pachox/Rocket.Chat,ederribeiro/Rocket.Chat,berndsi/Rocket.Chat,wangleihd/Rocket.Chat,phlkchan/Rocket.Chat,mhurwi/Rocket.Chat,4thParty/Rocket.Chat,Achaikos/Rocket.Chat,jbsavoy18/rocketchat-1,ahmadassaf/Rocket.Chat,atyenoria/Rocket.Chat,berndsi/Rocket.Chat,yuyixg/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,janmaghuyop/Rocket.Chat,fatihwk/Rocket.Chat,thunderrabbit/Rocket.Chat,thebakeryio/Rocket.Chat,BHWD/noouchat,I-am-Gabi/Rocket.Chat,fatihwk/Rocket.Chat,hazio/Rocket.Chat,arvi/Rocket.Chat,BorntraegerMarc/Rocket.Chat,LeonardOliveros/Rocket.Chat,galrotem1993/Rocket.Chat,4thParty/Rocket.Chat,Ninotna/Rocket.Chat,osxi/Rocket.Chat,BorntraegerMarc/Rocket.Chat,karlprieb/Rocket.Chat,danielbressan/Rocket.Chat,ggazzo/Rocket.Chat,LearnersGuild/echo-chat,inoio/Rocket.Chat,yuyixg/Rocket.Chat,lonbaker/Rocket.Chat,warcode/Rocket.Chat,tntobias/Rocket.Chat,Dianoga/Rocket.Chat,madmanteam/Rocket.Chat,thunderrabbit/Rocket.Chat,jeann2013/Rocket.Chat,acidicX/Rocket.Chat,j-ew-s/Rocket.Chat,Gromby/Rocket.Chat,christmo/Rocket.Chat,mccambridge/Rocket.Chat,inoio/Rocket.Chat,timkinnane/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,leohmoraes/Rocket.Chat,inoio/Rocket.Chat,jessedhillon/Rocket.Chat,JamesHGreen/Rocket_API,sikofitt/Rocket.Chat,I-am-Gabi/Rocket.Chat,thunderrabbit/Rocket.Chat,Flitterkill/Rocket.Chat,qnib/Rocket.Chat,AimenJoe/Rocket.Chat,acidicX/Rocket.Chat,VoiSmart/Rocket.Chat,umeshrs/rocket-chat-integration,wtsarchive/Rocket.Chat,mrinaldhar/Rocket.Chat,jyx140521/Rocket.Chat,bt/Rocket.Chat,ndarilek/Rocket.Chat,callblueday/Rocket.Chat,cdwv/Rocket.Chat,katopz/Rocket.Chat,ederribeiro/Rocket.Chat,mrsimpson/Rocket.Chat,glnarayanan/Rocket.Chat,pachox/Rocket.Chat,thebakeryio/Rocket.Chat,AlecTroemel/Rocket.Chat,mrinaldhar/Rocket.Chat,j-ew-s/Rocket.Chat,j-ew-s/Rocket.Chat,revspringjake/Rocket.Chat,igorstajic/Rocket.Chat,uniteddiversity/Rocket.Chat,nishimaki10/Rocket.Chat,galrotem1993/Rocket.Chat,linnovate/hi,soonahn/Rocket.Chat,soonahn/Rocket.Chat,xboston/Rocket.Chat,tzellman/Rocket.Chat,lonbaker/Rocket.Chat,katopz/Rocket.Chat,liuliming2008/Rocket.Chat,cnash/Rocket.Chat,psadaic/Rocket.Chat,mrsimpson/Rocket.Chat,mrsimpson/Rocket.Chat,capensisma/Rocket.Chat,haoyixin/Rocket.Chat,qnib/Rocket.Chat,JisuPark/Rocket.Chat,wicked539/Rocket.Chat,jyx140521/Rocket.Chat,xasx/Rocket.Chat,anhld/Rocket.Chat,cnash/Rocket.Chat,florinnichifiriuc/Rocket.Chat,LeonardOliveros/Rocket.Chat,LeonardOliveros/Rocket.Chat,leohmoraes/Rocket.Chat,jonathanhartman/Rocket.Chat,tntobias/Rocket.Chat,Jandersolutions/Rocket.Chat,inoxth/Rocket.Chat,Achaikos/Rocket.Chat,abduljanjua/TheHub,uniteddiversity/Rocket.Chat,sunhaolin/Rocket.Chat,BorntraegerMarc/Rocket.Chat,Deepakkothandan/Rocket.Chat,jadeqwang/Rocket.Chat,phlkchan/Rocket.Chat,osxi/Rocket.Chat,ut7/Rocket.Chat,mitar/Rocket.Chat,slava-sh/Rocket.Chat,hazio/Rocket.Chat,Deepakkothandan/Rocket.Chat,JamesHGreen/Rocket.Chat,Gyubin/Rocket.Chat,anhld/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,LearnersGuild/Rocket.Chat,org100h1/Rocket.Panda,steedos/chat,nabiltntn/Rocket.Chat,jeann2013/Rocket.Chat,steedos/chat,Maysora/Rocket.Chat,KyawNaingTun/Rocket.Chat,leohmoraes/Rocket.Chat,sargentsurg/Rocket.Chat,princesust/Rocket.Chat,NMandapaty/Rocket.Chat,umeshrs/rocket-chat,Abdelhamidhenni/Rocket.Chat,Ninotna/Rocket.Chat,marzieh312/Rocket.Chat,OtkurBiz/Rocket.Chat,mwharrison/Rocket.Chat,Kiran-Rao/Rocket.Chat,PavelVanecek/Rocket.Chat,mwharrison/Rocket.Chat,acaronmd/Rocket.Chat,yuyixg/Rocket.Chat,marzieh312/Rocket.Chat,anhld/Rocket.Chat,xasx/Rocket.Chat,cnash/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,abduljanjua/TheHub,philosowaffle/rpi-Rocket.Chat,sunhaolin/Rocket.Chat,kkochubey1/Rocket.Chat,Jandersoft/Rocket.Chat,Kiran-Rao/Rocket.Chat,capensisma/Rocket.Chat,Codebrahma/Rocket.Chat,Gromby/Rocket.Chat,mitar/Rocket.Chat,LearnersGuild/echo-chat,florinnichifiriuc/Rocket.Chat,k0nsl/Rocket.Chat,williamfortunademoraes/Rocket.Chat,abhishekshukla0302/trico,steedos/chat,fonsich/Rocket.Chat,jeanmatheussouto/Rocket.Chat,intelradoux/Rocket.Chat,NMandapaty/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,Jandersoft/Rocket.Chat,celloudiallo/Rocket.Chat,amaapp/ama,umeshrs/rocket-chat,nabiltntn/Rocket.Chat,yuyixg/Rocket.Chat,lucasgolino/Rocket.Chat,Gyubin/Rocket.Chat,mhurwi/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,LearnersGuild/Rocket.Chat,litewhatever/Rocket.Chat,amaapp/ama,lukaroski/traden,snaiperskaya96/Rocket.Chat,Movile/Rocket.Chat,biomassives/Rocket.Chat,nathantreid/Rocket.Chat,mccambridge/Rocket.Chat,lihuanghai/Rocket.Chat,jhou2/Rocket.Chat,biomassives/Rocket.Chat,Dianoga/Rocket.Chat,pkgodara/Rocket.Chat,revspringjake/Rocket.Chat,webcoding/Rocket.Chat,celloudiallo/Rocket.Chat,Maysora/Rocket.Chat,nabiltntn/Rocket.Chat,pkgodara/Rocket.Chat,ut7/Rocket.Chat,umeshrs/rocket-chat,mrinaldhar/Rocket.Chat,litewhatever/Rocket.Chat,danielbressan/Rocket.Chat,BHWD/noouchat,adamteece/Rocket.Chat,Sing-Li/Rocket.Chat,I-am-Gabi/Rocket.Chat,jhou2/Rocket.Chat,thebakeryio/Rocket.Chat,JamesHGreen/Rocket.Chat,rasata/Rocket.Chat,Gudii/Rocket.Chat,jadeqwang/Rocket.Chat,soonahn/Rocket.Chat,Gudii/Rocket.Chat,alenodari/Rocket.Chat,pachox/Rocket.Chat,xboston/Rocket.Chat,freakynit/Rocket.Chat,icaromh/Rocket.Chat,NMandapaty/Rocket.Chat,haosdent/Rocket.Chat,mrsimpson/Rocket.Chat,tlongren/Rocket.Chat,ahmadassaf/Rocket.Chat,Codebrahma/Rocket.Chat,pkgodara/Rocket.Chat,acidsound/Rocket.Chat,tradetiger/Rocket.Chat,ndarilek/Rocket.Chat,steedos/chat,wicked539/Rocket.Chat,acidsound/Rocket.Chat,rasata/Rocket.Chat,qnib/Rocket.Chat,igorstajic/Rocket.Chat,Gyubin/Rocket.Chat,mhurwi/Rocket.Chat,ggazzo/Rocket.Chat,liuliming2008/Rocket.Chat,litewhatever/Rocket.Chat,Flitterkill/Rocket.Chat,sscpac/chat-locker,klatys/Rocket.Chat,k0nsl/Rocket.Chat,janmaghuyop/Rocket.Chat,revspringjake/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,abhishekshukla0302/trico,AimenJoe/Rocket.Chat,erikmaarten/Rocket.Chat,AlecTroemel/Rocket.Chat,madmanteam/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,himeshp/Rocket.Chat,webcoding/Rocket.Chat,sscpac/chat-locker,williamfortunademoraes/Rocket.Chat,mwharrison/Rocket.Chat,ggazzo/Rocket.Chat,liemqv/Rocket.Chat,Codebrahma/Rocket.Chat,psadaic/Rocket.Chat,timkinnane/Rocket.Chat,matthewshirley/Rocket.Chat,AimenJoe/Rocket.Chat,Dianoga/Rocket.Chat,JamesHGreen/Rocket.Chat,haosdent/Rocket.Chat,warcode/Rocket.Chat,jyx140521/Rocket.Chat,wolfika/Rocket.Chat,VoiSmart/Rocket.Chat,sargentsurg/Rocket.Chat,snaiperskaya96/Rocket.Chat,OtkurBiz/Rocket.Chat,florinnichifiriuc/Rocket.Chat,williamfortunademoraes/Rocket.Chat,Gyubin/Rocket.Chat,ederribeiro/Rocket.Chat,HeapCity/Heap.City,nathantreid/Rocket.Chat,lukaroski/traden,subesokun/Rocket.Chat,thswave/Rocket.Chat,bopjesvla/chatmafia,jeann2013/Rocket.Chat,mitar/Rocket.Chat,org100h1/Rocket.Panda,jeanmatheussouto/Rocket.Chat,AlecTroemel/Rocket.Chat,Ninotna/Rocket.Chat,jbsavoy18/rocketchat-1,lihuanghai/Rocket.Chat,KyawNaingTun/Rocket.Chat,berndsi/Rocket.Chat,TribeMedia/Rocket.Chat,alexbrazier/Rocket.Chat,ludiculous/Rocket.Chat,TribeMedia/Rocket.Chat,jonathanhartman/Rocket.Chat,sscpac/chat-locker,klatys/Rocket.Chat,phlkchan/Rocket.Chat,alexbrazier/Rocket.Chat,wtsarchive/Rocket.Chat,alenodari/Rocket.Chat,Movile/Rocket.Chat,BHWD/noouchat,cdwv/Rocket.Chat,fduraibi/Rocket.Chat,nathantreid/Rocket.Chat,karlprieb/Rocket.Chat,amaapp/ama |
96362c32bac47b1ab84b741c4c2d3dec1ab12c1c | apps/artist_2/components/current_show_auction/query.coffee | apps/artist_2/components/current_show_auction/query.coffee | module.exports = """
fragment current on Artist {
auction: sales(size:2, live: true, is_auction: true){
cover_image {
cropped(width: 150, height: 104) {
url
}
}
href
name
start_at
end_at
}
show: partner_shows(size:2, exclude_fair_booths: true, active:true, sort:end_at_asc) {
cover_image {
cropped(width: 150, height: 104) {
url
}
}
href
name
start_at
end_at
}
}
""" | module.exports = """
fragment current on Artist {
auction: sales(size:2, live: true, is_auction: true){
cover_image {
cropped(width: 150, height: 104) {
url
}
}
href
name
start_at
end_at
}
show: partner_shows(size:2, at_a_fair: false, active:true, sort:end_at_asc) {
cover_image {
cropped(width: 150, height: 104) {
url
}
}
href
name
start_at
end_at
}
}
""" | Switch exclude_fair_booths param to match an updated Gravity API | Switch exclude_fair_booths param to match an updated Gravity API
| CoffeeScript | mit | xtina-starr/force,kanaabe/force,cavvia/force-1,oxaudo/force,damassi/force,kanaabe/force,artsy/force-public,anandaroop/force,anandaroop/force,joeyAghion/force,cavvia/force-1,izakp/force,mzikherman/force,joeyAghion/force,damassi/force,eessex/force,cavvia/force-1,mzikherman/force,kanaabe/force,mzikherman/force,xtina-starr/force,kanaabe/force,joeyAghion/force,kanaabe/force,yuki24/force,dblock/force,yuki24/force,yuki24/force,artsy/force,izakp/force,anandaroop/force,mzikherman/force,dblock/force,xtina-starr/force,artsy/force,xtina-starr/force,anandaroop/force,dblock/force,erikdstock/force,artsy/force,eessex/force,izakp/force,erikdstock/force,erikdstock/force,yuki24/force,oxaudo/force,artsy/force,eessex/force,oxaudo/force,cavvia/force-1,damassi/force,erikdstock/force,artsy/force-public,eessex/force,joeyAghion/force,izakp/force,oxaudo/force,damassi/force |
121992a0266035d0186b3f3348bd4bfd6dfb1daa | src/components/qa/exercise-card.cjsx | src/components/qa/exercise-card.cjsx | _ = require 'underscore'
React = require 'react'
classnames = require 'classnames'
{ExerciseStore} = require '../../flux/exercise'
String = require '../../helpers/string'
{ExercisePreview} = require 'openstax-react-components'
Exercise = React.createClass
propTypes:
exercise: React.PropTypes.object.isRequired
ignoredTypes: React.PropTypes.object.isRequired
renderHeader: (types) ->
<div className='types'>
{for type in types
className = classnames(type, {'is-ignored': @props.ignoredTypes[type]})
<span key={type} className={className}>{String.titleize(type)}</span>}
</div>
render: ->
{exercise, ignoredTypes, show2StepPreview} = @props
types = ExerciseStore.getExerciseTypes(exercise)
return null if _.every( types, (pt) -> ignoredTypes[pt] )
editUrl = exercise.url.replace(/@\d+/, '@draft')
doQuestionsHaveFormat = ExerciseStore.doQuestionsHaveFormat('free-response', {exercise})
if show2StepPreview
freeResponse = _.map doQuestionsHaveFormat, (hasFreeResponse) ->
<div className='exercise-free-response-preview'/> if hasFreeResponse
<ExercisePreview {...@props}
className='exercise'
header={@renderHeader(types)}
questionFooters={freeResponse}
displayAllTags
displayFeedback
>
<a target="_blank" className="edit-link" href={editUrl}>edit</a>
</ExercisePreview>
module.exports = Exercise
| _ = require 'underscore'
React = require 'react'
classnames = require 'classnames'
{ExerciseStore} = require '../../flux/exercise'
String = require '../../helpers/string'
{ExercisePreview} = require 'openstax-react-components'
Exercise = React.createClass
propTypes:
exercise: React.PropTypes.object.isRequired
ignoredTypes: React.PropTypes.object.isRequired
renderHeader: (types) ->
<div className='types'>
{for type in types
className = classnames(type, {'is-ignored': @props.ignoredTypes[type]})
<span key={type} className={className}>{String.titleize(type)}</span>}
</div>
render: ->
{exercise, ignoredTypes, show2StepPreview} = @props
types = ExerciseStore.getExerciseTypes(exercise)
return null if _.any(types) and _.every( types, (pt) -> ignoredTypes[pt] )
editUrl = exercise.url.replace(/@\d+/, '@draft')
doQuestionsHaveFormat = ExerciseStore.doQuestionsHaveFormat('free-response', {exercise})
if show2StepPreview
freeResponse = _.map doQuestionsHaveFormat, (hasFreeResponse) ->
<div className='exercise-free-response-preview'/> if hasFreeResponse
<ExercisePreview {...@props}
className='exercise'
header={@renderHeader(types)}
questionFooters={freeResponse}
displayAllTags
displayFeedback
>
<a target="_blank" className="edit-link" href={editUrl}>edit</a>
</ExercisePreview>
module.exports = Exercise
| Fix bug where untagged exercises would not render | Fix bug where untagged exercises would not render
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
b125565776a7a502637e54e9691d15ef06b0496b | 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
getModel: -> @model
setModel: (@model) ->
view = @model.getItemView()
@appendChild(view)
callAttachHooks(view) # for backward compatibility with SpacePen views
@classList.add(@model.getClassName().split(' ')...) if @model.getClassName()?
@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)
@classList.add(@model.getClassName().split(' ')...) if @model.getClassName()?
@subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this))
@subscriptions.add @model.onDidDestroy(@destroyed.bind(this))
attachedCallback: ->
callAttachHooks(@model.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
| Call space pen attach hooks after attached | Call space pen attach hooks after attached
| CoffeeScript | mit | decaffeinate-examples/atom,tisu2tisu/atom,gzzhanghao/atom,isghe/atom,acontreras89/atom,wiggzz/atom,ashneo76/atom,helber/atom,boomwaiza/atom,yomybaby/atom,yalexx/atom,codex8/atom,yamhon/atom,mostafaeweda/atom,Abdillah/atom,seedtigo/atom,darwin/atom,basarat/atom,fang-yufeng/atom,ardeshirj/atom,charleswhchan/atom,0x73/atom,woss/atom,bcoe/atom,helber/atom,me-benni/atom,FoldingText/atom,bj7/atom,einarmagnus/atom,NunoEdgarGub1/atom,ObviouslyGreen/atom,hpham04/atom,scv119/atom,bencolon/atom,gontadu/atom,gisenberg/atom,Rodjana/atom,jjz/atom,florianb/atom,fang-yufeng/atom,bryonwinger/atom,Mokolea/atom,russlescai/atom,Dennis1978/atom,GHackAnonymous/atom,seedtigo/atom,yomybaby/atom,kc8wxm/atom,AlexxNica/atom,fedorov/atom,fscherwi/atom,ivoadf/atom,ardeshirj/atom,vjeux/atom,tmunro/atom,t9md/atom,h0dgep0dge/atom,Rychard/atom,n-riesco/atom,Dennis1978/atom,pombredanne/atom,efatsi/atom,bencolon/atom,davideg/atom,ivoadf/atom,Klozz/atom,me6iaton/atom,hagb4rd/atom,scippio/atom,tisu2tisu/atom,rjattrill/atom,lisonma/atom,charleswhchan/atom,kaicataldo/atom,jacekkopecky/atom,bj7/atom,isghe/atom,jtrose2/atom,fedorov/atom,davideg/atom,ykeisuke/atom,synaptek/atom,Arcanemagus/atom,palita01/atom,gisenberg/atom,folpindo/atom,rjattrill/atom,nrodriguez13/atom,abcP9110/atom,basarat/atom,avdg/atom,cyzn/atom,matthewclendening/atom,atom/atom,kdheepak89/atom,fedorov/atom,anuwat121/atom,tjkr/atom,andrewleverette/atom,kjav/atom,deoxilix/atom,qskycolor/atom,originye/atom,rmartin/atom,devmario/atom,DiogoXRP/atom,chfritz/atom,mrodalgaard/atom,sotayamashita/atom,ppamorim/atom,hellendag/atom,ralphtheninja/atom,jacekkopecky/atom,Hasimir/atom,MjAbuz/atom,deoxilix/atom,gzzhanghao/atom,Austen-G/BlockBuilder,Andrey-Pavlov/atom,mostafaeweda/atom,kjav/atom,splodingsocks/atom,sillvan/atom,n-riesco/atom,Mokolea/atom,kc8wxm/atom,yomybaby/atom,bsmr-x-script/atom,yangchenghu/atom,h0dgep0dge/atom,bolinfest/atom,tony612/atom,rsvip/aTom,svanharmelen/atom,woss/atom,liuxiong332/atom,MjAbuz/atom,yangchenghu/atom,devoncarew/atom,toqz/atom,bryonwinger/atom,NunoEdgarGub1/atom,PKRoma/atom,alexandergmann/atom,chengky/atom,codex8/atom,sebmck/atom,amine7536/atom,rsvip/aTom,synaptek/atom,abcP9110/atom,Jandersoft/atom,tanin47/atom,Jandersoft/atom,rxkit/atom,dkfiresky/atom,mostafaeweda/atom,gabrielPeart/atom,vinodpanicker/atom,johnhaley81/atom,vinodpanicker/atom,Jandersolutions/atom,abcP9110/atom,rookie125/atom,splodingsocks/atom,t9md/atom,charleswhchan/atom,daxlab/atom,einarmagnus/atom,Galactix/atom,hpham04/atom,medovob/atom,mostafaeweda/atom,AdrianVovk/substance-ide,folpindo/atom,lovesnow/atom,dsandstrom/atom,burodepeper/atom,darwin/atom,jtrose2/atom,alfredxing/atom,qiujuer/atom,Huaraz2/atom,johnrizzo1/atom,sxgao3001/atom,chengky/atom,yalexx/atom,codex8/atom,originye/atom,lovesnow/atom,yalexx/atom,kdheepak89/atom,liuderchi/atom,harshdattani/atom,Jandersolutions/atom,n-riesco/atom,FoldingText/atom,jeremyramin/atom,toqz/atom,mertkahyaoglu/atom,Ju2ender/atom,qiujuer/atom,tony612/atom,kevinrenaers/atom,Huaraz2/atom,codex8/atom,Rodjana/atom,rookie125/atom,Sangaroonaom/atom,gisenberg/atom,sekcheong/atom,johnrizzo1/atom,bsmr-x-script/atom,YunchengLiao/atom,jjz/atom,cyzn/atom,BogusCurry/atom,omarhuanca/atom,panuchart/atom,dijs/atom,vjeux/atom,hharchani/atom,wiggzz/atom,ironbox360/atom,lovesnow/atom,john-kelly/atom,brettle/atom,devoncarew/atom,jeremyramin/atom,jlord/atom,xream/atom,florianb/atom,decaffeinate-examples/atom,DiogoXRP/atom,paulcbetts/atom,mertkahyaoglu/atom,ardeshirj/atom,vcarrera/atom,h0dgep0dge/atom,rsvip/aTom,crazyquark/atom,Abdillah/atom,qskycolor/atom,kevinrenaers/atom,prembasumatary/atom,KENJU/atom,sillvan/atom,batjko/atom,mnquintana/atom,Jandersolutions/atom,brumm/atom,kjav/atom,kaicataldo/atom,liuderchi/atom,h0dgep0dge/atom,Neron-X5/atom,fredericksilva/atom,sekcheong/atom,jacekkopecky/atom,dkfiresky/atom,nucked/atom,sekcheong/atom,isghe/atom,anuwat121/atom,kandros/atom,hpham04/atom,pombredanne/atom,oggy/atom,bryonwinger/atom,yomybaby/atom,AlisaKiatkongkumthon/atom,palita01/atom,ReddTea/atom,crazyquark/atom,Mokolea/atom,FoldingText/atom,matthewclendening/atom,devmario/atom,fscherwi/atom,transcranial/atom,ilovezy/atom,Austen-G/BlockBuilder,hpham04/atom,ezeoleaf/atom,jjz/atom,jlord/atom,kittens/atom,RobinTec/atom,YunchengLiao/atom,Andrey-Pavlov/atom,paulcbetts/atom,vcarrera/atom,RobinTec/atom,vhutheesing/atom,decaffeinate-examples/atom,jeremyramin/atom,ali/atom,tmunro/atom,woss/atom,prembasumatary/atom,ralphtheninja/atom,tjkr/atom,lisonma/atom,Galactix/atom,crazyquark/atom,abcP9110/atom,phord/atom,Jandersolutions/atom,YunchengLiao/atom,g2p/atom,boomwaiza/atom,Arcanemagus/atom,targeter21/atom,fang-yufeng/atom,bryonwinger/atom,jjz/atom,sotayamashita/atom,russlescai/atom,CraZySacX/atom,dkfiresky/atom,Shekharrajak/atom,acontreras89/atom,G-Baby/atom,florianb/atom,batjko/atom,omarhuanca/atom,SlimeQ/atom,rlugojr/atom,ashneo76/atom,charleswhchan/atom,abcP9110/atom,hharchani/atom,jlord/atom,stuartquin/atom,GHackAnonymous/atom,ilovezy/atom,amine7536/atom,niklabh/atom,isghe/atom,Jandersoft/atom,g2p/atom,hellendag/atom,me6iaton/atom,Austen-G/BlockBuilder,AlbertoBarrago/atom,rxkit/atom,bolinfest/atom,jjz/atom,batjko/atom,ReddTea/atom,kittens/atom,ali/atom,Andrey-Pavlov/atom,alfredxing/atom,fang-yufeng/atom,pkdevbox/atom,matthewclendening/atom,constanzaurzua/atom,Rodjana/atom,fscherwi/atom,Austen-G/BlockBuilder,Jonekee/atom,vhutheesing/atom,Hasimir/atom,gabrielPeart/atom,svanharmelen/atom,johnhaley81/atom,brumm/atom,SlimeQ/atom,atom/atom,vjeux/atom,deepfox/atom,sebmck/atom,jacekkopecky/atom,RuiDGoncalves/atom,kc8wxm/atom,Jandersoft/atom,hpham04/atom,mostafaeweda/atom,0x73/atom,john-kelly/atom,codex8/atom,boomwaiza/atom,daxlab/atom,kc8wxm/atom,Jdesk/atom,Hasimir/atom,RuiDGoncalves/atom,deepfox/atom,sillvan/atom,gontadu/atom,nrodriguez13/atom,constanzaurzua/atom,hakatashi/atom,matthewclendening/atom,Jonekee/atom,hharchani/atom,sillvan/atom,dsandstrom/atom,chengky/atom,t9md/atom,deepfox/atom,tjkr/atom,Shekharrajak/atom,GHackAnonymous/atom,rmartin/atom,kjav/atom,yangchenghu/atom,kc8wxm/atom,stuartquin/atom,qiujuer/atom,liuxiong332/atom,toqz/atom,Ingramz/atom,hagb4rd/atom,basarat/atom,lisonma/atom,oggy/atom,mertkahyaoglu/atom,stinsonga/atom,rsvip/aTom,charleswhchan/atom,jordanbtucker/atom,scv119/atom,tanin47/atom,einarmagnus/atom,hharchani/atom,targeter21/atom,ali/atom,lovesnow/atom,mdumrauf/atom,nucked/atom,Ju2ender/atom,sxgao3001/atom,Huaraz2/atom,avdg/atom,KENJU/atom,splodingsocks/atom,tisu2tisu/atom,lisonma/atom,davideg/atom,kevinrenaers/atom,targeter21/atom,Klozz/atom,basarat/atom,KENJU/atom,mnquintana/atom,Ju2ender/atom,omarhuanca/atom,bcoe/atom,liuderchi/atom,batjko/atom,RobinTec/atom,toqz/atom,AlisaKiatkongkumthon/atom,acontreras89/atom,hagb4rd/atom,G-Baby/atom,ezeoleaf/atom,medovob/atom,ReddTea/atom,FIT-CSE2410-A-Bombs/atom,Jdesk/atom,devoncarew/atom,kjav/atom,Galactix/atom,chengky/atom,amine7536/atom,YunchengLiao/atom,FIT-CSE2410-A-Bombs/atom,pombredanne/atom,nvoron23/atom,sxgao3001/atom,n-riesco/atom,qiujuer/atom,rmartin/atom,rxkit/atom,gabrielPeart/atom,pombredanne/atom,Locke23rus/atom,Ju2ender/atom,dkfiresky/atom,ezeoleaf/atom,nvoron23/atom,kittens/atom,Jandersolutions/atom,russlescai/atom,Galactix/atom,lovesnow/atom,bcoe/atom,sillvan/atom,nucked/atom,ironbox360/atom,fredericksilva/atom,liuderchi/atom,burodepeper/atom,crazyquark/atom,PKRoma/atom,AlisaKiatkongkumthon/atom,folpindo/atom,dkfiresky/atom,alfredxing/atom,brettle/atom,nvoron23/atom,Abdillah/atom,Klozz/atom,andrewleverette/atom,panuchart/atom,stinsonga/atom,me6iaton/atom,kittens/atom,kittens/atom,prembasumatary/atom,MjAbuz/atom,efatsi/atom,chfritz/atom,dannyflax/atom,ali/atom,hagb4rd/atom,xream/atom,ObviouslyGreen/atom,Abdillah/atom,vjeux/atom,ralphtheninja/atom,sekcheong/atom,AdrianVovk/substance-ide,lpommers/atom,dannyflax/atom,lisonma/atom,vcarrera/atom,001szymon/atom,sxgao3001/atom,hakatashi/atom,constanzaurzua/atom,ironbox360/atom,ilovezy/atom,cyzn/atom,rlugojr/atom,vinodpanicker/atom,mdumrauf/atom,tony612/atom,bj7/atom,woss/atom,dannyflax/atom,omarhuanca/atom,Jandersoft/atom,sekcheong/atom,omarhuanca/atom,Neron-X5/atom,me-benni/atom,avdg/atom,Jdesk/atom,targeter21/atom,vcarrera/atom,fredericksilva/atom,Abdillah/atom,qskycolor/atom,deepfox/atom,dsandstrom/atom,mnquintana/atom,seedtigo/atom,kdheepak89/atom,Jdesk/atom,0x73/atom,FoldingText/atom,ilovezy/atom,jordanbtucker/atom,Shekharrajak/atom,einarmagnus/atom,DiogoXRP/atom,pkdevbox/atom,wiggzz/atom,fedorov/atom,Neron-X5/atom,stuartquin/atom,prembasumatary/atom,panuchart/atom,johnrizzo1/atom,beni55/atom,transcranial/atom,me6iaton/atom,ezeoleaf/atom,jtrose2/atom,hagb4rd/atom,russlescai/atom,Hasimir/atom,matthewclendening/atom,YunchengLiao/atom,Arcanemagus/atom,john-kelly/atom,pengshp/atom,tony612/atom,acontreras89/atom,AlexxNica/atom,ObviouslyGreen/atom,davideg/atom,russlescai/atom,synaptek/atom,oggy/atom,targeter21/atom,lpommers/atom,NunoEdgarGub1/atom,pkdevbox/atom,dannyflax/atom,bencolon/atom,bolinfest/atom,fang-yufeng/atom,Austen-G/BlockBuilder,lpommers/atom,vcarrera/atom,alexandergmann/atom,qskycolor/atom,deepfox/atom,splodingsocks/atom,Rychard/atom,Ingramz/atom,Andrey-Pavlov/atom,brumm/atom,FoldingText/atom,vjeux/atom,darwin/atom,champagnez/atom,burodepeper/atom,originye/atom,jordanbtucker/atom,Dennis1978/atom,elkingtonmcb/atom,liuxiong332/atom,rmartin/atom,me6iaton/atom,SlimeQ/atom,efatsi/atom,basarat/atom,medovob/atom,NunoEdgarGub1/atom,rookie125/atom,SlimeQ/atom,MjAbuz/atom,hellendag/atom,mnquintana/atom,jacekkopecky/atom,NunoEdgarGub1/atom,daxlab/atom,Hasimir/atom,dsandstrom/atom,harshdattani/atom,mnquintana/atom,oggy/atom,0x73/atom,john-kelly/atom,scippio/atom,vinodpanicker/atom,yamhon/atom,elkingtonmcb/atom,ivoadf/atom,transcranial/atom,ashneo76/atom,G-Baby/atom,bcoe/atom,ilovezy/atom,dijs/atom,dsandstrom/atom,Sangaroonaom/atom,ppamorim/atom,jlord/atom,mertkahyaoglu/atom,elkingtonmcb/atom,chengky/atom,gontadu/atom,GHackAnonymous/atom,mrodalgaard/atom,woss/atom,Locke23rus/atom,hakatashi/atom,deoxilix/atom,yalexx/atom,Ju2ender/atom,yalexx/atom,ppamorim/atom,yomybaby/atom,dannyflax/atom,bcoe/atom,Neron-X5/atom,constanzaurzua/atom,amine7536/atom,basarat/atom,johnhaley81/atom,Locke23rus/atom,KENJU/atom,yamhon/atom,gzzhanghao/atom,pengshp/atom,vhutheesing/atom,kandros/atom,ppamorim/atom,jtrose2/atom,jlord/atom,palita01/atom,Ingramz/atom,chfritz/atom,fredericksilva/atom,scv119/atom,andrewleverette/atom,sxgao3001/atom,FIT-CSE2410-A-Bombs/atom,fredericksilva/atom,001szymon/atom,champagnez/atom,qskycolor/atom,GHackAnonymous/atom,stinsonga/atom,Shekharrajak/atom,florianb/atom,devmario/atom,AdrianVovk/substance-ide,rjattrill/atom,Sangaroonaom/atom,paulcbetts/atom,paulcbetts/atom,Galactix/atom,sotayamashita/atom,nvoron23/atom,rjattrill/atom,champagnez/atom,mrodalgaard/atom,hakatashi/atom,davideg/atom,RobinTec/atom,MjAbuz/atom,decaffeinate-examples/atom,pengshp/atom,devmario/atom,BogusCurry/atom,john-kelly/atom,tmunro/atom,acontreras89/atom,me-benni/atom,phord/atom,Austen-G/BlockBuilder,brettle/atom,harshdattani/atom,svanharmelen/atom,amine7536/atom,rmartin/atom,AlbertoBarrago/atom,bsmr-x-script/atom,hharchani/atom,einarmagnus/atom,Rychard/atom,dannyflax/atom,RobinTec/atom,RuiDGoncalves/atom,vinodpanicker/atom,qiujuer/atom,prembasumatary/atom,ReddTea/atom,scippio/atom,scv119/atom,isghe/atom,niklabh/atom,ppamorim/atom,devoncarew/atom,jtrose2/atom,AlbertoBarrago/atom,kaicataldo/atom,Jdesk/atom,PKRoma/atom,SlimeQ/atom,nvoron23/atom,xream/atom,g2p/atom,niklabh/atom,liuxiong332/atom,n-riesco/atom,crazyquark/atom,001szymon/atom,ykeisuke/atom,alexandergmann/atom,Jonekee/atom,beni55/atom,florianb/atom,sebmck/atom,anuwat121/atom,fedorov/atom,AlexxNica/atom,nrodriguez13/atom,FoldingText/atom,constanzaurzua/atom,atom/atom,gisenberg/atom,liuxiong332/atom,synaptek/atom,CraZySacX/atom,devoncarew/atom,sebmck/atom,CraZySacX/atom,KENJU/atom,Andrey-Pavlov/atom,pombredanne/atom,oggy/atom,ykeisuke/atom,ali/atom,phord/atom,helber/atom,BogusCurry/atom,tony612/atom,devmario/atom,ReddTea/atom,synaptek/atom,kdheepak89/atom,dijs/atom,batjko/atom,stinsonga/atom,rsvip/aTom,mertkahyaoglu/atom,Neron-X5/atom,sebmck/atom,tanin47/atom,Shekharrajak/atom,jacekkopecky/atom,toqz/atom,beni55/atom,gisenberg/atom,kdheepak89/atom,kandros/atom,mdumrauf/atom,rlugojr/atom |
fa6cb3e7a896270bc2a32a1f4f45b545096c2c80 | components/inquiry_questionnaire/views/specialist.coffee | components/inquiry_questionnaire/views/specialist.coffee | Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
@__representatives__ = @representatives.fetch()
.then => (@representative = @representatives.first())?.fetch()
.then =>
@render().$el.removeClass 'is-loading'
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
| Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
@__representatives__ = Q @representatives.fetch()
.then => Q (@representative = @representatives.first())?.fetch()
.finally => @done()
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
done: ->
@render().$el.removeClass 'is-loading'
| Make representative fetch more resilient to API errors (probably only relevant for staging) | Make representative fetch more resilient to API errors (probably only relevant for staging)
| CoffeeScript | mit | mzikherman/force,artsy/force,cavvia/force-1,xtina-starr/force,kanaabe/force,oxaudo/force,xtina-starr/force,anandaroop/force,eessex/force,kanaabe/force,mzikherman/force,cavvia/force-1,xtina-starr/force,dblock/force,damassi/force,oxaudo/force,artsy/force,erikdstock/force,izakp/force,yuki24/force,joeyAghion/force,izakp/force,dblock/force,oxaudo/force,damassi/force,cavvia/force-1,eessex/force,kanaabe/force,damassi/force,cavvia/force-1,damassi/force,oxaudo/force,izakp/force,xtina-starr/force,yuki24/force,dblock/force,erikdstock/force,kanaabe/force,erikdstock/force,joeyAghion/force,mzikherman/force,erikdstock/force,eessex/force,artsy/force-public,mzikherman/force,kanaabe/force,joeyAghion/force,anandaroop/force,artsy/force-public,izakp/force,eessex/force,anandaroop/force,yuki24/force,artsy/force,artsy/force,yuki24/force,anandaroop/force,joeyAghion/force |
3be55e0dae3b8bc875105691e023ee93c50744e3 | lib/sort-lines.coffee | lib/sort-lines.coffee | RangeFinder = require './range-finder'
module.exports =
activate: (state) ->
atom.workspaceView.command 'sort-lines:sort', '.editor', =>
editor = atom.workspaceView.getActivePaneItem()
@sortLines(editor)
sortLines: (editor) ->
lineRanges = RangeFinder.rangesFor(editor)
lineRanges.forEach (lineRange) ->
textLines = editor.getTextInBufferRange(lineRange).split("\n")
textLines.sort (a, b) -> a.localeCompare(b)
editor.setTextInBufferRange(lineRange, textLines.join("\n"))
| RangeFinder = require './range-finder'
module.exports =
activate: (state) ->
atom.workspaceView.command 'sort-lines:sort', '.editor', =>
editor = atom.workspaceView.getActivePaneItem()
@sortLines(editor)
sortLines: (editor) ->
sortableRanges = RangeFinder.rangesFor(editor)
sortableRanges.forEach (range) ->
textLines = editor.getTextInBufferRange(range).split("\n")
textLines.sort (a, b) -> a.localeCompare(b)
editor.setTextInBufferRange(range, textLines.join("\n"))
| Rename variable to increase clarity | Rename variable to increase clarity
| CoffeeScript | mit | garethbjohnson/sort-css,atom/sort-lines |
7f59fe825d4967af85b6566245b7d71bef5bb7c3 | atom/config.cson | atom/config.cson | "*":
editor:
fontFamily: "input"
fontSize: 13
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"one-dark-ui"
"atom-dark-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"highlight-line":
hideHighlightOnSelect: true
| "*":
editor:
fontFamily: "input"
fontSize: 13
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"one-dark-ui"
"facebook-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"highlight-line":
hideHighlightOnSelect: true
| Use Facebook syntax in Atom | Use Facebook syntax in Atom
| CoffeeScript | mit | therealechan/dotfiles,chankaward/dotfiles,therealechan/dotfiles,therealechan/dotfiles,chankaward/dotfiles,chankaward/dotfiles |
7397615e2824422bba6566319ffe40a5fecefb8a | app/assets/javascripts/neighborly/rewards/index.js.coffee | app/assets/javascripts/neighborly/rewards/index.js.coffee | Neighborly.Rewards = {} if Neighborly.Rewards is undefined
Neighborly.Rewards.Index = Backbone.View.extend
el: '.rewards'
initialize: ->
this.$rewards = $(this.el)
this.load()
this.sortable()
load: ->
that = this
$.ajax(
url: that.$rewards.data("rewards-path")
success: (data) ->
$(that.el).html data
)
sortable: ->
that = this
if this.$rewards.data("can-update") is true
this.$rewards.sortable
axis: "y"
placeholder: "sortable-highlight"
start: (e, ui) ->
ui.placeholder.height ui.item.height()
stop: (e, ui) ->
ui.item.effect "highlight", {}, 1000
update: (e, ui) ->
csrfToken = undefined
position = undefined
position = that.$rewards.childrend('.sortable').index(ui.item)
csrfToken = $("meta[name='csrf-token']").attr("content")
$.ajax
type: "POST"
url: ui.item.data("update-path")
dataType: "json"
headers:
"X-CSRF-Token": csrfToken
data:
reward:
row_order_position: position
| Neighborly.Rewards = {} if Neighborly.Rewards is undefined
Neighborly.Rewards.Index = Backbone.View.extend
el: '.rewards'
initialize: ->
this.$rewards = $(this.el)
this.load()
this.sortable()
load: ->
that = this
$.ajax(
url: that.$rewards.data("rewards-path")
success: (data) ->
$(that.el).html data
)
sortable: ->
that = this
if this.$rewards.data("can-update") is true
this.$rewards.sortable
axis: "y"
placeholder: "sortable-highlight"
start: (e, ui) ->
ui.placeholder.height ui.item.height()
stop: (e, ui) ->
ui.item.effect "highlight", {}, 1000
update: (e, ui) ->
csrfToken = undefined
position = undefined
position = that.$rewards.find('.sortable').index(ui.item)
csrfToken = $("meta[name='csrf-token']").attr("content")
$.ajax
type: "POST"
url: ui.item.data("update-path")
dataType: "json"
headers:
"X-CSRF-Token": csrfToken
data:
reward:
row_order_position: position
| Replace childrend by find in jquery | Replace childrend by find in jquery
| CoffeeScript | mit | jinutm/silveralms.com,jinutm/silvfinal,MicroPasts/micropasts-crowdfunding,jinutm/silverprod,jinutm/silverprod,jinutm/silvfinal,raksonibs/raimcrowd,jinutm/silvfinal,rockkhuya/taydantay,jinutm/silveralms.com,jinutm/silverpro,jinutm/silverclass,jinutm/silverpro,jinutm/silverprod,raksonibs/raimcrowd,jinutm/silveralms.com,rockkhuya/taydantay,jinutm/silverme,jinutm/silverme,jinutm/silverme,jinutm/silverclass,raksonibs/raimcrowd,MicroPasts/micropasts-crowdfunding,gustavoguichard/neighborly,rockkhuya/taydantay,raksonibs/raimcrowd,MicroPasts/micropasts-crowdfunding,jinutm/silverpro,gustavoguichard/neighborly,jinutm/silverclass,gustavoguichard/neighborly,MicroPasts/micropasts-crowdfunding |
429ebe39ad482764ee04895bced9b8f3997831e0 | app/assets/javascripts/routes/paper_index_route.js.coffee | app/assets/javascripts/routes/paper_index_route.js.coffee | ETahi.PaperIndexRoute = Ember.Route.extend
afterModel: (model) ->
@transitionTo('paper.edit', model) unless model.get('submitted')
actions:
viewCard: (task) ->
paper = @modelFor('paper')
redirectParams = ['paper.index', @modelFor('paper')]
@controllerFor('application').set('overlayRedirect', redirectParams)
@controllerFor('application').set('overlayBackground', 'paper/index')
@transitionTo('task', paper.id, task.id)
| ETahi.PaperIndexRoute = Ember.Route.extend
afterModel: (model) ->
@transitionTo('paper.edit', model) unless model.get('submitted')
setupController: (controller, model) ->
controller.set('model', model)
controller.set 'authors', @store.all('author').filter (author) =>
author.get('authorGroup.paper') == model
actions:
viewCard: (task) ->
paper = @modelFor('paper')
redirectParams = ['paper.index', @modelFor('paper')]
@controllerFor('application').set('overlayRedirect', redirectParams)
@controllerFor('application').set('overlayBackground', 'paper/index')
@transitionTo('task', paper.id, task.id)
| Add setupController hook to paper index route | Add setupController hook to paper index route | CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi |
0f71c7e8d0f83524436061457aa1cc4bb2c1127f | client/lanes/Config.coffee | client/lanes/Config.coffee | class SystemSettings extends Lanes.Models.Base
mixins: [ Lanes.Models.Mixins.FileSupport ]
props:
id: {type:"integer"}
logo: "file"
settings: {type: "object", required: true}
modelTypeIdentifier: -> 'system-settings'
url: -> Lanes.config.api_path + '/system-settings'
initialize: ->
@settings ||= {}
@settings.lanes || = {}
class Config extends Lanes.Models.State
session:
csrf_token: { type: 'string', setOnce: true }
api_path: { type: 'string', setOnce: true }
assets_path_prefix: { type: 'string', setOnce: true }
environment: { type: 'string', setOnce: true }
initial_workspace_screen_id: { type: 'string', setOnce: true }
system_settings: { type: 'state', required: true }
derived:
env:
deps: ['environment'], fn: ->
{
test: this.environment == 'test',
development: this.environment == 'development',
production: this.environment == 'production'
}
initialize: ->
@system_settings = new SystemSettings
bootstrap: (options) ->
if options.system_settings
@system_settings.set(options.system_settings)
delete options.system_settings
@set(options)
Lanes.Extensions.setBootstrapData(options) if _.isObject(options)
Lanes.config = new Config
| class SystemSettings extends Lanes.Models.Base
mixins: [ Lanes.Models.Mixins.FileSupport ]
props:
id: {type:"integer"}
logo: "file"
settings: {type: "object", required: true}
modelTypeIdentifier: -> 'system-settings'
url: -> Lanes.config.api_path + '/system-settings'
initialize: ->
@on('change:settings', @setDefaultSettings)
@setDefaultSettings()
setDefaultSettings: ->
@settings ||= {}
@settings.lanes || = {}
class Config extends Lanes.Models.State
session:
csrf_token: { type: 'string', setOnce: true }
api_path: { type: 'string', setOnce: true }
assets_path_prefix: { type: 'string', setOnce: true }
environment: { type: 'string', setOnce: true }
initial_workspace_screen_id: { type: 'string', setOnce: true }
system_settings: { type: 'state', required: true }
derived:
env:
deps: ['environment'], fn: ->
{
test: this.environment == 'test',
development: this.environment == 'development',
production: this.environment == 'production'
}
initialize: ->
@system_settings = new SystemSettings
bootstrap: (options) ->
if options.system_settings
@system_settings.set(options.system_settings)
delete options.system_settings
@set(options)
Lanes.Extensions.setBootstrapData(options) if _.isObject(options)
Lanes.config = new Config
| Make sure "lanes" config is still present after set | Make sure "lanes" config is still present after set
| CoffeeScript | mit | argosity/lanes,argosity/lanes,argosity/hippo,argosity/hippo,argosity/hippo,argosity/lanes |
525a064830e833a495fe6a0f204ae74d019fb177 | ui/app/scripts/services/Channel.coffee | ui/app/scripts/services/Channel.coffee | 'use strict'
angular.module('uiApp')
.factory 'Channel', ($q, $callback, $rootScope, Config) ->
Channel = {}
ChannelObject = (socket) ->
@socket = socket
me = this
@socket.onmessage = (e) ->
me.onMessage(e)
@matrix = {}
this
ChannelObject::send = (data) ->
dfd = $callback.defer()
id = _.uniqueId()
@matrix[id] = dfd
payload = angular.extend(data, id: id)
@socket.send(angular.toJson(payload))
dfd.promise
ChannelObject::onMessage = (e) ->
packet = angular.fromJson(e.data)
id = packet.id
matrix = @matrix
$rootScope.$apply () ->
matrix[id].notify(packet)
channelDeferred = $callback.defer()
Channel.connected = () ->
channelDeferred.promise
getConfig = () ->
dfd = $q.defer()
Config.get().then (data) ->
dfd.resolve(data.api_server)
dfd.promise
connect = (url) ->
socket = new WebSocket(url)
socket.onclose = () ->
setTimeout((->
connect(url)
), 1000)
socket.onopen = () ->
channel = new ChannelObject(socket)
channelDeferred.notify(channel)
getConfig().then (url) ->
connect(url)
Channel
| 'use strict'
angular.module('uiApp')
.factory 'Channel', ($q, $callback, $rootScope, Config) ->
Channel = {}
ChannelObject = (socket) ->
@socket = socket
me = this
@socket.onmessage = (e) ->
me.onMessage(e)
@matrix = {}
this
ChannelObject::send = (data) ->
dfd = $callback.defer()
id = _.uniqueId()
@matrix[id] = dfd
payload = angular.extend(data, id: id)
@socket.send(angular.toJson(payload))
dfd.promise
ChannelObject::onMessage = (e) ->
packet = angular.fromJson(e.data)
id = packet.id
matrix = @matrix
$rootScope.$apply () ->
matrix[id].notify(packet)
channelDeferred = $q.defer()
Channel.connected = () ->
channelDeferred.promise
getConfig = () ->
dfd = $q.defer()
Config.get().then (data) ->
dfd.resolve(data.api_server)
dfd.promise
connect = (url) ->
socket = new WebSocket(url)
socket.onopen = () ->
channel = new ChannelObject(socket)
channelDeferred.resolve(channel)
getConfig().then (url) ->
connect(url)
Channel
| Remove channel reconnection as it causes problems | Remove channel reconnection as it causes problems
| CoffeeScript | mit | elhypnotoad/hypnotoad,atsuyim/hypnotoad,atsuyim/hypnotoad,elhypnotoad/hypnotoad,atsuyim/hypnotoad |
c8c9cf7db517e0c27bbad851c6be6ff9ee19e331 | packages/rocketchat-oembed/client/oembedUrlWidget.coffee | packages/rocketchat-oembed/client/oembedUrlWidget.coffee | Template.oembedUrlWidget.helpers
description: ->
if not this.meta?
return
return this.meta.ogDescription or this.meta.twitterDescription or this.meta.description
title: ->
if not this.meta?
return
return this.meta.ogTitle or this.meta.twitterTitle or this.meta.title or this.meta.pageTitle
image: ->
if not this.meta?
return
return this.meta.ogImage or this.meta.twitterImage | Template.oembedUrlWidget.helpers
description: ->
if not this.meta?
return
description = this.meta.ogDescription or this.meta.twitterDescription or this.meta.description
if not description?
return
return description.replace /(^“)|(”$)/g, ''
title: ->
if not this.meta?
return
return this.meta.ogTitle or this.meta.twitterTitle or this.meta.title or this.meta.pageTitle
image: ->
if not this.meta?
return
return this.meta.ogImage or this.meta.twitterImage | Remove quotes from twitter oembeds | Remove quotes from twitter oembeds
| CoffeeScript | mit | igorstajic/Rocket.Chat,timkinnane/Rocket.Chat,sscpac/chat-locker,Codebrahma/Rocket.Chat,xboston/Rocket.Chat,ziedmahdi/Rocket.Chat,osxi/Rocket.Chat,ut7/Rocket.Chat,mrsimpson/Rocket.Chat,Gudii/Rocket.Chat,janmaghuyop/Rocket.Chat,hazio/Rocket.Chat,adamteece/Rocket.Chat,coreyaus/Rocket.Chat,wangleihd/Rocket.Chat,gitaboard/Rocket.Chat,marzieh312/Rocket.Chat,osxi/Rocket.Chat,LeonardOliveros/Rocket.Chat,JamesHGreen/Rocket.Chat,PavelVanecek/Rocket.Chat,I-am-Gabi/Rocket.Chat,berndsi/Rocket.Chat,acidsound/Rocket.Chat,capensisma/Rocket.Chat,jessedhillon/Rocket.Chat,flaviogrossi/Rocket.Chat,tntobias/Rocket.Chat,matthewshirley/Rocket.Chat,nishimaki10/Rocket.Chat,Deepakkothandan/Rocket.Chat,JamesHGreen/Rocket_API,icaromh/Rocket.Chat,soonahn/Rocket.Chat,galrotem1993/Rocket.Chat,Gyubin/Rocket.Chat,bt/Rocket.Chat,Kiran-Rao/Rocket.Chat,ahmadassaf/Rocket.Chat,OtkurBiz/Rocket.Chat,Jandersoft/Rocket.Chat,rasata/Rocket.Chat,mrinaldhar/Rocket.Chat,soonahn/Rocket.Chat,abduljanjua/TheHub,capensisma/Rocket.Chat,org100h1/Rocket.Panda,Maysora/Rocket.Chat,ndarilek/Rocket.Chat,snaiperskaya96/Rocket.Chat,callmekatootie/Rocket.Chat,atyenoria/Rocket.Chat,j-ew-s/Rocket.Chat,mccambridge/Rocket.Chat,uniteddiversity/Rocket.Chat,liuliming2008/Rocket.Chat,katopz/Rocket.Chat,mohamedhagag/Rocket.Chat,greatdinosaur/Rocket.Chat,acidsound/Rocket.Chat,phlkchan/Rocket.Chat,Movile/Rocket.Chat,sscpac/chat-locker,lucasgolino/Rocket.Chat,NMandapaty/Rocket.Chat,ggazzo/Rocket.Chat,amaapp/ama,OtkurBiz/Rocket.Chat,biomassives/Rocket.Chat,BorntraegerMarc/Rocket.Chat,org100h1/Rocket.Panda,jadeqwang/Rocket.Chat,adamteece/Rocket.Chat,Flitterkill/Rocket.Chat,intelradoux/Rocket.Chat,yuyixg/Rocket.Chat,glnarayanan/Rocket.Chat,himeshp/Rocket.Chat,slava-sh/Rocket.Chat,mhurwi/Rocket.Chat,pkgodara/Rocket.Chat,pitamar/Rocket.Chat,Gromby/Rocket.Chat,cdwv/Rocket.Chat,atyenoria/Rocket.Chat,qnib/Rocket.Chat,xboston/Rocket.Chat,flaviogrossi/Rocket.Chat,jadeqwang/Rocket.Chat,mohamedhagag/Rocket.Chat,AlecTroemel/Rocket.Chat,fduraibi/Rocket.Chat,liemqv/Rocket.Chat,apnero/tactixteam,wtsarchive/Rocket.Chat,wolfika/Rocket.Chat,AlecTroemel/Rocket.Chat,LearnersGuild/echo-chat,soonahn/Rocket.Chat,abduljanjua/TheHub,karlprieb/Rocket.Chat,AimenJoe/Rocket.Chat,mhurwi/Rocket.Chat,janmaghuyop/Rocket.Chat,ndarilek/Rocket.Chat,mrinaldhar/Rocket.Chat,VoiSmart/Rocket.Chat,JamesHGreen/Rocket_API,fduraibi/Rocket.Chat,tlongren/Rocket.Chat,wicked539/Rocket.Chat,glnarayanan/Rocket.Chat,litewhatever/Rocket.Chat,alexbrazier/Rocket.Chat,yuyixg/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,abduljanjua/TheHub,fduraibi/Rocket.Chat,ggazzo/Rocket.Chat,AlecTroemel/Rocket.Chat,warcode/Rocket.Chat,warcode/Rocket.Chat,Dianoga/Rocket.Chat,wicked539/Rocket.Chat,jeanmatheussouto/Rocket.Chat,xasx/Rocket.Chat,ealbers/Rocket.Chat,BHWD/noouchat,VoiSmart/Rocket.Chat,liuliming2008/Rocket.Chat,icaromh/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,Dianoga/Rocket.Chat,coreyaus/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,florinnichifiriuc/Rocket.Chat,mrinaldhar/Rocket.Chat,JamesHGreen/Rocket_API,mohamedhagag/Rocket.Chat,linnovate/hi,acaronmd/Rocket.Chat,flaviogrossi/Rocket.Chat,Gudii/Rocket.Chat,Sing-Li/Rocket.Chat,apnero/tactixteam,I-am-Gabi/Rocket.Chat,kkochubey1/Rocket.Chat,nabiltntn/Rocket.Chat,JamesHGreen/Rocket_API,sargentsurg/Rocket.Chat,danielbressan/Rocket.Chat,flaviogrossi/Rocket.Chat,Kiran-Rao/Rocket.Chat,tradetiger/Rocket.Chat,litewhatever/Rocket.Chat,christmo/Rocket.Chat,jyx140521/Rocket.Chat,lonbaker/Rocket.Chat,nrhubbar/Rocket.Chat,umeshrs/rocket-chat-integration,jeanmatheussouto/Rocket.Chat,thswave/Rocket.Chat,jyx140521/Rocket.Chat,atyenoria/Rocket.Chat,nabiltntn/Rocket.Chat,thunderrabbit/Rocket.Chat,bt/Rocket.Chat,LeonardOliveros/Rocket.Chat,xasx/Rocket.Chat,mrsimpson/Rocket.Chat,erikmaarten/Rocket.Chat,leohmoraes/Rocket.Chat,TribeMedia/Rocket.Chat,sargentsurg/Rocket.Chat,k0nsl/Rocket.Chat,berndsi/Rocket.Chat,callblueday/Rocket.Chat,ndarilek/Rocket.Chat,alexbrazier/Rocket.Chat,timkinnane/Rocket.Chat,acidsound/Rocket.Chat,ealbers/Rocket.Chat,NMandapaty/Rocket.Chat,matthewshirley/Rocket.Chat,HeapCity/Heap.City,leohmoraes/Rocket.Chat,I-am-Gabi/Rocket.Chat,Achaikos/Rocket.Chat,linnovate/hi,soonahn/Rocket.Chat,psadaic/Rocket.Chat,jbsavoy18/rocketchat-1,sikofitt/Rocket.Chat,wtsarchive/Rocket.Chat,Achaikos/Rocket.Chat,KyawNaingTun/Rocket.Chat,ndarilek/Rocket.Chat,ederribeiro/Rocket.Chat,liuliming2008/Rocket.Chat,arvi/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,marzieh312/Rocket.Chat,Movile/Rocket.Chat,haoyixin/Rocket.Chat,williamfortunademoraes/Rocket.Chat,TribeMedia/Rocket.Chat,ahmadassaf/Rocket.Chat,LearnersGuild/echo-chat,Ninotna/Rocket.Chat,nathantreid/Rocket.Chat,cnash/Rocket.Chat,osxi/Rocket.Chat,abhishekshukla0302/trico,snaiperskaya96/Rocket.Chat,umeshrs/rocket-chat,acaronmd/Rocket.Chat,galrotem1993/Rocket.Chat,freakynit/Rocket.Chat,warcode/Rocket.Chat,AimenJoe/Rocket.Chat,abhishekshukla0302/trico,amaapp/ama,Deepakkothandan/Rocket.Chat,intelradoux/Rocket.Chat,cnash/Rocket.Chat,Sing-Li/Rocket.Chat,Gyubin/Rocket.Chat,ZBoxApp/Rocket.Chat,celloudiallo/Rocket.Chat,fatihwk/Rocket.Chat,steedos/chat,steedos/chat,Gyubin/Rocket.Chat,qnib/Rocket.Chat,bopjesvla/chatmafia,jyx140521/Rocket.Chat,mwharrison/Rocket.Chat,katopz/Rocket.Chat,liemqv/Rocket.Chat,mrsimpson/Rocket.Chat,LearnersGuild/echo-chat,leohmoraes/Rocket.Chat,tlongren/Rocket.Chat,pachox/Rocket.Chat,steedos/chat,Codebrahma/Rocket.Chat,BorntraegerMarc/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,biomassives/Rocket.Chat,williamfortunademoraes/Rocket.Chat,ederribeiro/Rocket.Chat,acidicX/Rocket.Chat,HeapCity/Heap.City,Gudii/Rocket.Chat,Kiran-Rao/Rocket.Chat,liuliming2008/Rocket.Chat,sunhaolin/Rocket.Chat,BHWD/noouchat,fatihwk/Rocket.Chat,Dianoga/Rocket.Chat,Maysora/Rocket.Chat,bt/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,sikofitt/Rocket.Chat,abhishekshukla0302/trico,4thParty/Rocket.Chat,matthewshirley/Rocket.Chat,LeonardOliveros/Rocket.Chat,lukaroski/traden,hazio/Rocket.Chat,4thParty/Rocket.Chat,igorstajic/Rocket.Chat,matthewshirley/Rocket.Chat,NMandapaty/Rocket.Chat,Jandersoft/Rocket.Chat,callblueday/Rocket.Chat,jessedhillon/Rocket.Chat,Movile/Rocket.Chat,fatihwk/Rocket.Chat,sscpac/chat-locker,ealbers/Rocket.Chat,cnash/Rocket.Chat,greatdinosaur/Rocket.Chat,jbsavoy18/rocketchat-1,kkochubey1/Rocket.Chat,Ninotna/Rocket.Chat,Gyubin/Rocket.Chat,karlprieb/Rocket.Chat,lucasgolino/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,tzellman/Rocket.Chat,sargentsurg/Rocket.Chat,slava-sh/Rocket.Chat,arvi/Rocket.Chat,Flitterkill/Rocket.Chat,anhld/Rocket.Chat,ziedmahdi/Rocket.Chat,Dianoga/Rocket.Chat,thswave/Rocket.Chat,snaiperskaya96/Rocket.Chat,mhurwi/Rocket.Chat,LeonardOliveros/Rocket.Chat,lonbaker/Rocket.Chat,lukaroski/traden,intelradoux/Rocket.Chat,Jandersolutions/Rocket.Chat,webcoding/Rocket.Chat,Codebrahma/Rocket.Chat,ahmadassaf/Rocket.Chat,haoyixin/Rocket.Chat,parkmap/Rocket.Chat,snaiperskaya96/Rocket.Chat,yuyixg/Rocket.Chat,revspringjake/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,erikmaarten/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,pkgodara/Rocket.Chat,Deepakkothandan/Rocket.Chat,acaronmd/Rocket.Chat,LearnersGuild/Rocket.Chat,4thParty/Rocket.Chat,mhurwi/Rocket.Chat,ut7/Rocket.Chat,ludiculous/Rocket.Chat,glnarayanan/Rocket.Chat,ealbers/Rocket.Chat,klatys/Rocket.Chat,mrinaldhar/Rocket.Chat,kkochubey1/Rocket.Chat,JamesHGreen/Rocket.Chat,bopjesvla/chatmafia,berndsi/Rocket.Chat,Flitterkill/Rocket.Chat,j-ew-s/Rocket.Chat,psadaic/Rocket.Chat,christmo/Rocket.Chat,sunhaolin/Rocket.Chat,ederribeiro/Rocket.Chat,jeann2013/Rocket.Chat,hazio/Rocket.Chat,phlkchan/Rocket.Chat,Jandersolutions/Rocket.Chat,callblueday/Rocket.Chat,uniteddiversity/Rocket.Chat,jonathanhartman/Rocket.Chat,haoyixin/Rocket.Chat,alexbrazier/Rocket.Chat,timkinnane/Rocket.Chat,qnib/Rocket.Chat,adamteece/Rocket.Chat,gitaboard/Rocket.Chat,anhld/Rocket.Chat,ziedmahdi/Rocket.Chat,mrsimpson/Rocket.Chat,madmanteam/Rocket.Chat,tntobias/Rocket.Chat,katopz/Rocket.Chat,Maysora/Rocket.Chat,subesokun/Rocket.Chat,JamesHGreen/Rocket.Chat,pachox/Rocket.Chat,k0nsl/Rocket.Chat,ZBoxApp/Rocket.Chat,parkmap/Rocket.Chat,danielbressan/Rocket.Chat,lukaroski/traden,Gudii/Rocket.Chat,inoxth/Rocket.Chat,jonathanhartman/Rocket.Chat,bopjesvla/chatmafia,litewhatever/Rocket.Chat,ut7/Rocket.Chat,acidicX/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,OtkurBiz/Rocket.Chat,himeshp/Rocket.Chat,sunhaolin/Rocket.Chat,pitamar/Rocket.Chat,Sing-Li/Rocket.Chat,jeann2013/Rocket.Chat,wicked539/Rocket.Chat,amaapp/ama,xboston/Rocket.Chat,sikofitt/Rocket.Chat,pitamar/Rocket.Chat,TribeMedia/Rocket.Chat,freakynit/Rocket.Chat,KyawNaingTun/Rocket.Chat,parkmap/Rocket.Chat,wtsarchive/Rocket.Chat,marzieh312/Rocket.Chat,xasx/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,cnash/Rocket.Chat,PavelVanecek/Rocket.Chat,TribeMedia/Rocket.Chat,thebakeryio/Rocket.Chat,marzieh312/Rocket.Chat,thunderrabbit/Rocket.Chat,k0nsl/Rocket.Chat,JisuPark/Rocket.Chat,galrotem1993/Rocket.Chat,VoiSmart/Rocket.Chat,j-ew-s/Rocket.Chat,alenodari/Rocket.Chat,webcoding/Rocket.Chat,fduraibi/Rocket.Chat,acaronmd/Rocket.Chat,thswave/Rocket.Chat,klatys/Rocket.Chat,pitamar/Rocket.Chat,JisuPark/Rocket.Chat,bt/Rocket.Chat,ludiculous/Rocket.Chat,Achaikos/Rocket.Chat,Achaikos/Rocket.Chat,danielbressan/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,OtkurBiz/Rocket.Chat,intelradoux/Rocket.Chat,inoio/Rocket.Chat,mitar/Rocket.Chat,wangleihd/Rocket.Chat,Ninotna/Rocket.Chat,anhld/Rocket.Chat,himeshp/Rocket.Chat,arvi/Rocket.Chat,pachox/Rocket.Chat,nrhubbar/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,capensisma/Rocket.Chat,umeshrs/rocket-chat-integration,pachox/Rocket.Chat,JisuPark/Rocket.Chat,inoxth/Rocket.Chat,Gromby/Rocket.Chat,madmanteam/Rocket.Chat,xboston/Rocket.Chat,uniteddiversity/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,pkgodara/Rocket.Chat,liemqv/Rocket.Chat,ludiculous/Rocket.Chat,mitar/Rocket.Chat,alenodari/Rocket.Chat,gitaboard/Rocket.Chat,lucasgolino/Rocket.Chat,AimenJoe/Rocket.Chat,inoxth/Rocket.Chat,xasx/Rocket.Chat,inoio/Rocket.Chat,PavelVanecek/Rocket.Chat,tlongren/Rocket.Chat,Kiran-Rao/Rocket.Chat,Flitterkill/Rocket.Chat,mwharrison/Rocket.Chat,nabiltntn/Rocket.Chat,org100h1/Rocket.Panda,jonathanhartman/Rocket.Chat,danielbressan/Rocket.Chat,psadaic/Rocket.Chat,qnib/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,jbsavoy18/rocketchat-1,lonbaker/Rocket.Chat,umeshrs/rocket-chat-integration,tzellman/Rocket.Chat,freakynit/Rocket.Chat,revspringjake/Rocket.Chat,tradetiger/Rocket.Chat,florinnichifiriuc/Rocket.Chat,ggazzo/Rocket.Chat,tlongren/Rocket.Chat,cdwv/Rocket.Chat,HeapCity/Heap.City,inoio/Rocket.Chat,inoxth/Rocket.Chat,nathantreid/Rocket.Chat,celloudiallo/Rocket.Chat,tradetiger/Rocket.Chat,k0nsl/Rocket.Chat,thebakeryio/Rocket.Chat,LearnersGuild/Rocket.Chat,mwharrison/Rocket.Chat,BorntraegerMarc/Rocket.Chat,4thParty/Rocket.Chat,org100h1/Rocket.Panda,mccambridge/Rocket.Chat,williamfortunademoraes/Rocket.Chat,Sing-Li/Rocket.Chat,jadeqwang/Rocket.Chat,litewhatever/Rocket.Chat,cdwv/Rocket.Chat,yuyixg/Rocket.Chat,nathantreid/Rocket.Chat,tntobias/Rocket.Chat,wangleihd/Rocket.Chat,wolfika/Rocket.Chat,mitar/Rocket.Chat,thebakeryio/Rocket.Chat,mccambridge/Rocket.Chat,mccambridge/Rocket.Chat,fatihwk/Rocket.Chat,apnero/tactixteam,biomassives/Rocket.Chat,jonathanhartman/Rocket.Chat,AlecTroemel/Rocket.Chat,acidicX/Rocket.Chat,LearnersGuild/echo-chat,subesokun/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,ziedmahdi/Rocket.Chat,galrotem1993/Rocket.Chat,nishimaki10/Rocket.Chat,mitar/Rocket.Chat,callmekatootie/Rocket.Chat,umeshrs/rocket-chat,nishimaki10/Rocket.Chat,abduljanjua/TheHub,thunderrabbit/Rocket.Chat,abhishekshukla0302/trico,NMandapaty/Rocket.Chat,slava-sh/Rocket.Chat,jbsavoy18/rocketchat-1,klatys/Rocket.Chat,coreyaus/Rocket.Chat,karlprieb/Rocket.Chat,nrhubbar/Rocket.Chat,subesokun/Rocket.Chat,pkgodara/Rocket.Chat,ZBoxApp/Rocket.Chat,LearnersGuild/Rocket.Chat,LearnersGuild/Rocket.Chat,Jandersolutions/Rocket.Chat,steedos/chat,revspringjake/Rocket.Chat,ahmadassaf/Rocket.Chat,alenodari/Rocket.Chat,rasata/Rocket.Chat,jeanmatheussouto/Rocket.Chat,mwharrison/Rocket.Chat,PavelVanecek/Rocket.Chat,wtsarchive/Rocket.Chat,phlkchan/Rocket.Chat,rasata/Rocket.Chat,igorstajic/Rocket.Chat,subesokun/Rocket.Chat,Deepakkothandan/Rocket.Chat,callmekatootie/Rocket.Chat,icaromh/Rocket.Chat,alexbrazier/Rocket.Chat,timkinnane/Rocket.Chat,florinnichifiriuc/Rocket.Chat,BorntraegerMarc/Rocket.Chat,amaapp/ama,igorstajic/Rocket.Chat,AimenJoe/Rocket.Chat,jeann2013/Rocket.Chat,haoyixin/Rocket.Chat,ggazzo/Rocket.Chat,webcoding/Rocket.Chat,klatys/Rocket.Chat,karlprieb/Rocket.Chat,christmo/Rocket.Chat,celloudiallo/Rocket.Chat,Jandersoft/Rocket.Chat,lukaroski/traden,wolfika/Rocket.Chat,erikmaarten/Rocket.Chat,tntobias/Rocket.Chat,madmanteam/Rocket.Chat,BHWD/noouchat,umeshrs/rocket-chat,Movile/Rocket.Chat,JamesHGreen/Rocket.Chat,nishimaki10/Rocket.Chat,KyawNaingTun/Rocket.Chat,wicked539/Rocket.Chat,ut7/Rocket.Chat,tzellman/Rocket.Chat,janmaghuyop/Rocket.Chat,greatdinosaur/Rocket.Chat,jessedhillon/Rocket.Chat,cdwv/Rocket.Chat,Gromby/Rocket.Chat |
0815a333932a63679ff417527946f96a8fcfb04c | lib/helpers.coffee | lib/helpers.coffee | {Range} = require('atom')
Helpers = module.exports =
validateMessages: (results) ->
if (not results) or results.constructor.name isnt 'Array'
throw new Error "Got invalid response from Linter, Type: #{typeof results}"
for result in results
unless result.type
throw new Error "Missing type field on Linter Response, Got: #{Object.keys(result)}"
result.range = Range.fromObject result.range if result.range?
result.class = result.type.toLowerCase().replace(' ', '-')
Helpers.validateMessages(result.trace) if result.trace
validateLinter: (linter) ->
unless linter.grammarScopes instanceof Array
message = "grammarScopes is not an Array. (see console for more info)"
console.warn(message)
console.warn('grammarScopes', linter.grammarScopes)
throw new Error(message)
unless linter.lint?
throw new Error("Missing linter.lint")
if typeof linter.lint isnt 'function'
throw new Error("linter.lint isn't a function")
return true
| {Range} = require('atom')
Helpers = module.exports =
validateMessages: (results) ->
if (not results) or results.constructor.name isnt 'Array'
throw new Error "Got invalid response from Linter, Type: #{typeof results}"
for result in results
unless result.type
throw new Error "Missing type field on Linter Response, Got: #{Object.keys(result)}"
result.range = Range.fromObject result.range if result.range?
result.class = result.type.toLowerCase().replace(' ', '-')
Helpers.validateMessages(result.trace) if result.trace
return # Explicit return to return undefined
validateLinter: (linter) ->
unless linter.grammarScopes instanceof Array
message = "grammarScopes is not an Array. (see console for more info)"
console.warn(message)
console.warn('grammarScopes', linter.grammarScopes)
throw new Error(message)
unless linter.lint?
throw new Error("Missing linter.lint")
if typeof linter.lint isnt 'function'
throw new Error("linter.lint isn't a function")
return true
| Return undefined explicitly in Helpers::validateMessages | :bug: Return undefined explicitly in Helpers::validateMessages
| CoffeeScript | mit | kaeluka/linter,shawninder/linter,JohnMurga/linter,UltCombo/linter,mdgriffith/linter,steelbrain/linter,iam4x/linter,blakeembrey/linter,Arcanemagus/linter,e-jigsaw/Linter,DanPurdy/linter,elkeis/linter,levity/linter,AtomLinter/Linter,atom-community/linter,AsaAyers/linter |
aa000b7df9d4293f3d392d2558345e1ffc243706 | app/core/Component.coffee | app/core/Component.coffee | ###
A Result represents the...well...result of a Task.
Any function given to {Scriptable#addTask} is expected to return a {Result}.
###
module.exports = class Component
constructor: (@owner) ->
###
Copys all functions from the component to {#owner}.
Ignores functions starting with an underscore and refuses to
overwrite functions.
###
mount: () =>
for method of @
if @owner[method]?
console.debug 'Method %s exists already and will not be mounted on %O', method, @owner
continue
if method[0] is '_'
continue
@owner[method] = do (method) => =>
@[method].apply @, arguments
| ###
A Result represents the...well...result of a Task.
Any function given to {Scriptable#addTask} is expected to return a {Result}.
###
module.exports = class Component
constructor: (@owner) ->
###
Copys all functions from the component to {#owner}.
Ignores functions starting with an underscore and refuses to
overwrite functions.
###
mount: () =>
for method of @
if method[0] is '_' or # don't copy private methods
method == 'owner' or # the owner property pointing to the components owner
method == 'constructor' or # the constructor
method == 'mount' # this method
continue
if @owner[method]?
console.debug 'Method %s exists already and will not be mounted on %O', method, @owner
continue
@owner[method] = do (method) => =>
@[method].apply @, arguments
| Fix copying of constructor, mount itself and the owner property | Fix copying of constructor, mount itself and the owner property
Copying the owner property to the object it points to would be, well random... | CoffeeScript | apache-2.0 | despairblue/shiny-wight |
3e40960e9092e1a07e81fa87d18ba5110591d0ed | components/__tests__/Slider.spec.cjsx | components/__tests__/Slider.spec.cjsx | React = require('react/addons')
expect = require('expect')
utils = require('./utils')
TestUtils = React.addons.TestUtils
Slider = require('../slider')
describe 'Slider', ->
before ->
@component = TestUtils.renderIntoDocument(<Slider />)
@component.setState({ sliderStart: 0, sliderLength: 1000 })
describe '#events', ->
it "sets pressed state when knob is clicked", ->
TestUtils.Simulate.mouseDown(@component.refs.knob)
expect(@component.state.pressed).toEqual(true)
it "sets a proper value when the slider is clicked", ->
TestUtils.Simulate.mouseDown(@component.refs.slider, { pageX: 800 })
expect(@component.state.value).toEqual(80)
| TestUtils = React.addons.TestUtils
expect = require('expect')
utils = require('./utils')
Slider = require('../slider')
describe 'Slider', ->
describe '#events', ->
slider = null
before ->
props = { min: -500, max: 500 }
state = { sliderStart: 0, sliderLength: 1000 }
slider = utils.renderComponent(Slider, props, state)
it "sets pressed state when knob is clicked", ->
TestUtils.Simulate.mouseDown(slider.refs.knob)
expect(slider.state.pressed).toEqual(true)
it "sets a proper value when the slider is clicked", ->
TestUtils.Simulate.mouseDown(slider.refs.slider, { pageX: 200 })
expect(slider.state.value).toEqual(-300)
| Improve minimal tests for slider | Improve minimal tests for slider
| CoffeeScript | mit | DigitalRiver/react-atlas,jasonleibowitz/react-toolbox,showings/react-toolbox,react-toolbox/react-toolbox,rubenmoya/react-toolbox,react-toolbox/react-toolbox,KerenChandran/react-toolbox,react-toolbox/react-toolbox,KerenChandran/react-toolbox,soyjavi/react-toolbox,jasonleibowitz/react-toolbox,rubenmoya/react-toolbox,showings/react-toolbox,rubenmoya/react-toolbox,soyjavi/react-toolbox,Magneticmagnum/react-atlas |
6dcb23a09f6c157d76b782f8bcd536bd53a20d8c | spec/coffeescript.coffee | spec/coffeescript.coffee | grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
if student.excellentWork
"A+"
else if student.okayStuff
if student.triedHard then "B" else "B-"
else
"C"
square = (x) -> x * x
two = -> 2
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
race = (winner, runners...) ->
print winner, runners
class Animal extends Being
constructor: (@name) ->
move: (meters) ->
alert @name + " moved #{meters}m."
hi = `function() {
return [document.title, "Hello JavaScript"].join(": ");
}`
heredoc = """
CoffeeScript subst test #{ 010 + 0xf / 0b10 + "nested string #{ /\n/ }"}
"""
###
CoffeeScript Compiler v1.2.0
Released under the MIT License
###
OPERATOR = /// ^ (
?: [-=]> # function
) ///
| grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
if student.excellentWork
"A+"
else if student.okayStuff
if student.triedHard then "B" else "B-"
else
"C"
square = (x) -> x * x
two = -> 2
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
race = (winner, runners...) ->
print winner, runners
class Animal extends Being
constructor: (@name) ->
move: (meters) ->
alert @name + " moved #{meters}m."
hi = `function() {
return [document.title, "Hello JavaScript"].join(": ");
}`
heredoc = """
CoffeeScript subst test #{ 0o010 + 0xf / 0b10 + "nested string #{ /\n/ }"}
"""
###
CoffeeScript Compiler v1.2.0
Released under the MIT License
###
OPERATOR = /// ^ (
?: [-=]> # function
) ///
| Use valid CoffeeScript in example | Use valid CoffeeScript in example
| CoffeeScript | mit | colllin/one-dark-syntax,vith/one-dark-syntax,JeNeSuisPasDave/one-dark-syntax,yuriihabrusiev/one-dark-syntax,vith/one-dark-syntax,colllin/one-dark-syntax,nviel/nico-syntax,vith/one-dark-syntax,JeNeSuisPasDave/one-dark-syntax,grigio/atom-darkmate-syntax,grigio/atom-darkmate-syntax,nviel/nico-syntax,JeNeSuisPasDave/one-dark-syntax,grigio/atom-darkmate-syntax,JeNeSuisPasDave/one-dark-syntax,JeNeSuisPasDave/one-dark-syntax,nviel/nico-syntax,nviel/nico-syntax,nviel/nico-syntax,grigio/atom-darkmate-syntax,yuriihabrusiev/one-dark-syntax,grigio/atom-darkmate-syntax,yuriihabrusiev/one-dark-syntax,colllin/one-dark-syntax,grigio/atom-darkmate-syntax,colllin/one-dark-syntax,vith/one-dark-syntax,vith/one-dark-syntax,yuriihabrusiev/one-dark-syntax,JeNeSuisPasDave/one-dark-syntax,yuriihabrusiev/one-dark-syntax,vith/one-dark-syntax,colllin/one-dark-syntax,nviel/nico-syntax,yuriihabrusiev/one-dark-syntax,colllin/one-dark-syntax |
8ff47b1cb1a449593d58657afae0a50577ff35bd | config.cson | config.cson | "*":
"exception-reporting":
userId: "53c5f869-8a29-d7f5-ef48-bc598612bb8d"
welcome:
showOnStartup: false
core: {}
editor:
invisibles: {}
| "*":
"exception-reporting":
userId: "53c5f869-8a29-d7f5-ef48-bc598612bb8d"
welcome:
showOnStartup: false
editor:
invisibles: {}
tabs:
usePreviewTabs: true
| Use preview tab like sublime | Use preview tab like sublime
| CoffeeScript | mit | substantial/atomfiles,substantial/atomfiles |
2888cc93bd061e089968589c0df8d2f507940e1a | app/assets/javascripts/pager.js.coffee | app/assets/javascripts/pager.js.coffee | @Pager =
init: (@limit = 0, preload, @disable = false) ->
@loading = $(".loading")
if preload
@offset = 0
@getOld()
else
@offset = @limit
@initLoadMore()
getOld: ->
@loading.show()
$.ajax
type: "GET"
url: $(".content_list").data('href') || location.href
data: "limit=" + @limit + "&offset=" + @offset
complete: =>
@loading.hide()
success: (data) ->
Pager.append(data.count, data.html)
dataType: "json"
append: (count, html) ->
$(".content_list").append html
if count > 0
@offset += count
else
@disable = true
initLoadMore: ->
$(document).unbind('scroll')
$(document).endlessScroll
bottomPixels: 400
fireDelay: 1000
fireOnce: true
ceaseFire: ->
Pager.disable
callback: (i) =>
unless @loading.is(':visible')
@loading.show()
Pager.getOld()
| @Pager =
init: (@limit = 0, preload, @disable = false) ->
@loading = $('.loading').first()
if preload
@offset = 0
@getOld()
else
@offset = @limit
@initLoadMore()
getOld: ->
@loading.show()
$.ajax
type: "GET"
url: $(".content_list").data('href') || location.href
data: "limit=" + @limit + "&offset=" + @offset
complete: =>
@loading.hide()
success: (data) ->
Pager.append(data.count, data.html)
dataType: "json"
append: (count, html) ->
$(".content_list").append html
if count > 0
@offset += count
else
@disable = true
initLoadMore: ->
$(document).unbind('scroll')
$(document).endlessScroll
bottomPixels: 400
fireDelay: 1000
fireOnce: true
ceaseFire: ->
Pager.disable
callback: (i) =>
unless @loading.is(':visible')
@loading.show()
Pager.getOld()
| Select just the first matched element | Select just the first matched element
This a generic selector. It was also affecting spinner icon of the tabs
| CoffeeScript | mit | mmkassem/gitlabhq,ttasanen/gitlabhq,screenpages/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,htve/GitlabForChinese,larryli/gitlabhq,darkrasid/gitlabhq,Soullivaneuh/gitlabhq,mr-dxdy/gitlabhq,dreampet/gitlab,LUMC/gitlabhq,iiet/iiet-git,SVArago/gitlabhq,martijnvermaat/gitlabhq,shinexiao/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,openwide-java/gitlabhq,mr-dxdy/gitlabhq,mmkassem/gitlabhq,SVArago/gitlabhq,larryli/gitlabhq,darkrasid/gitlabhq,mr-dxdy/gitlabhq,icedwater/gitlabhq,dwrensha/gitlabhq,htve/GitlabForChinese,stoplightio/gitlabhq,axilleas/gitlabhq,martijnvermaat/gitlabhq,mmkassem/gitlabhq,icedwater/gitlabhq,dplarson/gitlabhq,t-zuehlsdorff/gitlabhq,jirutka/gitlabhq,dwrensha/gitlabhq,ttasanen/gitlabhq,screenpages/gitlabhq,t-zuehlsdorff/gitlabhq,larryli/gitlabhq,openwide-java/gitlabhq,dplarson/gitlabhq,t-zuehlsdorff/gitlabhq,shinexiao/gitlabhq,shinexiao/gitlabhq,screenpages/gitlabhq,shinexiao/gitlabhq,larryli/gitlabhq,dreampet/gitlab,daiyu/gitlab-zh,axilleas/gitlabhq,allysonbarros/gitlabhq,axilleas/gitlabhq,allysonbarros/gitlabhq,SVArago/gitlabhq,allysonbarros/gitlabhq,darkrasid/gitlabhq,dplarson/gitlabhq,stoplightio/gitlabhq,daiyu/gitlab-zh,mr-dxdy/gitlabhq,LUMC/gitlabhq,martijnvermaat/gitlabhq,Soullivaneuh/gitlabhq,openwide-java/gitlabhq,daiyu/gitlab-zh,jirutka/gitlabhq,htve/GitlabForChinese,axilleas/gitlabhq,stoplightio/gitlabhq,screenpages/gitlabhq,htve/GitlabForChinese,SVArago/gitlabhq,dwrensha/gitlabhq,Soullivaneuh/gitlabhq,dreampet/gitlab,iiet/iiet-git,iiet/iiet-git,martijnvermaat/gitlabhq,daiyu/gitlab-zh,icedwater/gitlabhq,ttasanen/gitlabhq,openwide-java/gitlabhq,jirutka/gitlabhq,Soullivaneuh/gitlabhq,t-zuehlsdorff/gitlabhq,dwrensha/gitlabhq,icedwater/gitlabhq,LUMC/gitlabhq,stoplightio/gitlabhq,ttasanen/gitlabhq,allysonbarros/gitlabhq,LUMC/gitlabhq,darkrasid/gitlabhq,dplarson/gitlabhq |
481d27076f99c90e836badaa602373d5c8157f07 | app/assets/javascripts/rglossa/controllers/cwb/search_inputs_controller.coffee | app/assets/javascripts/rglossa/controllers/cwb/search_inputs_controller.coffee | App.CwbSearchInputsController = Em.ArrayController.extend
needs: ['corpus', 'searches']
corpusBinding: 'controllers.corpus.content'
currentInterface: null
init: ->
# Show the preferred interface (simple, multiword or regex) for this user or corpus
@set('currentInterface', @get('controllers.corpus.preferredSearchInterfaceVariant'))
tags = @get('corpus.langs.firstObject.tags')
@set 'content', [
query: '',
corpusShortName: @get('corpus.shortName'),
posAttr: tags.attr,
tags: tags.options
]
isShowingSimple: (->
@get('currentInterface') is 'simple'
).property('currentInterface').volatile()
isShowingMultiword: (->
@get('currentInterface') is 'multiword'
).property('currentInterface')
isShowingRegex: (->
@get('currentInterface') is 'regex'
).property('currentInterface')
# Action handlers
showSimple: -> @set('currentInterface', 'simple')
showMultiword: -> @set('currentInterface', 'multiword')
showRegex: -> @set('currentInterface', 'regex')
search: (component, options = {}) ->
options.queries = @get('content')
@get('controllers.searches').createSearch('CwbSearch', options)
| App.CwbSearchInputsController = Em.ArrayController.extend
needs: ['corpus', 'searches']
corpusBinding: 'controllers.corpus.content'
currentInterface: null
init: ->
# Show the preferred interface (simple, multiword or regex) for this user or corpus
@set('currentInterface', @get('controllers.corpus.preferredSearchInterfaceVariant'))
tags = @get('corpus.langs.firstObject.tags')
@set 'content', [
query: '',
corpusShortName: @get('corpus.shortName'),
posAttr: tags?.attr,
tags: tags?.options
]
isShowingSimple: (->
@get('currentInterface') is 'simple'
).property('currentInterface').volatile()
isShowingMultiword: (->
@get('currentInterface') is 'multiword'
).property('currentInterface')
isShowingRegex: (->
@get('currentInterface') is 'regex'
).property('currentInterface')
# Action handlers
showSimple: -> @set('currentInterface', 'simple')
showMultiword: -> @set('currentInterface', 'multiword')
showRegex: -> @set('currentInterface', 'regex')
search: (component, options = {}) ->
options.queries = @get('content')
@get('controllers.searches').createSearch('CwbSearch', options)
| Support corpora without a tagger config | Support corpora without a tagger config
| CoffeeScript | mit | textlab/rglossa,textlab/glossa,textlab/glossa,textlab/glossa,textlab/rglossa,textlab/glossa,textlab/rglossa,textlab/rglossa,textlab/glossa,textlab/rglossa |
57ff6eb6c9fc46ad2be6f0efe414ccc3f4368afa | src/languages/jsx.coffee | src/languages/jsx.coffee | module.exports = {
name: "JSX"
namespace: "jsx"
fallback: ['js']
###
Supported Grammars
###
grammars: [
"JSX"
"JavaScript (JSX)"
"Babel ES6 JavaScript"
]
###
Supported extensions
###
extensions: [
"jsx",
"js"
]
}
| module.exports = {
name: "JSX"
namespace: "jsx"
fallback: ['js']
###
Supported Grammars
###
grammars: [
"JSX"
"JavaScript (JSX)"
"Babel ES6 JavaScript"
"JavaScript with JSX"
]
###
Supported extensions
###
extensions: [
"jsx",
"js"
]
}
| Add JavaScript with JSX grammar to JSX language | Add JavaScript with JSX grammar to JSX language
| CoffeeScript | mit | Glavin001/atom-beautify,Glavin001/atom-beautify,Glavin001/atom-beautify,prettydiff/atom-beautify,prettydiff/atom-beautify,Glavin001/atom-beautify,prettydiff/atom-beautify,Glavin001/atom-beautify,prettydiff/atom-beautify |
0910406c465137f88ad3c38b2cc4b8fc7550fd20 | src/flux/performance.coffee | src/flux/performance.coffee | {CrudConfig, makeSimpleStore, extendConfig} = require './helpers'
_ = require 'underscore'
PerformanceConfig = {
exports:
getStudentOfTask: (courseId, taskId) ->
performances = @_get(courseId)
students = _.chain(performances)
.pluck('students')
.flatten(true)
.value()
# TODO remove when BE fixed for ids to be strings instead of numbers
taskId = parseInt(taskId)
_.find students, (student) ->
taskIds = _.pluck student.data, 'id'
_.indexOf(taskIds, taskId) > -1
}
extendConfig(PerformanceConfig, new CrudConfig())
{actions, store} = makeSimpleStore(PerformanceConfig)
module.exports = {PerformanceActions:actions, PerformanceStore:store}
| {CrudConfig, makeSimpleStore, extendConfig} = require './helpers'
_ = require 'underscore'
allStudents = (performances) ->
_.chain(performances)
.pluck('students')
.flatten(true)
.value()
PerformanceConfig = {
exports:
getStudent: (courseId, roleId) ->
students = allStudents @_get(courseId)
# TODO remove parseInt when BE fixes role to be string
_.findWhere(allStudents(@_get(courseId)), role: parseInt(roleId))
getAllStudents: (courseId) ->
allStudents @_get(courseId)
getStudentOfTask: (courseId, taskId) ->
students = allStudents @_get(courseId)
# TODO remove when BE fixed for ids to be strings instead of numbers
taskId = parseInt(taskId)
_.find students, (student) ->
taskIds = _.pluck student.data, 'id'
_.indexOf(taskIds, taskId) > -1
}
extendConfig(PerformanceConfig, new CrudConfig())
{actions, store} = makeSimpleStore(PerformanceConfig)
module.exports = {PerformanceActions:actions, PerformanceStore:store}
| Add methods to find or retrieve all students | Add methods to find or retrieve all students
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
dca62528066573ce35144ac39fd51ef595fc122d | app/assets/javascripts/species/views/search_form/taxon_concept_search_text_field.js.coffee | app/assets/javascripts/species/views/search_form/taxon_concept_search_text_field.js.coffee | Species.TaxonConceptSearchTextField = Em.TextField.extend
value: ''
currentTimeout: null
attributeBindings: ['autocomplete']
focusOut: (event) ->
@.$().attr('placeholder', @get('placeholder'))
@hideDropdown() if !@get('parentView.mousedOver')
keyUp: (event) ->
Ember.run.cancel(@currentTimeout)
@currentTimeout = Ember.run.later(@, ->
@showDropdown()
@set('query', event.target.value)
, 500)
hideDropdown: () ->
$('.search fieldset').removeClass('parent-focus parent-active')
showDropdown: () ->
if @.$().val().length > 2
$('.search fieldset').addClass('parent-focus parent-active')
| Species.TaxonConceptSearchTextField = Em.TextField.extend
value: ''
currentTimeout: null
attributeBindings: ['autocomplete']
focusOut: (event) ->
@.$().attr('placeholder', @get('placeholder'))
@hideDropdown() if !@get('parentView.mousedOver')
keyUp: (event) ->
Ember.run.cancel(@currentTimeout)
if event.keyCode == 13
@hideDropdown()
return
@currentTimeout = Ember.run.later(@, ->
@showDropdown()
@set('query', event.target.value)
, 500)
hideDropdown: () ->
$('.search fieldset').removeClass('parent-focus parent-active')
showDropdown: () ->
if @.$().val().length > 2
$('.search fieldset').addClass('parent-focus parent-active')
| Hide suggestions dropdown if the keyUp is Enter | Hide suggestions dropdown if the keyUp is Enter
| CoffeeScript | bsd-3-clause | unepwcmc/SAPI,unepwcmc/SAPI,unepwcmc/SAPI,unepwcmc/SAPI |
35b1c74fe33305ac1377c1299675fea2072b3c9b | src/languages/yaml.coffee | src/languages/yaml.coffee | module.exports = {
name: "YAML"
namespace: "yaml"
fallback: []
scope: ['source.yaml']
###
Supported Grammars
###
grammars: [
"YAML"
]
###
Supported extensions
###
extensions: [
"yml",
"yaml"
]
defaultBeautifier: "align-yaml"
options: {
padding:
type: 'integer'
default: null
minimum: 0
description: "The amount of padding to add next to each line."
}
}
| module.exports = {
name: "YAML"
namespace: "yaml"
fallback: []
scope: ['source.yaml']
###
Supported Grammars
###
grammars: [
"YAML"
]
###
Supported extensions
###
extensions: [
"yml",
"yaml"
]
defaultBeautifier: "align-yaml"
options: {
padding:
type: 'integer'
default: 0
minimum: 0
description: "The amount of padding to add next to each line."
}
}
| Set default padding to 0, not null | Set default padding to 0, not null
This fixes https://github.com/Glavin001/atom-beautify/issues/1647 .
| CoffeeScript | mit | prettydiff/atom-beautify,Glavin001/atom-beautify,Glavin001/atom-beautify,prettydiff/atom-beautify,Glavin001/atom-beautify,Glavin001/atom-beautify,prettydiff/atom-beautify,Glavin001/atom-beautify,prettydiff/atom-beautify |
9408bf7e82c7df6d9c2ea4bce69eda1c95f8f5fa | app/controllers/index.coffee | app/controllers/index.coffee | `import Ember from 'ember';`
`import Notify from 'ember-notify';`
`import CONSTANTS from '../utils/constants';`
`import SocketMixin from '../mixins/socket';`
IndexController = Ember.ArrayController.extend SocketMixin,
needs: ['application']
storeURL: null
ratio: null
model:( ->
@store.all 'project'
).property()
actions:
submitURL: ->
storeURL = @get "storeURL"
if !CONSTANTS.STORE_URL_RE.test storeURL
return Notify.error "Please enter a valid URL"
data =
storeURL: storeURL
applicationAdapter = @store.adapterFor 'application'
host = applicationAdapter.get 'host'
namespace = applicationAdapter.get 'namespace'
postUrl = [host, namespace, 'store_url'].join '/'
that = @
Ember.$.post postUrl, data
.then ->
that.set "storeURL", null
Notify.success "Hang in there while we process your URL"
.fail (xhr, message, status) ->
Notify.error "A network error occured! Please try again later"
`export default IndexController;`
| `import Ember from 'ember';`
`import Notify from 'ember-notify';`
`import CONSTANTS from '../utils/constants';`
`import SocketMixin from '../mixins/socket';`
IndexController = Ember.ArrayController.extend SocketMixin,
needs: ['application']
storeURL: null
ratio: null
model:( ->
@store.all 'project'
).property()
actions:
submitURL: ->
storeURL = @get "storeURL"
if !CONSTANTS.STORE_URL_RE.test storeURL
return Notify.error "Please enter a valid URL"
data =
storeURL: storeURL
applicationAdapter = @store.adapterFor 'application'
host = applicationAdapter.get 'host'
namespace = applicationAdapter.get 'namespace'
postUrl = [host, namespace, 'store_url'].join '/'
that = @
Ember.$.post postUrl, data
.then ->
that.set "storeURL", null
Notify.success "Hang in there while we process your URL"
.fail (xhr, message, status) ->
if xhr.status is 401
Notify.error xhr.responseJSON.message
else
Notify.error "A network error occured! Please try again later"
`export default IndexController;`
| Fix scan permissions error message | Fix scan permissions error message
| CoffeeScript | agpl-3.0 | appknox/irene,appknox/irene,appknox/irene |
f4131826f06a25fb6299a674923fa0a8a711c08c | src/utils.coffee | src/utils.coffee | # General purpose utitily functions
# =================================
fs = require 'fs'
path = require 'path'
# Trim newlines from beginning and end of multi line string.
exports.trimNewLines = (str) ->
str.replace(/^\n*/, '').replace(/\n*$/, '')
# Build an HTML file name, depending on the source path.
exports.makeDestination = makeDestination = (file, inPath) ->
relPath = path.relative(
path.resolve(inPath)
path.resolve(file)
)
path.join(
path.dirname(relPath)
path.basename(relPath, path.extname(relPath)) + '.html'
).replace(/[\\/]/g, '-')
# Find first file matching `re` in `dir`.
exports.findFile = (dir, re) ->
return null unless fs.statSync(dir).isDirectory()
file = fs.readdirSync(dir).sort().filter((file) -> file.match re)?[0]
return null unless file?
path.join dir, file
# Make `link` objects for the menu.
exports.makeMenu = (files) ->
menu = {}
for file in files
link =
name: path.basename(file, path.extname file)
href: 'html/' + makeDestination file
parts = file.split('/').splice(1)
key = if parts.length > 1 then parts[0] else './'
if menu[key]?
menu[key].push link
else
menu[key] = [ link ]
menu
| # General purpose utitily functions
# =================================
fs = require 'fs'
path = require 'path'
# Trim newlines from beginning and end of multi line string.
exports.trimNewLines = (str) ->
str.replace(/^\n*/, '').replace(/\n*$/, '')
# Build an HTML file name, depending on the source path.
exports.makeDestination = makeDestination = (file, inPath) ->
relPath = path.relative(
path.resolve(inPath)
path.resolve(file)
)
path.join(
path.dirname(relPath)
path.basename(relPath, path.extname(relPath)) + '.html'
).replace(/[\\/]/g, '-')
# Find first file matching `re` in `dir`.
exports.findFile = (dir, re) ->
return null unless fs.statSync(dir).isDirectory()
file = fs.readdirSync(dir).sort().filter((file) -> file.match re)?[0]
return null unless file?
path.join dir, file
# Make `link` objects for the menu.
exports.makeMenu = (files, inPath) ->
menu = {}
for file in files
link =
name: path.basename(file, path.extname file)
href: 'html/' + makeDestination file, inPath
parts = file.split('/').splice(1)
key = if parts.length > 1 then parts[0] else './'
if menu[key]?
menu[key].push link
else
menu[key] = [ link ]
menu
| Fix path bug in menu generation | Fix path bug in menu generation
| CoffeeScript | mit | paulwellnerbou/styledocco,trungnghia112/styledocco,trungnghia112/styledocco,ooooooo-q/styledocco,ooooooo-q/styledocco,jacobrask/styledocco,paulwellnerbou/styledocco |
ea087061397e2baeb27a7334d83769cac687ebae | lib/nsync/web-window.coffee | lib/nsync/web-window.coffee | _ = require 'underscore-plus'
shell = require 'shell'
remote = require 'remote'
BrowserWindow = remote.require 'browser-window'
module.exports =
class WebWindow
constructor: (url, options = {}, @openNewWindowExternally = true) ->
_.defaults options,
show: false
width: 400
height: 600
skipTaskbar: true
menuBarVisible: false
@win = new BrowserWindow(options)
@webContents = @win.webContents
@handleEvents()
@win.loadURL(url) # TODO: handle failed load
handleEvents: ->
@webContents.on 'did-finish-load', =>
@win.show()
if @openNewWindowExternally
@webContents.on 'new-window', (e, url) =>
e.preventDefault()
@win.destroy()
shell.openExternal(url)
| _ = require 'underscore-plus'
shell = require 'shell'
remote = require 'remote'
BrowserWindow = remote.BrowserWindow
module.exports =
class WebWindow
constructor: (url, options = {}, @openNewWindowExternally = true) ->
_.defaults options,
show: false
width: 400
height: 600
skipTaskbar: true
menuBarVisible: false
@win = new BrowserWindow(options)
@webContents = @win.webContents
@handleEvents()
@win.loadURL(url) # TODO: handle failed load
handleEvents: ->
@webContents.on 'did-finish-load', =>
@win.show()
if @openNewWindowExternally
@webContents.on 'new-window', (e, url) =>
e.preventDefault()
@win.destroy()
shell.openExternal(url)
| Update deprecated call to remote | Update deprecated call to remote
| CoffeeScript | mit | learn-co/learn-ide-tree |
6c8aa7f6806c9e8b89723010773b53ac4dfbc48d | gulpfile.coffee | gulpfile.coffee | gulp = require('gulp')
$ = require('gulp-load-plugins')
$ = $ 'rename':
'gulp-task-listing': 'list'
path = require('path')
pkg = require('./package.json')
gulp.task 'default', ['list']
gulp.task 'list', $.list
gulp.task 'lint', ['lint-json', 'lint-coffee']
gulp.task 'lint-json', ->
gulp.src('package.json')
.pipe($.jsonlint())
gulp.task 'lint-coffee', ->
gulp.src(['src/**/*.coffee', 'test/**/*.coffee'])
.pipe($.coffeelint())
.pipe($.coffeelint.reporter('coffeelint-stylish'))
gulp.task 'test', ['test-mocha']
gulp.task 'test-mocha', ->
gulp.src(['test/**/*'])
.pipe($.mocha())
gulp.task 'watch', ->
$.watch ['src/**/*', 'test/**/*'], ->
gulp.src(['test/**/*'])
.pipe($.plumber(
errorHandler: $.notify.onError("Error: <%= error.message %>")
))
.pipe($.mocha(reporter: 'nyan'))
| gulp = require('gulp')
$ = require('gulp-load-plugins')
$ = $ 'rename':
'gulp-task-listing': 'list'
path = require('path')
pkg = require('./package.json')
gulp.task 'default', ['list']
gulp.task 'list', $.list
gulp.task 'lint', ['lint-json', 'lint-coffee']
gulp.task 'lint-json', ->
gulp.src('package.json')
.pipe($.jsonlint())
gulp.task 'lint-coffee', ->
gulp.src(['src/**/*.coffee', 'test/**/*.coffee'])
.pipe($.coffeelint())
.pipe($.coffeelint.reporter('coffeelint-stylish'))
gulp.task 'test', ['test-mocha']
gulp.task 'test-mocha', ->
gulp.src(['test/**/*.coffee'])
.pipe($.mocha())
gulp.task 'watch', ->
$.watch ['src/**/*', 'test/**/*'], ->
gulp.src(['test/**/*'])
.pipe($.plumber(
errorHandler: $.notify.onError("Error: <%= error.message %>")
))
.pipe($.mocha(reporter: 'nyan'))
| Fix the wildcard in gulp test-mocha | Fix the wildcard in gulp test-mocha
| CoffeeScript | mit | mh61503891/node-winreg-ffi |
e02a43ed74578e80aa56deb65325f84bf44c0d9e | lib/Acho.coffee | lib/Acho.coffee | 'use strict'
DEFAULT = require './Default'
CONST = require './Constants'
existsDefault = require 'existential-default'
module.exports = (options = {}) ->
acho = existsDefault(options, DEFAULT)
acho.diff = [] if acho.diff
acho[key] = value for key, value of acho
acho.messages = do ->
messages = {}
for type of acho.types
messages[type] = options.messages?[type] or []
acho[type] = acho.generateTypeMessage type if type isnt 'line'
messages
acho.push = (type, messages...) ->
message = @format messages
@messages[type].push message
this
acho.add = (type, messages...) ->
message = @format messages
@[type] message
@push type, message
this
acho
| 'use strict'
DEFAULT = require './Default'
CONST = require './Constants'
existsDefault = require 'existential-default'
Acho = (options = {}) ->
return new Acho options unless this instanceof Acho
acho = existsDefault(options, DEFAULT)
acho.diff = [] if acho.diff
acho[key] = value for key, value of acho
acho.messages = do ->
messages = {}
for type of acho.types
messages[type] = options.messages?[type] or []
acho[type] = acho.generateTypeMessage type if type isnt 'line'
messages
acho.push = (type, messages...) ->
message = @format messages
@messages[type].push message
this
acho.add = (type, messages...) ->
message = @format messages
@[type] message
@push type, message
this
acho
module.exports = Acho
| Add instanceof for new keyword | Add instanceof for new keyword
| CoffeeScript | mit | Kikobeats/acho,achohq/acho,Kikobeats/acho,achojs/acho |
76735e2f0153bf78b480cb07eae18201a6fdc1ae | lib/main.coffee | lib/main.coffee | module.exports =
config:
showIcons:
type: 'boolean'
default: true
alwaysShowTabBar:
type: 'boolean'
default: true
description: "Shows the Tab Bar when only 1 tab is open"
tabScrolling:
type: 'boolean'
default: process.platform is 'linux'
tabScrollingThreshold:
type: 'integer'
default: 120
usePreviewTabs:
type: 'boolean'
default: true
description: 'Tabs will only stay open if they are modified or double-clicked'
activate: ->
@tabBarViews = []
TabBarView = require './tab-bar-view'
_ = require 'underscore-plus'
@paneSubscription = atom.workspace.observePanes (pane) =>
tabBarView = new TabBarView(pane)
paneElement = atom.views.getView(pane)
paneElement.insertBefore(tabBarView.element, paneElement.firstChild)
@tabBarViews.push(tabBarView)
pane.onDidDestroy => _.remove(@tabBarViews, tabBarView)
deactivate: ->
@paneSubscription.dispose()
tabBarView.remove() for tabBarView in @tabBarViews
| module.exports =
config:
showIcons:
type: 'boolean'
default: true
alwaysShowTabBar:
type: 'boolean'
default: true
description: "Shows the Tab Bar when only 1 tab is open"
tabScrolling:
type: 'boolean'
default: process.platform is 'linux'
tabScrollingThreshold:
type: 'integer'
default: 120
usePreviewTabs:
type: 'boolean'
default: false
description: 'Tabs will only stay open if they are modified or double-clicked'
activate: ->
@tabBarViews = []
TabBarView = require './tab-bar-view'
_ = require 'underscore-plus'
@paneSubscription = atom.workspace.observePanes (pane) =>
tabBarView = new TabBarView(pane)
paneElement = atom.views.getView(pane)
paneElement.insertBefore(tabBarView.element, paneElement.firstChild)
@tabBarViews.push(tabBarView)
pane.onDidDestroy => _.remove(@tabBarViews, tabBarView)
deactivate: ->
@paneSubscription.dispose()
tabBarView.remove() for tabBarView in @tabBarViews
| Make preview tabs off by default for now | Make preview tabs off by default for now
| CoffeeScript | mit | pombredanne/tabs,acontreras89/tabs,atom/tabs,harai/tabs |
99a514fee7f7e3a5364bc965cc6b2dee17770f34 | app/assets/javascripts/users.js.coffee | app/assets/javascripts/users.js.coffee | toggleTab = (targetClass) ->
$footer = $('div.profile-footer')
$nav = $footer.find('ul.nav')
$nav.find('.active').removeClass 'active'
$nav.find(".tab-#{targetClass}").addClass 'active'
toggleTabPanel = (targetClass) ->
$('div.tab-pane.active').removeClass 'active'
$("div.tab-pane.#{targetClass}").addClass 'active'
updateFormAction = (targetClass) ->
$('#edit_user').attr 'action', "/users##{targetClass}"
updateLocationHash = (hash) ->
window.location.hash = hash
$ ->
targetClass = window.location.hash.substr(1)
unless targetClass
targetClass = 'account'
toggleTab(targetClass)
toggleTabPanel(targetClass)
updateFormAction(targetClass)
updateLocationHash(targetClass)
$(".nav a").click (event) ->
event.preventDefault()
$this = $(event.currentTarget)
$parent = $this.parent()
targetClass = $this.data 'target-class'
toggleTab(targetClass)
toggleTabPanel(targetClass)
updateFormAction(targetClass)
updateLocationHash(targetClass)
| initialize = () ->
targetClass = window.location.hash.substr(1)
unless targetClass
targetClass = 'account'
toggleTab(targetClass)
toggleTabPanel(targetClass)
updateFormAction(targetClass)
updateLocationHash(targetClass)
$(".nav a").click (event) ->
event.preventDefault()
$this = $(event.currentTarget)
$parent = $this.parent()
targetClass = $this.data 'target-class'
toggleTab(targetClass)
toggleTabPanel(targetClass)
updateFormAction(targetClass)
updateLocationHash(targetClass)
toggleTab = (targetClass) ->
$footer = $('div.profile-footer')
$nav = $footer.find('ul.nav')
$nav.find('.active').removeClass 'active'
$nav.find(".tab-#{targetClass}").addClass 'active'
toggleTabPanel = (targetClass) ->
$('div.tab-pane.active').removeClass 'active'
$("div.tab-pane.#{targetClass}").addClass 'active'
updateFormAction = (targetClass) ->
$('#edit_user').attr 'action', "/users##{targetClass}"
updateLocationHash = (hash) ->
window.location.hash = hash
$ ->
$body = $('body')
routes = ['registrations-edit', 'registrations-update']
if _.some(routes, (route) -> $body.hasClass route)
initialize()
| Fix initialization of user profile logic | Fix initialization of user profile logic | CoffeeScript | mit | SoPR/sopr-platform,SoPR/sopr-platform |
3863fd6cdbd41fefbb1741764d540e101c1178f8 | app/assets/javascripts/species/mixins/event_lookup.js.coffee | app/assets/javascripts/species/mixins/event_lookup.js.coffee | Species.EventLookup = Ember.Mixin.create
selectedEvent: null
selectedEventId: null
initEventSelector: ->
@set('selectedEvent', @get('controllers.events.content').findBy('id', @get('selectedEventId')))
if @get('selectedEventType') == null && @get('selectedEvent')
@set('selectedEventType', @get('controllers.events.eventTypes').findBy('id', @get('selectedEvent.type')))
filteredEvents: ( ->
if @get('selectedEventType')
@get('controllers.events.content').filterBy('type', @get('selectedEventType.id'))
else
[]
).property('selectedEventType.id')
eventsDropdownVisible: ( ->
@get('selectedEventType') != null
).property('selectedEventType.id')
actions:
handleEventTypeSelection: (eventType) ->
@set('selectedEventType', eventType)
if @get('selectedEventType.id') != @get('selectedEvent.type')
@set('selectedEvent', null)
@set('selectedEventId', null)
if @get('selectedDocumentType.eventTypes') && @get('selectedDocumentType.eventTypes').indexOf(@get('selectedEvent.type')) < 0
@set('selectedDocumentType', null)
handleEventTypeDeselection: (eventType) ->
@set('selectedEventType', null)
@set('selectedEvent', null)
@set('selectedEventId', null)
handleEventSelection: (event) ->
@set('selectedEvent', event)
@set('selectedEventId', event.id)
handleEventDeselection: (event) ->
@set('selectedEvent', null)
@set('selectedEventId', null)
| Species.EventLookup = Ember.Mixin.create
selectedEvent: null
selectedEventId: null
initEventSelector: ->
@set('selectedEvent', @get('controllers.events.content').findBy('id', @get('selectedEventId')))
if @get('selectedEventType') == null && @get('selectedEvent')
@set('selectedEventType', @get('controllers.events.eventTypes').findBy('id', @get('selectedEvent.type')))
filteredEvents: ( ->
if @get('selectedEventType')
@get('controllers.events.content').filterBy('type', @get('selectedEventType.id'))
else
[]
).property('selectedEventType.id')
eventsDropdownVisible: ( ->
@get('selectedEventType')?
).property('selectedEventType.id')
actions:
handleEventTypeSelection: (eventType) ->
@set('selectedEventType', eventType)
if @get('selectedEventType.id') != @get('selectedEvent.type')
@set('selectedEvent', null)
@set('selectedEventId', null)
if @get('selectedDocumentType.eventTypes') && @get('selectedDocumentType.eventTypes').indexOf(@get('selectedEvent.type')) < 0
@set('selectedDocumentType', null)
handleEventTypeDeselection: (eventType) ->
@set('selectedEventType', null)
@set('selectedEvent', null)
@set('selectedEventId', null)
handleEventSelection: (event) ->
@set('selectedEvent', event)
@set('selectedEventId', event.id)
handleEventDeselection: (event) ->
@set('selectedEvent', null)
@set('selectedEventId', null)
| Fix meeting dropdown appearing when no meeting type selected | Fix meeting dropdown appearing when no meeting type selected
| CoffeeScript | bsd-3-clause | unepwcmc/SAPI,unepwcmc/SAPI,unepwcmc/SAPI,unepwcmc/SAPI |
0ef75ff1993a03ff77b49c2bd034f8a692190eca | app/assets/javascripts/banners.js.coffee | app/assets/javascripts/banners.js.coffee | App.Banners =
update_banner: (selector, text) ->
$(selector).html(text)
update_style: (selector, style) ->
$(selector).removeClass($(selector).attr("class"), true)
.addClass(style, true)
update_background_color: (selector, background_color) ->
$(selector).css("background-color", background_color)
update_font_color: (selector, font_color) ->
$(selector).css("color", font_color)
initialize: ->
$("[data-js-banner-title]").on
change: ->
App.Banners.update_banner("#js-banner-title", $(this).val())
$("[data-js-banner-description]").on
change: ->
App.Banners.update_banner("#js-banner-description", $(this).val())
$("[name='banner[background_color]']").on
change: ->
App.Banners.update_background_color("#js-banner-background", $(this).val())
$("[name='banner[font_color]']").on
change: ->
App.Banners.update_font_color("#js-banner-title", $(this).val())
App.Banners.update_font_color("#js-banner-description", $(this).val())
| App.Banners =
update_banner: (selector, text) ->
$(selector).html(text)
update_background_color: (selector, background_color) ->
$(selector).css("background-color", background_color)
update_font_color: (selector, font_color) ->
$(selector).css("color", font_color)
initialize: ->
$("[data-js-banner-title]").on
change: ->
App.Banners.update_banner("#js-banner-title", $(this).val())
$("[data-js-banner-description]").on
change: ->
App.Banners.update_banner("#js-banner-description", $(this).val())
$("[name='banner[background_color]']").on
change: ->
App.Banners.update_background_color("#js-banner-background", $(this).val())
$("[name='banner[font_color]']").on
change: ->
App.Banners.update_font_color("#js-banner-title", $(this).val())
App.Banners.update_font_color("#js-banner-description", $(this).val())
| Remove unused JavaScript banners code | Remove unused JavaScript banners code
The banner `update_style` method isn't used since commit 82cb8d4c.
| CoffeeScript | agpl-3.0 | usabi/consul_san_borondon,usabi/consul_san_borondon,consul/consul,consul/consul,consul/consul,usabi/consul_san_borondon,consul/consul,usabi/consul_san_borondon,consul/consul |
da9c966bf828daadd8aa1df4fcd1eeabab7fc123 | 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_catalog, table_schema, table_name)
WHERE table_type = 'BASE TABLE' AND tables.table_schema NOT IN ('pg_catalog', 'information_schema')
""", (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) =>
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
| Use schema query from MySQL driver in tests. | Use schema query from MySQL driver in tests.
The query that builds a schema object for the compiler tests is
returning no rows on Travis CI. In this commit we replace that query
with the query from the MySQL driver that appears to be working on
Travis CI.
| CoffeeScript | mit | bigeasy/relatable,bigeasy/relatable |
ec40b66eba3e9b0597e160cb5a353aafb3edc739 | components/artwork_filter/collections/artwork_columns.coffee | components/artwork_filter/collections/artwork_columns.coffee | _ = require 'underscore'
Backbone = require 'backbone'
{ API_URL } = require('sharify').data
Artworks = require '../../../collections/artworks.coffee'
class Params extends Backbone.Model
defaults: size: 9, page: 1
next: ->
@set 'page', @get('page') + 1
prev: ->
@set 'page', @get('page') - 1
module.exports = class ArtworkColumns extends Artworks
url: ->
"#{API_URL}/api/v1/search/filtered/artist/#{@modelId}"
initialize: (models, options = {}) ->
{ @modelId } = options
@params = new Params
super
fetch: (options = {}) ->
options.data = _.extend (options.data or {}), @params.attributes
super
fetchFromBeginning: (options = {}) ->
@params.clear().set(@params.defaults)
@fetch options
nextPage: (options = {}) ->
@params.next()
options.error = _.wrap options.error, (error, collection, response, options) =>
@params.prev()
error? collection, response, options
@fetch options
| _ = require 'underscore'
Backbone = require 'backbone'
{ API_URL } = require('sharify').data
Artworks = require '../../../collections/artworks.coffee'
class Params extends Backbone.Model
defaults: size: 9, page: 1
next: ->
@set 'page', @get('page') + 1
prev: ->
@set 'page', @get('page') - 1
module.exports = class ArtworkColumns extends Artworks
url: ->
"#{API_URL}/api/v1/search/filtered/artist/#{@modelId}"
initialize: (models, options = {}) ->
{ @modelId } = options
@params = new Params
super
fetch: (options = {}) ->
@xhr.abort() if @xhr? and @xhr.readyState isnt 4
options.data = _.extend (options.data or {}), @params.attributes
@xhr = Artworks::fetch.call this, options
fetchFromBeginning: (options = {}) ->
@params.clear().set(@params.defaults)
@fetch options
nextPage: (options = {}) ->
@params.next()
options.error = _.wrap options.error, (error, collection, response, options) =>
@params.prev()
error? collection, response, options
@fetch options
| Abort pending artworks requests to fix race condition | Abort pending artworks requests to fix race condition
| CoffeeScript | mit | erikdstock/force,damassi/force,oxaudo/force,dblock/force,artsy/force-public,cavvia/force-1,mzikherman/force,cavvia/force-1,yuki24/force,eessex/force,artsy/force,kanaabe/force,anandaroop/force,artsy/force-public,anandaroop/force,erikdstock/force,xtina-starr/force,anandaroop/force,damassi/force,yuki24/force,xtina-starr/force,oxaudo/force,oxaudo/force,TribeMedia/force-public,anandaroop/force,joeyAghion/force,joeyAghion/force,kanaabe/force,mzikherman/force,kanaabe/force,eessex/force,kanaabe/force,xtina-starr/force,cavvia/force-1,eessex/force,mzikherman/force,xtina-starr/force,izakp/force,artsy/force,izakp/force,yuki24/force,oxaudo/force,erikdstock/force,dblock/force,izakp/force,joeyAghion/force,yuki24/force,joeyAghion/force,artsy/force,artsy/force,erikdstock/force,damassi/force,cavvia/force-1,mzikherman/force,TribeMedia/force-public,kanaabe/force,izakp/force,damassi/force,eessex/force,dblock/force |
4c81cd874fb81d8c3581217f1efe48779d869a67 | services/web/public/coffee/ide/review-panel/controllers/TrackChangesUpgradeModalController.coffee | services/web/public/coffee/ide/review-panel/controllers/TrackChangesUpgradeModalController.coffee | define [
"base"
], (App) ->
App.controller "TrackChangesUpgradeModalController", ($scope, $modalInstance) ->
$scope.cancel = () ->
$modalInstance.dismiss()
$scope.startFreeTrial = (source) ->
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
window.open("/user/subscription/new?planCode=student_free_trial_7_days")
$scope.startedFreeTrial = true | define [
"base"
], (App) ->
App.controller "TrackChangesUpgradeModalController", ($scope, $modalInstance) ->
$scope.cancel = () ->
$modalInstance.dismiss()
| Remove unnecessary method - handled by FreeTrialModalController | Remove unnecessary method - handled by FreeTrialModalController
| CoffeeScript | agpl-3.0 | sharelatex/sharelatex |
dfe9da7738abc413225a733703fbfc5e471e6b5c | app/assets/javascripts/router.js.coffee | app/assets/javascripts/router.js.coffee | # For more information see: http://emberjs.com/guides/routing/
ETahi.Router.map ()->
@route('flow_manager')
@resource 'paper', { path: '/papers/:paper_id' }, ->
@route('edit')
@route('manage')
@route('submit')
@route('task', {path: '/papers/:paper_id/tasks/:task_id'})
@route('paper_new', { path: '/papers/new' })
@route('signin', {path: '/users/sign_in'})
@route('signup', {path: '/users/sign_up'})
@route('profile', {path: '/profile'})
@resource('affiliation')
@resource('author')
@resource 'admin', ->
@resource 'journal_user', path: '/journal_users/:journal_id'
@resource 'journal', path: '/journals/:journal_id', ->
@resource 'manuscript_manager_template', path: '/manuscript_manager_templates', ->
@route('new')
@route('edit', path: '/:template_id/edit')
if window.history and window.history.pushState
ETahi.Router.reopen
rootURL: '/'
location: 'history'
| # For more information see: http://emberjs.com/guides/routing/
ETahi.Router.map ()->
@route('flow_manager')
@resource 'paper', { path: '/papers/:paper_id' }, ->
@route('edit')
@route('manage')
@route('submit')
@route('task', {path: '/papers/:paper_id/tasks/:task_id'})
@route('paper_new', { path: '/papers/new' })
@route('password_new', {path: '/users/password/new'})
@route('password_edit', {path: '/users/password/edit'})
@route('signup', {path: '/users/sign_up'})
@route('signin', {path: '/users/sign_in'})
@route('signup', {path: '/users/sign_up'})
@route('profile', {path: '/profile'})
@resource('affiliation')
@resource('author')
@resource 'admin', ->
@resource 'journal_user', path: '/journal_users/:journal_id'
@resource 'journal', path: '/journals/:journal_id', ->
@resource 'manuscript_manager_template', path: '/manuscript_manager_templates', ->
@route('new')
@route('edit', path: '/:template_id/edit')
if window.history and window.history.pushState
ETahi.Router.reopen
rootURL: '/'
location: 'history'
| Make sure the header appears on password pages | Make sure the header appears on password pages
| CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi |
fad133865fb98d2998cfa7acb1337620765196af | app/assets/javascripts/static.js.coffee | app/assets/javascripts/static.js.coffee | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
formatNumberWithCommaDelimiter = (number) ->
Math.ceil(number).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
animateNumber = (element, target_count, duration) ->
step_one_target_count = target_count - 40
jQuery(counter: 0).animate { counter: step_one_target_count },
duration: duration
easing: "easeInOutQuint"
step: ->
element.text formatNumberWithCommaDelimiter(@counter)
complete: ->
jQuery(counter: step_one_target_count).animate { counter: (target_count) },
duration: 400
easing: "easeOutQuint"
step: ->
element.text formatNumberWithCommaDelimiter(@counter)
return
return
return
$ ->
metricsInview = new (Waypoint.Inview)(
element: $('.metric-box')[0]
enter: (direction) ->
$(".metric-box strong").each (index) ->
$target_count = parseInt($(this).text().replace(/\,/g, ''))
animateNumber($(this), $target_count, 300 + index * 200) if $target_count > 0
# only run this once
this.destroy()
)
| # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
formatNumberWithCommaDelimiter = (number) ->
Math.ceil(number).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
animateNumber = (element, target_final_count, duration) ->
step_one_target_count = target_final_count - 40
jQuery(counter: 0).animate { counter: step_one_target_count },
duration: duration
easing: "easeInOutQuint"
step: ->
element.text formatNumberWithCommaDelimiter(@counter)
complete: ->
jQuery(counter: step_one_target_count).animate { counter: (target_final_count) },
duration: 400
easing: "easeOutQuint"
step: ->
element.text formatNumberWithCommaDelimiter(@counter)
return
return
return
$ ->
metricsInview = new (Waypoint.Inview)(
element: $('.metric-box')[0]
enter: (direction) ->
$(".metric-box strong").each (index) ->
$target_count = parseInt($(this).text().replace(/\,/g, ''))
animateNumber($(this), $target_count, 300 + index * 200) if $target_count > 0
# only run this once
this.destroy()
)
| Rename variable for clarity (Refactor only) | Rename variable for clarity (Refactor only)
| CoffeeScript | agpl-3.0 | openaustralia/morph,otherchirps/morph,openaustralia/morph,openaustralia/morph,openaustralia/morph,otherchirps/morph,openaustralia/morph,otherchirps/morph,openaustralia/morph,openaustralia/morph,otherchirps/morph,otherchirps/morph,otherchirps/morph,otherchirps/morph |
397ee07907543c2af8323d88f0be871b0805dfa1 | atom/dot-atom/projects.leopard-jkg.cson | atom/dot-atom/projects.leopard-jkg.cson | [
{
title: "Spyns"
group: "Development"
paths: [
"~/Development/spyns"
]
}
{
title: "CSI-702: Homework02 Instructor Attempt"
group: "Mason Fall 2017"
paths: [
"~/Documents/work/teaching/2017_Spring_Semester/CSI-702_High_Performance_Computing/assignments/homework02-instructor-attempt"
]
}
]
| [
{
title: "Spyns"
group: "Development"
paths: [
"~/Development/spyns"
]
},
{
title: "CSI-702: Homework02 Instructor Attempt"
group: "Mason Spring 2017"
paths: [
"~/Documents/work/teaching/2017_Spring_Semester/CSI-702_High_Performance_Computing/assignments/homework02-instructor-attempt"
]
},
]
| Fix group for Atom project | Fix group for Atom project
| CoffeeScript | unlicense | jkglasbrenner/dotfiles,jkglasbrenner/dotfiles,jkglasbrenner/dotfiles,jkglasbrenner/dotfiles,jkglasbrenner/dotfiles,jkglasbrenner/dotfiles |
d0c95bf12cbbe0d70a0a4603a41d0b116004d629 | app/choose-subject-set.cjsx | app/choose-subject-set.cjsx | React = require 'react'
module.exports = React.createClass
displayName: 'ChooseSubjectSet'
getInitialState: ->
subject_sets: []
componentWillMount: ->
@props.workflow?.get 'subject_sets', page_size: 40
.then (subject_sets) =>
subject_sets.sort (a, b) ->
return 1 if a.metadata.BOROUGH > b.metadata.BOROUGH
return -1 if a.metadata.BOROUGH < b.metadata.BOROUGH
return 1 if a.metadata['File prefix'] > b.metadata['File prefix']
return -1 if a.metadata['File prefix'] < b.metadata['File prefix']
return 0
@setState {subject_sets}
render: ->
<div className="reports">
<h2>Choose a report to work on</h2>
<ul>
{<li key="set-#{subject_set.id}"><a onClick={@update} href="#/classify/#{subject_set.id}">{subject_set.display_name}<br/>{subject_set.metadata.BOROUGH}<br/>{subject_set.metadata.Date}</a></li> for subject_set in @state.subject_sets}
</ul>
</div>
update: (e) ->
subject_set_id = e.currentTarget.href.split('/').pop()
@props.onChange subject_set_id | React = require 'react'
module.exports = React.createClass
displayName: 'ChooseSubjectSet'
getInitialState: ->
subject_sets: []
componentWillMount: ->
@props.workflow?.get 'subject_sets', page_size: 40
.then (subject_sets) =>
subject_sets.sort (a, b) ->
return 1 if a.metadata.BOROUGH > b.metadata.BOROUGH
return -1 if a.metadata.BOROUGH < b.metadata.BOROUGH
return 1 if a.metadata['File prefix'] > b.metadata['File prefix']
return -1 if a.metadata['File prefix'] < b.metadata['File prefix']
return 0
@setState {subject_sets}
render: ->
<div className="reports">
<h2>Choose a report to work on</h2>
<ul>
{<li key="set-#{subject_set.id}"><a onClick={@update} href="#/classify/#{subject_set.id}">{subject_set.display_name}<br/>{subject_set.metadata.BOROUGH.replace(' (London, England)', '')}<br/>{subject_set.metadata.Date}</a></li> for subject_set in @state.subject_sets}
</ul>
</div>
update: (e) ->
subject_set_id = e.currentTarget.href.split('/').pop()
@props.onChange subject_set_id | Trim '(London, England)' from borough names | Trim '(London, England)' from borough names
| CoffeeScript | apache-2.0 | zooniverse/wellcome,zooniverse/wellcome |
73c6ff1628768f5e64ce9a31eb2efeadc390fa79 | src/index.coffee | src/index.coffee | throttle = require 'lodash.throttle'
events = require 'dom-events'
listeners = []
exports.listen = (fn) ->
listeners.push fn
active = ->
for fn in listeners
fn()
exports.active = throttledActive = throttle active, 5000, leading: true
if typeof window isnt "undefined"
# Listen to mouse movements.
events.on(window, 'mousemove', (e) ->
throttledActive()
)
# Listen to touchstart events
events.on(window, 'touchstart', (e) ->
throttledActive()
)
# Listen to touchmove events
events.on(window, 'touchmove', (e) ->
throttledActive()
)
# Listen to clicks.
events.on(window, 'click', (e) ->
throttledActive()
)
# Listen to keyboard presses.
events.on(window, 'keyup', (e) ->
throttledActive()
)
# Listen for scrolling.
events.on(window, 'scroll', (e) ->
throttledActive()
)
| throttle = require 'lodash.throttle'
events = require '@kylemathews/dom-events'
listeners = []
exports.listen = (fn) ->
listeners.push fn
active = ->
for fn in listeners
fn()
exports.active = throttledActive = throttle active, 5000, leading: true
if typeof window isnt "undefined"
# Listen to mouse movements.
events.on(window, 'mousemove', (e) ->
throttledActive()
)
# Listen to touchstart events
events.on(window, 'touchstart', (e) ->
throttledActive()
)
# Listen to touchmove events
events.on(window, 'touchmove', (e) ->
throttledActive()
)
# Listen to clicks.
events.on(window, 'click', (e) ->
throttledActive()
)
# Listen to keyboard presses.
events.on(window, 'keyup', (e) ->
throttledActive()
)
# Listen for scrolling.
events.on(window, 'scroll', (e) ->
throttledActive()
)
| Use scoped version of module | Use scoped version of module
| CoffeeScript | mit | KyleAMathews/engagement,KyleAMathews/engagement |
a2930d639178647eefb0acf5493e20c92c6578ea | client/app/lib/components/sidebarstacksection/sidebarstackheadersection.coffee | client/app/lib/components/sidebarstacksection/sidebarstackheadersection.coffee | Link = require 'app/components/common/link'
React = require 'kd-react'
module.exports = class SidebarStackHeaderSection extends React.Component
render: ->
<div className='SidebarTeamSection'>
<Link className='SidebarSection-headerTitle' href='/Stacks'>
STACKS
<span className="SidebarSection-secondaryLink"></span>
</Link>
{@props.children}
</div>
| Link = require 'app/components/common/link'
React = require 'kd-react'
module.exports = class SidebarStackHeaderSection extends React.Component
render: ->
<div className='SidebarTeamSection'>
<Link className='SidebarSection-headerTitle' href='/Stacks'>
STACKS
<span className='SidebarSection-secondaryLink'></span>
</Link>
{@props.children}
</div>
| Use single quote for className attribute | Use single quote for className attribute
| CoffeeScript | agpl-3.0 | cihangir/koding,gokmen/koding,gokmen/koding,sinan/koding,alex-ionochkin/koding,rjeczalik/koding,andrewjcasal/koding,rjeczalik/koding,andrewjcasal/koding,jack89129/koding,alex-ionochkin/koding,usirin/koding,cihangir/koding,cihangir/koding,kwagdy/koding-1,drewsetski/koding,usirin/koding,szkl/koding,alex-ionochkin/koding,usirin/koding,kwagdy/koding-1,jack89129/koding,drewsetski/koding,cihangir/koding,usirin/koding,mertaytore/koding,drewsetski/koding,andrewjcasal/koding,rjeczalik/koding,mertaytore/koding,kwagdy/koding-1,sinan/koding,rjeczalik/koding,andrewjcasal/koding,mertaytore/koding,kwagdy/koding-1,mertaytore/koding,usirin/koding,koding/koding,mertaytore/koding,koding/koding,drewsetski/koding,mertaytore/koding,koding/koding,jack89129/koding,alex-ionochkin/koding,cihangir/koding,sinan/koding,koding/koding,szkl/koding,gokmen/koding,koding/koding,jack89129/koding,acbodine/koding,drewsetski/koding,jack89129/koding,kwagdy/koding-1,koding/koding,koding/koding,andrewjcasal/koding,kwagdy/koding-1,alex-ionochkin/koding,gokmen/koding,gokmen/koding,gokmen/koding,mertaytore/koding,cihangir/koding,sinan/koding,rjeczalik/koding,szkl/koding,drewsetski/koding,jack89129/koding,szkl/koding,kwagdy/koding-1,acbodine/koding,alex-ionochkin/koding,acbodine/koding,cihangir/koding,acbodine/koding,gokmen/koding,kwagdy/koding-1,andrewjcasal/koding,rjeczalik/koding,acbodine/koding,usirin/koding,alex-ionochkin/koding,acbodine/koding,jack89129/koding,usirin/koding,mertaytore/koding,rjeczalik/koding,gokmen/koding,sinan/koding,andrewjcasal/koding,szkl/koding,drewsetski/koding,drewsetski/koding,koding/koding,acbodine/koding,cihangir/koding,szkl/koding,sinan/koding,alex-ionochkin/koding,szkl/koding,acbodine/koding,szkl/koding,sinan/koding,sinan/koding,rjeczalik/koding,andrewjcasal/koding,usirin/koding,jack89129/koding |
4bc64b460299b0b6f7416d645fed79355f0b1665 | keymaps/fuzzy-finder.cson | keymaps/fuzzy-finder.cson | 'body':
'meta-t': 'fuzzy-finder:toggle-file-finder'
'meta-b': 'fuzzy-finder:toggle-buffer-finder'
'ctrl-.': 'fuzzy-finder:find-under-cursor'
'meta-B': 'fuzzy-finder:toggle-git-status-finder'
| 'body':
'meta-t': 'fuzzy-finder:toggle-file-finder'
'meta-p': 'fuzzy-finder:toggle-file-finder'
'meta-b': 'fuzzy-finder:toggle-buffer-finder'
'ctrl-.': 'fuzzy-finder:find-under-cursor'
'meta-B': 'fuzzy-finder:toggle-git-status-finder'
| Add cmd-p to match sublime text's bindings | Add cmd-p to match sublime text's bindings | CoffeeScript | mit | segiddins/fuzzy-finder,toshi-saito/fuzzy-finder,Kerruba/fuzzy-finder,gvanderest/fuzzy-finder,Spy-Seth/fuzzy-finder,Kerruba/fuzzy-finder,atom/fuzzy-finder,viddo/fuzzy-finder,nielsAD/fuzzy-finder,pombredanne/fuzzy-finder,nielsAD/fuzzy-finder,Spy-Seth/fuzzy-finder,gvanderest/fuzzy-finder,segiddins/fuzzy-finder,viddo/fuzzy-finder,pombredanne/fuzzy-finder |
5f45361559c8d0f0e86c832fb9a450cc6c67018a | test/demo-mock.coffee | test/demo-mock.coffee | define [
'jquery'
'mockjax'
], ($) ->
$.mockjax
url: '/api/me'
proxy: 'data/me.json'
$.mockjax
url: '/api/content'
proxy: 'data/content.json'
$.mockjax (settings) ->
# url: '/api/content/<id>'
id = settings.url.match(/\/api\/content\/(.*)$/);
if id
return {proxy: 'data/content/' + id[1] + '.json'}
# Load the actual app
require(['cs!../scripts/config'])
| define [
'jquery'
'mockjax'
], ($) ->
$.mockjax
url: '/me'
proxy: 'data/me.json'
$.mockjax
url: '/api/content'
proxy: 'data/content.json'
$.mockjax (settings) ->
# url: '/api/content/<id>'
id = settings.url.match(/\/api\/content\/(.*)$/);
if id
return {proxy: 'data/content/' + id[1] + '.json'}
# Load the actual app
require(['cs!../scripts/config'])
| Update test to respond to '/me' | Update test to respond to '/me'
| CoffeeScript | agpl-3.0 | oerpub/github-bookeditor,oerpub/github-bookeditor,oerpub/bookish,oerpub/github-bookeditor,oerpub/bookish |
c581e60e8bc2aa8685725860b51c0f661a2b2d94 | lib/package-updates-status-view.coffee | lib/package-updates-status-view.coffee | _ = require 'underscore-plus'
{View} = require 'atom-space-pen-views'
module.exports =
class PackageUpdatesStatusView extends View
@content: ->
@div class: 'package-updates-status-view inline-block text text-info', =>
@span class: 'icon icon-package'
@span outlet: 'countLabel', class: 'available-updates-status'
initialize: (statusBar, packages) ->
@countLabel.text(packages.length)
@tooltip = atom.tooltips.add(@element, title: "#{_.pluralize(packages.length, 'package update')} available")
@tile = statusBar.addRightTile(item: this, priority: 0)
@on 'click', =>
atom.commands.dispatch(atom.views.getView(atom.workspace), 'settings-view:check-for-package-updates')
@tooltip.dispose()
@tile.destroy()
| _ = require 'underscore-plus'
{View} = require 'atom-space-pen-views'
module.exports =
class PackageUpdatesStatusView extends View
@content: ->
@div class: 'package-updates-status-view inline-block text text-info', =>
@span class: 'icon icon-package'
@span outlet: 'countLabel', class: 'available-updates-status'
initialize: (statusBar, packages) ->
@countLabel.text("#{_.pluralize(packages.length, 'update')}!")
@tooltip = atom.tooltips.add(@element, title: "#{_.pluralize(packages.length, 'package update')} available")
@tile = statusBar.addRightTile(item: this, priority: 0)
@on 'click', =>
atom.commands.dispatch(atom.views.getView(atom.workspace), 'settings-view:check-for-package-updates')
@tooltip.dispose()
@tile.destroy()
| Add suffix to update count | Add suffix to update count
| CoffeeScript | mit | atom/settings-view |
6f1abb50998b0f77b9b7e06ffcd2e5f27ebe0be1 | lib/views/pull-branch-list-view.coffee | lib/views/pull-branch-list-view.coffee | git = require '../git'
OutputView = require './output-view'
BranchListView = require './branch-list-view'
module.exports =
# Extension of BranchListView
# Takes the name of the remote to pull from
class PullBranchListView extends BranchListView
initialize: (@remote) ->
git.cmd
args: ['branch', '-r'],
stdout: (@data) =>
if @data.split("\n").length is 1
@pull()
else
super
confirmed: ({name}) ->
@pull(name.split('/')[1])
@cancel()
pull: (remoteBranch='') ->
view = new OutputView()
git.cmd
args: ['pull', @remote, remoteBranch]
stdout: (data) -> view.addLine(data.toString())
stderr: (data) -> view.addLine(data.toString())
exit: (code) =>
view.finish()
| git = require '../git'
OutputView = require './output-view'
BranchListView = require './branch-list-view'
module.exports =
# Extension of BranchListView
# Takes the name of the remote to pull from
class PullBranchListView extends BranchListView
initialize: (@remote) ->
git.cmd
args: ['branch', '-r'],
stdout: (@data) =>
super
confirmed: ({name}) ->
@pull(name.split('/')[1])
@cancel()
pull: (remoteBranch='') ->
view = new OutputView()
remote = @remote
git.cmd
args: ['fetch', @remote]
stdout: (@data) ->
if @data.toString().length is 0
git.cmd
args: ['merge', remote + "/" + remoteBranch]
stdout: (data) -> view.addLine(data.toString())
stderr: (data) -> view.addLine(data.toString())
exit: (code) =>
view.finish()
stderr: (data) -> view.addLine(data.toString())
| Fix for git pull in mac | Fix for git pull in mac
this fix is for git pull in mac in yosemite and older OS | CoffeeScript | mit | akonwi/git-plus,akonwi/git-plus |
64c5dc9c2a4ca70df0220b70c75466074852b2b7 | script.coffee | script.coffee | jQuery(document).ready ->
writeanswer = (ans) ->
jQuery("#answer").html(ans)
answer = () ->
question = jQuery("#question").val()
jQuery.getJSON("/service/?question=#{question}", (data) -> writeanswer(data['answer']))
jQuery("#ask").click( (event) ->
event.preventDefault()
answer() )
# Doesn't look like following is needed as firefox fires the
# button click when enter pressed on the input field
#jQuery("#question").keydown( (event) ->
#if event.which == 13
#answer() )
# if the browser doesn't support svg, use a png
if not document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")
jQuery("#robot").attr("src", "decisiverobot.png") | jQuery(document).ready ->
writeanswer = (ans) ->
jQuery("#answer").html(ans)
answer = () ->
question = jQuery("#question").val()
jQuery.getJSON("/service/?question=#{question}", (data) -> writeanswer(data['answer']))
jQuery("form").submit( (event) ->
event.preventDefault()
answer()
return false )
# if the browser doesn't support svg, use a png
if not document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")
jQuery("#robot").attr("src", "decisiverobot.png") | Call service by intercepting form submit, not button or key presses | Call service by intercepting form submit, not button or key presses
| CoffeeScript | agpl-3.0 | DanielKinsman/decisive-robot |
82006001c003ced689e5704e351ef00157660a48 | lib/styles/index.coffee | lib/styles/index.coffee | fs = require 'fs'
stylus = require 'stylus'
converter = require './converter'
module.exports =
build: (options, callback) ->
if config = options.stylus
fs.readFile config.main, 'utf8', (err, source) ->
config.paths ?= []
config.paths.push "#{__dirname}/../../styles"
renderer = stylus(source)
.set 'paths', config.paths
if plugins = config.plugins
for plugin in config.plugins
if loadStyles = require(plugin)?.loadStyles
renderer.use loadStyles
converter.convertRenderer renderer, (err, out) ->
fs.writeFile config.output, "STYLES = #{JSON.stringify(out, null, ' ')};", (err) ->
if err
console.warn 'err', err if err
else
console.log "Compiled #{options.stylus.output}"
callback?()
| fs = require 'fs'
stylus = require 'stylus'
converter = require './converter'
module.exports =
build: (options, callback) ->
if config = options.stylus
fs.readFile config.main, 'utf8', (err, source) ->
config.paths ?= []
config.paths.push "#{__dirname}/../../styles"
renderer = stylus(source)
.set 'paths', config.paths
if plugins = config.plugins
for plugin in config.plugins
if loadStyles = require(plugin)?.loadStyles
renderer.use loadStyles
converter.convertRenderer renderer, (err, out) ->
fs.writeFile config.output, "STYLES = #{JSON.stringify(out, null, ' ')};", (err) ->
if err
console.warn 'err', err if err
else
console.log "Compiled #{options.stylus.output}"
callback?()
else
console.log 'stylus node not included in package - skipping style compilation'
callback?()
| Handle missing stylus node in style compilation | Handle missing stylus node in style compilation
| CoffeeScript | mit | trabian/titanium-backbone,trabian/titanium-backbone,vcu/titanium-backbone,vcu/titanium-backbone |
dee122423a1e9f82b1a21eff6443720b9f7b0020 | app/assets/javascripts/voluntary_core_module_emberjs/router.js.coffee | app/assets/javascripts/voluntary_core_module_emberjs/router.js.coffee | VoluntaryOnEmberjs.Router.map ->
@resource 'users'
VoluntaryOnEmberjs.Router.reopen
location: 'history' | VoluntaryOnEmberjs.Router.map ->
@resource 'users'
VoluntaryOnEmberjs.Router.reopen
location: 'hash' | Set router location to hash. | Set router location to hash.
| CoffeeScript | mit | volontariat/voluntary_core_module_emberjs,volontariat/voluntary-ember_js,volontariat/voluntary-ember_js,volontariat/voluntary_core_module_emberjs,volontariat/voluntary-ember_js,volontariat/voluntary_core_module_emberjs,volontariat/voluntary_core_module_emberjs,volontariat/voluntary-ember_js |
d48aa6deaee0beb09453486fddf2689a1678951f | public/javascripts/game.photography.coffee | public/javascripts/game.photography.coffee | jQuery(document).ready ->
class photographyGame
constructor: (@debug, @map) ->
init: () ->
return
| jQuery(document).ready ->
class photographyGame
constructor: (@debug, @map) ->
init: () ->
class location
constructor: (@position, @name, @icon) ->
@marker
addTo: (map) ->
if @icon
marker = new google.maps.Marker({
position: @position,
map: map,
icon: @icon,
title: @name
})
else
marker = new google.maps.Marker({
position: @position,
map: map,
title: @name
})
@marker = marker
@setListener(@marker)
setListener: (marker) ->
self = this
marker.addListener 'click', ->
mark.moveTo(self)
class player extends location
constructor: (@position, @name, @icon) ->
super(@position, @name, @icon)
@playerMarker
initTo: (map) ->
@playerMarker = new google.maps.Marker({
position: @position,
map: map,
icon: @icon,
title: 'Mark'
})
moveTo: (location) ->
console.log("current position", this.position, "new position", location.position, "distance travelled", distanceTravelled(this.position, location.position) + 'km')
@position = location.position
@playerMarker.setPosition(new google.maps.LatLng(location.position.lat, location.position.lng))
| Add location and player classes | Add location and player classes
| CoffeeScript | mit | STAB-Inc/Bygone,STAB-Inc/Bygone,STAB-Inc/Bygone |
345bc59238d47600d623dc158ca644a17dc7b1d3 | app/assets/javascripts/angular/controllers/member_ctrl.js.coffee | app/assets/javascripts/angular/controllers/member_ctrl.js.coffee | angular.module("hubud")
.controller "MemberCtrl", ($scope, $state, Restangular) ->
Restangular.one("members", $state.params.id).get().then (response) ->
$scope.member = response
Restangular.all("devices/types").getList().then (response) ->
$scope.deviceTypes = response
# Add device input
$scope.addDevice = ->
$scope.member.devices.push {}
| angular.module("hubud")
.controller "MemberCtrl", ($scope, $state, $http, Restangular) ->
Restangular.one("members", $state.params.id).get().then (response) ->
$scope.member = response
Restangular.all("devices/types").getList().then (response) ->
$scope.deviceTypes = response
# Add device input
$scope.addDevice = ->
$scope.member.devices.push {}
# Submit handler
$scope.submit = ->
devices = _.map($scope.member.devices, (device) ->
{
id: device.id,
mac_address: device.mac_address,
type_id: device.type_id,
_destroy: device.destroy || false
}
)
# If the need for updating more than devices arise, we need to add those
# attributes here.
payload = $.param({
member: {
devices_attributes: devices,
}
})
$http(
method: "PATCH"
url: '/members/' + $scope.member.id
data: payload
headers:
"Content-Type": "application/x-www-form-urlencoded"
).success (data, status, headers, config) ->
console.log "Success!"
| Add support for adding devices. | Add support for adding devices. | CoffeeScript | mit | lostboy/member-device-manager,hubud/member-device-manager,lostboy/member-device-manager |
6b54fd5cd965bd7568d756ca7e68fc1b59189705 | build/tasks/bootstrap-atom.coffee | build/tasks/bootstrap-atom.coffee | cp = require '../../script/utils/child-process-wrapper.js'
workDir = null
module.exports = (grunt) ->
grunt.registerTask 'bootstrap-atom', 'Bootstraps Atom', ->
done = @async()
process.chdir(grunt.config.get('workDir'))
cp.safeExec 'node script/bootstrap --no-quiet', ->
done()
| cp = require '../../script/utils/child-process-wrapper.js'
workDir = null
module.exports = (grunt) ->
grunt.registerTask 'bootstrap-atom', 'Bootstraps Atom', ->
done = @async()
process.chdir(grunt.config.get('workDir'))
cp.safeSpawn 'node script/bootstrap --no-quiet', ->
done()
| Use spawn instead of exec | Use spawn instead of exec
| CoffeeScript | apache-2.0 | spark/particle-dev |
fc8d3ac3ece09cc117ceeb514190cfc1d36afd29 | app/assets/javascripts/models/farm.coffee | app/assets/javascripts/models/farm.coffee | class window.Farm
constructor: (@name) ->
@points = []
addPoint: (point) ->
@points.push(point)
removePoint: ->
@points.pop()
submitPoints: ->
@throwIfInvalidGeom()
@setLastPointToFirstPoint()
console.log "Submitting polygon:"
console.log @points
query = @buildInsertQuery()
$.post('/farms', query: query)
buildInsertQuery: ->
"""
INSERT INTO thats_my_farm (name, the_geom)
VALUES ('#{@name}', '#{@pointsToPolygon()}')
"""
pointsToPolygon: ->
wktPoints = []
for point in @points
wktPoints.push "#{point.lat} #{point.lng}"
wkt = "SRID=4326;POLYGON ((#{wktPoints.join()}))"
throwIfInvalidGeom: ->
unless @points.length > 2
throw new Error("Polygons must contain >2 points, but got #{@points.length}")
setLastPointToFirstPoint: ->
@points.push(@points[0])
| class window.Farm
constructor: (@name) ->
@points = []
addPoint: (point) ->
@points.push(point)
removePoint: ->
@points.pop()
submitPoints: ->
@throwIfInvalidGeom()
@setLastPointToFirstPoint()
console.log "Submitting polygon:"
console.log @points
query = @buildInsertQuery()
$.post('/farms', query: query)
buildInsertQuery: ->
"""
INSERT INTO thats_my_farm (name, the_geom)
VALUES ('#{@name}', '#{@pointsToPolygon()}')
"""
pointsToPolygon: ->
wktPoints = []
for point in @points
wktPoints.push "#{point.lng} #{point.lat}"
wkt = "SRID=4326;POLYGON ((#{wktPoints.join()}))"
throwIfInvalidGeom: ->
unless @points.length > 2
throw new Error("Polygons must contain >2 points, but got #{@points.length}")
setLastPointToFirstPoint: ->
@points.push(@points[0])
| Fix inevitable sending of lat lng in wrong order | Fix inevitable sending of lat lng in wrong order
| CoffeeScript | mit | onlyjsmith/thats-my-park,onlyjsmith/thats-my-park |
a0bc01b66a65c0483f1a2e5941c950831347403c | scripts/xcode-server.coffee | scripts/xcode-server.coffee | # Description
# Notifies based on the results of xcode builds and controls xcode builds
#
# Dependencies
# None
#
# Configuration
# None
#
# Commands:
# hubot build <bot name> - Start a build for bot named <bot name> UNIMPLEMENTED
#
# Author:
# bmnick
url = require('url')
querystring = require('querystring')
module.exports = (robot) ->
robot.router.post "/hubot/xcode-publish-notify", (req, res) ->
query = querystring.parse(url.parse(req.url).query)
app = query.app || null
success = query.success || false
version = query.version || null
number = query.number || null
error = query.error || null
if success
robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.'
else
robot.messageRoom '#publishmobileautomati', 'BUILD FAILED: ' + app + ' with error ' + error
res.writeHead 204, { 'Content-Length': 0}
res.end()
| # Description
# Notifies based on the results of xcode builds and controls xcode builds
#
# Dependencies
# None
#
# Configuration
# None
#
# Commands:
# hubot build <bot name> - Start a build for bot named <bot name> UNIMPLEMENTED
#
# Author:
# bmnick
url = require('url')
querystring = require('querystring')
module.exports = (robot) ->
robot.router.get "/hubot/xcode-publish-notify", (req, res) ->
query = querystring.parse(url.parse(req.url).query)
app = query.app || null
success = query.success || false
version = query.version || null
number = query.number || null
error = query.error || null
if success
robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.'
else
robot.messageRoom '#publishmobileautomati', 'BUILD FAILED: ' + app + ' with error ' + error
res.writeHead 204, { 'Content-Length': 0}
res.end()
| Switch to a get request as it should have been | Switch to a get request as it should have been
| CoffeeScript | mit | brandnetworks/our-product-slack-hubot |
985344c0d74edfb3c138525213d336e670048236 | services/web/app/coffee/infrastructure/Features.coffee | services/web/app/coffee/infrastructure/Features.coffee | Settings = require 'settings-sharelatex'
module.exports = Features =
externalAuthenticationSystemUsed: ->
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
hasFeature: (feature) ->
switch feature
when 'homepage'
return Settings.enableHomepage
when 'registration'
return not Features.externalAuthenticationSystemUsed()
when 'github-sync'
return Settings.enableGithubSync
when 'v1-return-message'
return Settings.accountMerge? and Settings.overleaf?
when 'v2-banner'
return Settings.showV2Banner
when 'custom-togglers'
return Settings.overleaf?
when 'templates'
return !Settings.overleaf?
when 'affiliations'
return Settings?.apis?.v1?.url?
when 'rich-text'
isEnabled = true # Switch to false to disable
Settings.overleaf? and isEnabled
when 'redirect-sl'
return Settings.createV1AccountOnLogin
else
throw new Error("unknown feature: #{feature}")
| Settings = require 'settings-sharelatex'
module.exports = Features =
externalAuthenticationSystemUsed: ->
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
hasFeature: (feature) ->
switch feature
when 'homepage'
return Settings.enableHomepage
when 'registration'
return not Features.externalAuthenticationSystemUsed()
when 'github-sync'
return Settings.enableGithubSync
when 'v1-return-message'
return Settings.accountMerge? and Settings.overleaf?
when 'v2-banner'
return Settings.showV2Banner
when 'custom-togglers'
return Settings.overleaf?
when 'templates'
return !Settings.overleaf?
when 'affiliations'
return Settings?.apis?.v1?.url?
when 'rich-text'
isEnabled = true # Switch to false to disable
Settings.overleaf? and isEnabled
when 'redirect-sl'
return Settings.redirectToV2?
else
throw new Error("unknown feature: #{feature}")
| Use redirect setting instead of re-using setting that coincidentally would be flipped on the same day | Use redirect setting instead of re-using setting that coincidentally would be flipped on the same day
| CoffeeScript | agpl-3.0 | sharelatex/sharelatex |
f77e049bf7b3eb325c21869bc7baede3d62b5e3c | server/index.coffee | server/index.coffee | Messages = new Meteor.Collection('messages')
irc = Meteor.require 'irc'
clients = {}
Meteor.publish 'channel', (channel, nick) ->
if channel && nick
listen channel, nick
Messages.find(channel : channel)
listen = (channel, nick) ->
console.log(channel, nick)
client = clients[nick] = new irc.Client 'chat.freenode.net', nick, {
channels : [channel]
}
client.on 'error', console.log
client.on 'message', (from, to, message) ->
console.log(from, to, message)
Fiber(->
Messages.insert {
from,
message
channel : to,
}
)
| Messages = new Meteor.Collection('messages')
irc = Meteor.require 'irc'
clients = {}
Meteor.publish 'channel', (channel, nick) ->
if channel && nick
listen channel, nick
Messages.find(channel : channel)
listen = (channel, nick) ->
console.log(channel, nick)
client = clients[nick] = new irc.Client 'chat.freenode.net', nick, {
port : 6665
channels : [channel]
}
client.on 'error', console.log.bind(console, 'osdf')
client.on 'message', Meteor.bindEnvironment (from, to, message) ->
console.log(from, to, message)
Messages.insert {
from,
message
channel : to,
}
console.log(channel, nick, 'fuck')
| Fix writing messages to database | Fix writing messages to database
| CoffeeScript | mit | alFReD-NSH/cool-irc |
caad50d643382a108409012e260905e0b3a76bcb | atom.cson | atom.cson | "*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
nonWordCharacters: "^*\"`'/|\\?!;:,.%#@(){}[]<>=+~_"
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
"timecop"
"styleguide"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4
| "*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
nonWordCharacters: "^*\"`'/|\\?!;:,.%#@(){}[]<>=+-~_"
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
"timecop"
"styleguide"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4
| Fix word separation in Atom | Fix word separation in Atom
| CoffeeScript | mit | ai/environment,ai/environment |
7ad15ba1578fd6fd4d4aa3cc86a2c02e0dc2efb5 | src/adapters.coffee | src/adapters.coffee | # The default `.` adapter thats comes with Rivets.js. Allows subscribing to
# properties on POJSOs, implemented in ES5 natives using
# `Object.defineProperty`.
Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
obj[@id] = @counter++
@weakmap[obj[@id]] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value
| # The default `.` adapter thats comes with Rivets.js. Allows subscribing to
# properties on POJSOs, implemented in ES5 natives using
# `Object.defineProperty`.
Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
id = @counter++
Object.defineProperty obj, @id,
enumerable: false
configurable: false
writable: false
value: id
@weakmap[id] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value
| Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object. | Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object.
| CoffeeScript | mit | mikeric/rivets,re-clone/rivets,zongkelong/rivets,zongkelong/rivets,re-clone/rivets,nopnop/rivets,zongkelong/rivets,MishaMykhalyuk/rivets,mikeric/rivets,MishaMykhalyuk/rivets,MishaMykhalyuk/rivets,kangax/rivets,QAPInt/rivets,nopnop/rivets,jccazeaux/rivets,jccazeaux/rivets,altmind/rivets,GerHobbelt/rivets,mikeric/rivets,altmind/rivets,GerHobbelt/rivets,benderTheCrime/tiny-rivets,nopnop/rivets,moneyadviceservice/rivets,GerHobbelt/rivets,jccazeaux/rivets,npmcomponent/mikeric-rivets,QAPInt/rivets,QAPInt/rivets,re-clone/rivets,altmind/rivets |
60cae5036f50c74b098c0a121710688514f9d8f2 | src/cli/cmdz/openssl.coffee | src/cli/cmdz/openssl.coffee | vfilter = require '../vfilter'
exports.t = 'Install OpenSSL utility'
exports._ = "#{vfilter.$6} [.]"
exports.h = """
Install openssl.exe precompiled for Node.js project
"""
# Node.js v0.*.* contains OpenSSL binary
exports.$ = (args)->
force = period args
remote =
vfilter [0]
.last()
unless remote
throw Error 'Appropriate Node.js version not found!'
if false == remote.O vfilter.x64(args[0]), force
echo "OpenSSL is already installed. To reinstall say:", period.$
return
| vFilter = require '../vfilter'
exports.t = 'Install OpenSSL utility'
exports._ = "#{vFilter.$6} [.]"
exports.h = """
Install openssl.exe precompiled for Node.js project
"""
# Node.js v0.*.* contains OpenSSL binary
exports.$ = (args)->
force = period args
remote =
vfilter [0]
.last()
unless remote
throw Error 'Appropriate Node.js version not found!'
if false == remote.O vFilter.x64(args[0]), force
echo "OpenSSL is already installed. To reinstall say:", period.$
return
| Fix for both vfilter syntax in OpenSSL | Fix for both vfilter syntax in OpenSSL
| CoffeeScript | isc | ukoloff/nvms |
08c480e5be9c1dec2a5daa54367f8bd5a575f77f | src/buildbot.coffee | src/buildbot.coffee | fs = require('fs')
request = require('request')
unzip = require('unzip')
getURL = (filename) ->
baseurl = 'http://buildbot.libretro.com/'
if process.platform == 'win32'
if process.arch == 'ia32'
baseurl += 'nightly/win-x86/latest'
else if process.arch == 'x64'
baseurl += 'nightly/win-x86_64/latest'
else if process.platform == 'darwin'
if process.arch == 'ia32'
baseurl += 'nightly/osx-i386/latest'
else if process.arch == 'x64'
baseurl += 'nightly/osx-x86_64/latest'
else if process.platform == 'linux'
baseurl += 'nightly/linux/x86_64/latest'
baseurl += '/' + filename
baseurl += '.zip'
baseurl
exports.getCore = (core, cb) ->
filename = core
if process.platform == 'win32'
filename += '.dll'
else
filename += '.dylib'
if !fs.existsSync('.cores')
fs.mkdirSync '.cores'
path = '.cores/' + filename
if fs.existsSync(path)
cb path
return
request(getURL(filename)).pipe(unzip.Parse()).on 'entry', (entry) ->
if entry.type == 'File' and entry.path == filename
entry.pipe(fs.createWriteStream(path)).on 'close', ->
cb path
else
entry.autodrain()
| os = require('os')
fs = require('fs')
request = require('request')
unzip = require('unzip')
getURL = (filename) ->
baseurl = 'http://buildbot.libretro.com/'
if process.platform == 'win32'
if process.arch == 'ia32'
baseurl += 'nightly/win-x86/latest'
else if process.arch == 'x64'
baseurl += 'nightly/win-x86_64/latest'
else if process.platform == 'darwin'
if process.arch == 'ia32'
baseurl += 'nightly/osx-i386/latest'
else if process.arch == 'x64'
baseurl += 'nightly/osx-x86_64/latest'
else if process.platform == 'linux'
baseurl += 'nightly/linux/x86_64/latest'
baseurl += '/' + filename
baseurl += '.zip'
baseurl
exports.getCore = (core, cb) ->
filename = core
if process.platform == 'win32'
filename += '.dll'
else
filename += '.dylib'
path = os.tmpdir() + '/' + filename
if fs.existsSync(path)
cb path
return
request(getURL(filename)).pipe(unzip.Parse()).on 'entry', (entry) ->
if entry.type == 'File' and entry.path == filename
entry.pipe(fs.createWriteStream(path)).on 'close', ->
cb path
else
entry.autodrain()
| Use temp directory for core download. | Use temp directory for core download.
| CoffeeScript | mit | matthewbauer/x-retro,bposdude/game-player,matthewbauer/x-game,bposdude/game-player,matthewbauer/gametime-player,MixtapeIsFire/pokemonsave,MixtapeIsFire/pokemonsave,matthewbauer/x-retro,matthewbauer/x-game,bposdude/game-player,matthewbauer/x-game,matthewbauer/x-retro,matthewbauer/x-retro,matthewbauer/gametime-player |
39d82974dbbc887b8d26ced24340817dfbaa1e9d | src/dnsimple.coffee | src/dnsimple.coffee | # Description:
# Domain availability via DNSimple.
#
# Dependencies:
# None
#
# Configuration:
# DNSIMPLE_USERNAME
# DNSIMPLE_PASSWORD
#
# Commands:
# check domain <domainname> - returns whether a domain is available
#
# Author:
# jonmagic
module.exports = (robot) ->
robot.hear /check domain (.*)/i, (msg) ->
domain = escape(msg.match[1])
user = process.env.DNSIMPLE_USERNAME
pass = process.env.DNSIMPLE_PASSWORD
auth = 'Basic ' + new Buffer(user + ':' + pass).toString('base64');
msg.http("https://api.dnsimple.com/v1/domains/#{domain}/check")
.headers(Authorization: auth, Accept: 'application/json')
.get() (err, res, body) ->
switch res.statusCode
when 200
msg.send "Sorry, #{domain} is not available."
when 404
msg.send "Cybersquat that shit!"
when 401
msg.send "You need to authenticate by setting the DNSIMPLE_USERNAME & DNSIMPLE_PASSWORD environment variables"
else
msg.send "Unable to process your request and we're not sure why :("
| # Description:
# Domain availability via DNSimple.
#
# Dependencies:
# None
#
# Configuration:
# DNSIMPLE_USERNAME
# DNSIMPLE_API_TOKEN
#
# Commands:
# check domain <domainname> - returns whether a domain is available
#
# Author:
# jonmagic
dnsimpleToken = new Buffer(process.env.DNSIMPLE_USERNAME + ':' + process.env.DNSIMPLE_API_TOKEN).toString('base64');
module.exports = (robot) ->
robot.hear /check domain (.*)/i, (msg) ->
domain = escape(msg.match[1])
msg.http("https://api.dnsimple.com/v1/domains/#{domain}/check")
.headers("X-DNSimple-Token": dnsimpleToken, Accept: 'application/json')
.get() (err, res, body) ->
switch res.statusCode
when 200
msg.send "Sorry, #{domain} is not available."
when 404
msg.send "Cybersquat that shit!"
when 401
msg.send "You need to authenticate by setting the DNSIMPLE_USERNAME & DNSIMPLE_API_TOKEN environment variables"
else
msg.send "Unable to process your request and we're not sure why :("
| Use the API token instead of the plain password | Use the API token instead of the plain password
It will also prevent issues with 2FA.
| CoffeeScript | mit | aetrion/hubot-dnsimple |
6e1b9927aa4b877e6303b02242e7f152e582808c | lib/builder.coffee | lib/builder.coffee | _ = require 'underscore-plus'
path = require 'path'
module.exports =
class Builder
constructor: ->
@envPathKey = switch process.platform
when 'win32' then 'Path'
else 'PATH'
run: (args, callback) -> undefined
constructArgs: (filePath) -> undefined
parseLogFile: (texFilePath) -> undefined
constructChildProcessOptions: ->
env = _.clone(process.env)
env[@envPathKey] = childPath if childPath = @constructPath()
options = env: env
constructPath: ->
texPath = atom.config.get('latex.texPath')?.trim()
texPath = @defaultTexPath() unless texPath?.length
processPath = process.env[@envPathKey]
if match = texPath.match /^(.*)(\$PATH)(.*)$/
texPath = "#{match[1]}#{processPath}#{match[3]}"
else
texPath = [texPath, processPath].join(path.delimiter)
defaultTexPath: ->
switch process.platform
when 'win32'
'C:\\texlive\\2014\\bin\\win32'
else
'/usr/texbin'
resolveLogFilePath: (texFilePath) ->
outputDirectory = atom.config.get('latex.outputDirectory') ? ''
currentDirectory = path.dirname(texFilePath)
fileName = path.basename(texFilePath).replace(/\.\w+$/, '.log')
logFilePath = path.join(currentDirectory, outputDirectory, fileName)
| _ = require 'underscore-plus'
path = require 'path'
module.exports =
class Builder
constructor: ->
@envPathKey = switch process.platform
when 'win32' then 'Path'
else 'PATH'
run: (args, callback) -> undefined
constructArgs: (filePath) -> undefined
parseLogFile: (texFilePath) -> undefined
constructChildProcessOptions: ->
env = _.clone(process.env)
env[@envPathKey] = childPath if childPath = @constructPath()
options = env: env
constructPath: ->
texPath = atom.config.get('latex.texPath')?.trim()
texPath = @defaultTexPath() unless texPath?.length
processPath = process.env[@envPathKey]
if match = texPath.match /^(.*)(\$PATH)(.*)$/
texPath = "#{match[1]}#{processPath}#{match[3]}"
else
texPath = [texPath, processPath].join(path.delimiter)
defaultTexPath: ->
switch process.platform
when 'win32'
[
'C:\\texlive\\2014\\bin\\win32'
'C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64'
'C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin'
].join(';')
else
'/usr/texbin'
resolveLogFilePath: (texFilePath) ->
outputDirectory = atom.config.get('latex.outputDirectory') ? ''
currentDirectory = path.dirname(texFilePath)
fileName = path.basename(texFilePath).replace(/\.\w+$/, '.log')
logFilePath = path.join(currentDirectory, outputDirectory, fileName)
| Add support for MiKTeX 2.9 | Add support for MiKTeX 2.9
| CoffeeScript | mit | WoodyWoodsta/atom-latex,thomasjo/atom-latex,thomasjo/atom-latex,WoodyWoodsta/atom-latex,thomasjo/atom-latex |
7bfa06392ccfa1f8a584d1520e4b48160da68608 | app/assets/javascripts/ember_cart/ember/models/cart_item.js.coffee | app/assets/javascripts/ember_cart/ember/models/cart_item.js.coffee | EmberCart.CartItem = DS.Model.extend
cartable_id: DS.attr('number')
cartable_type: DS.attr('string')
name: DS.attr('string')
price: DS.attr('money')
quantity: DS.attr('number')
cart: DS.belongsTo('EmberCart.Cart')
parent: DS.belongsTo('EmberCart.CartItem')
children: DS.hasMany('EmberCart.CartItem', key: 'child_ids')
formattedPrice: Ember.computed( ->
round(@get('price'), 2)
).property('price')
increase: ->
@set('quantity', @get('quantity') + 1)
@get('children').forEach (c) ->
c.increase()
createChildren: (attrs) ->
@get('children').createRecord(attrs)
deleteRecord: ->
children = @get('children')
children.forEach (c) -> c.deleteRecord()
@_super()
| EmberCart.CartItem = DS.Model.extend
cartable_id: DS.attr('number')
cartable_type: DS.attr('string')
name: DS.attr('string')
price: DS.attr('money')
quantity: DS.attr('number')
cart: DS.belongsTo('EmberCart.Cart')
parent: DS.belongsTo('EmberCart.CartItem')
children: DS.hasMany('EmberCart.CartItem', key: 'child_ids')
formattedPrice: Ember.computed( ->
round(@get('price'), 2)
).property('price')
increase: ->
@set('quantity', @get('quantity') + 1)
@get('children').forEach (c) ->
c.increase()
createChildren: (attrs) ->
@get('children').createRecord(attrs)
deleteRecord: ->
@get('children').forEach (c) ->
c.deleteRecord() if c
@_super()
| Check the existance of the child | Check the existance of the child
| CoffeeScript | mit | menglifang/ember-cart,menglifang/ember-cart |
18775869f69692546046b711c049c6db301e81a6 | src/scripts/ids.coffee | src/scripts/ids.coffee | define (require, exports, module) ->
{dev} = require 'zooniverse/config'
module.exports = if dev
project: 'bat_detective'
workflow: '4fa0321854558f2fbf000003'
tutorialSubject: '4ff8306854558fc372000001'
else
project: 'bat_detective'
workflow: '4fff25b6516bcb41e7000002'
tutorialSubject: 'TUTORIAL_SUBJECT_ID'
| define (require, exports, module) ->
{dev} = require 'zooniverse/config'
module.exports = if dev
project: 'bat_detective'
workflow: '4fa0321854558f2fbf000003'
tutorialSubject: '4ff8306854558fc372000001'
else
project: 'bat_detective'
workflow: '4fff25b6516bcb41e7000002'
tutorialSubject: '5012b02e516bcbdb4e000001'
| Set beta tutorial subject ID | Set beta tutorial subject ID
| CoffeeScript | apache-2.0 | powolnymarcel/Bat-Detective,zooniverse/Bat-Detective,powolnymarcel/Bat-Detective,powolnymarcel/Bat-Detective,zooniverse/Bat-Detective,zooniverse/Bat-Detective |
6e5df4bc955ccb5673eb89b0b86fa66b115938d4 | options.coffee | options.coffee |
# Core settings
settings =
port: 9000
# Source and Destination
source = {}
source.baseDir = 'frontend/src'
source.scriptDir = "#{source.baseDir}/script"
source.jsShimDir = "#{source.baseDir}/js-shim"
source.jsDir = "#{source.baseDir}/js"
source.sassDir = "#{source.baseDir}/sass"
source.lessDir = "#{source.baseDir}/less"
source.cssDir = "#{source.baseDir}/css"
source.imageDir = "#{source.baseDir}/image"
source.fontDir = "#{source.baseDir}/font"
target = {}
target.baseDir = 'docker/var/www'
alpha = {}
alpha.baseDir = "#{target.baseDir}/alpha"
alpha.cssDir = "#{alpha.baseDir}/css"
alpha.jsDir = "#{alpha.baseDir}/js"
alpha.imageDir = "#{alpha.baseDir}/image"
alpha.fontDir = "#{alpha.baseDir}/font"
beta = {}
beta.baseDir = "#{target.baseDir}/beta"
module.exports =
source: source
target: target
alpha: alpha
beta: beta
settings: settings |
# Core settings
settings =
port: 9000
# Source and Destination
source = {}
source.baseDir = 'frontend/src'
source.scriptDir = "#{source.baseDir}/script"
source.jsShimDir = "#{source.baseDir}/js-shim"
source.jsDir = "#{source.baseDir}/js"
source.sassDir = "#{source.baseDir}/sass"
source.lessDir = "#{source.baseDir}/less"
source.cssDir = "#{source.baseDir}/css"
source.imageDir = "#{source.baseDir}/image"
source.fontDir = "#{source.baseDir}/font"
target = {}
target.baseDir = 'docker-web/var/www'
alpha = {}
alpha.baseDir = "#{target.baseDir}/alpha"
alpha.cssDir = "#{alpha.baseDir}/css"
alpha.jsDir = "#{alpha.baseDir}/js"
alpha.imageDir = "#{alpha.baseDir}/image"
alpha.fontDir = "#{alpha.baseDir}/font"
beta = {}
beta.baseDir = "#{target.baseDir}/beta"
module.exports =
source: source
target: target
alpha: alpha
beta: beta
settings: settings | Correct destination path for build to reflect docker name | Correct destination path for build to reflect docker name
| CoffeeScript | mit | smysnk/saddlewoof,smysnk/saddlewoof,smysnk/saddlewoof,smysnk/saddlewoof |
ab1dcc48edc3b747e5db7083d6b7be1337bb1a94 | lib/background-tips.coffee | lib/background-tips.coffee | BackgroundTipsView = require './background-tips-view'
module.exports =
activate: ->
@backgroundTipsView = new BackgroundTipsView()
deactivate: ->
@backgroundTipsView.detach()
| BackgroundTipsView = require './background-tips-view'
module.exports =
activate: ->
@backgroundTipsView = new BackgroundTipsView()
deactivate: ->
@backgroundTipsView.remove()
| Remove instead of detach on deactivate | Remove instead of detach on deactivate
| CoffeeScript | mit | atom/background-tips |
f42ebed5170a9b4982b0cd7b547f799120ac567c | src/csonc.coffee | src/csonc.coffee | path = require 'path'
_ = require 'underscore'
CSON = require './cson'
module.exports = (argv=[]) ->
[inputFile, outputFile] = argv
if inputFile?.length > 0
inputFile = path.resolve(process.cwd(), inputFile)
else
console.error("Input file must be first argument")
process.exit(1)
return
if outputFile?.length > 0
outputFile = path.resolve(process.cwd(), outputFile)
else
outputName = "#{path.basename(inputFile, path.extname(inputFile))}.json"
outputFile = path.join(path.dirname(inputFile), outputName)
try
object = CSON.readFileSync(inputFile)
catch e
console.error("File does not contain valid CoffeeScript: #{inputFile}")
process.exit(1)
CSON.writeFileSync(outputFile, object)
| path = require 'path'
_ = require 'underscore'
CSON = require './cson'
module.exports = (argv=[]) ->
[inputFile, outputFile] = argv
if inputFile?.length > 0
inputFile = path.resolve(process.cwd(), inputFile)
else
console.error("Input file must be first argument")
process.exit(1)
return
if outputFile?.length > 0
outputFile = path.resolve(process.cwd(), outputFile)
else
outputName = "#{path.basename(inputFile, path.extname(inputFile))}.json"
outputFile = path.join(path.dirname(inputFile), outputName)
try
object = CSON.readFileSync(inputFile)
catch e
console.error("Parsing #{inputFile} failed:", e.message)
process.exit(1)
CSON.writeFileSync(outputFile, object)
| Include error message in output | Include error message in output
| CoffeeScript | mit | soldair/season,mdekstrand/cson-sort,atom/season |
0657e8d0dfe89fde9f97bd4ff16eca69a18184a3 | lib/gazedata.coffee | lib/gazedata.coffee | _ = require 'underscore'
Point2D = require './point2d'
class Frame
constructor: (data)->
@data = data
@timestampString = data.timestamp
@timestamp = data.time
@state = data.state
@raw = @rawCoordinates = new Point2D(data.raw)
@avg = @smoothedCoordinates = new Point2D(data.avg)
@leftEye = new Eye(Eye.LEFT, data.lefteye)
@rightEye = new Eye(Eye.RIGHT, data.righteye)
@eyes = [ @leftEye, @rightEye ]
@isFixated = data.fix
class Eye
@LEFT = 0
@RIGHT = 1
constructor: (type, data)->
@type = type
@data = data
@raw = @rawCoordinates = new Point2D(data.raw)
@avg = @smoothedCoordinates = new Point2D(data.avg)
@pupilCenter = @pupilCenterCoordinates = new Point2D(data.pcenter)
@pupilSize = data.psize
class GazeData extends Frame
@Eye = Eye
module.exports = GazeData
| _ = require 'underscore'
Point2D = require './point2d'
class Frame
@STATE_TRACKING_GAZE = 1
@STATE_TRACKING_EYES = 1 << 1
@STATE_TRACKING_PRESENCE = 1 << 2
@STATE_TRACKING_FAIL = 1 << 3
@STATE_TRACKING_LOST = 1 << 4
constructor: (data)->
@data = data
@timestampString = data.timestamp
@timestamp = data.time
@state = data.state
@raw = @rawCoordinates = new Point2D(data.raw)
@avg = @smoothedCoordinates = new Point2D(data.avg)
@leftEye = new Eye(Eye.LEFT, data.lefteye)
@rightEye = new Eye(Eye.RIGHT, data.righteye)
@eyes = [ @leftEye, @rightEye ]
@isFixated = data.fix
class Eye
@LEFT = 0
@RIGHT = 1
constructor: (type, data)->
@type = type
@data = data
@raw = @rawCoordinates = new Point2D(data.raw)
@avg = @smoothedCoordinates = new Point2D(data.avg)
@pupilCenter = @pupilCenterCoordinates = new Point2D(data.pcenter)
@pupilSize = data.psize
class GazeData extends Frame
@Eye = Eye
module.exports = GazeData
| Add constants of tracker statuses to class Frame | Add constants of tracker statuses to class Frame
| CoffeeScript | mit | kzokm/eyetribe-websocket |
bfe9524ffed6d64e85d361589564fc3f0e7054af | lib/grammars.coffee | lib/grammars.coffee | # Maps Atom Grammar names to the interpreter used by that language
# As well as any special setup for arguments.
module.exports =
CoffeeScript:
interpreter: "coffee"
makeargs: (code) -> ['-e', code]
JavaScript:
interpreter: "node"
makeargs: (code) -> ['-e', code]
Ruby:
interpreter: "ruby"
makeargs: (code) -> ['-e', code]
Perl:
interpreter: "perl"
makeargs: (code) -> ['-e', code]
PHP:
interpreter: "php"
makeargs: (code) -> ['-r', code]
Python:
interpreter: "python"
makeargs: (code) -> ['-c', code]
'Shell Script (Bash)':
interpreter: "bash"
makeargs: (code) -> ['-c', code]
| # Maps Atom Grammar names to the command used by that language
# As well as any special setup for arguments.
defaultFileArgs = (filename) -> [filename]
module.exports =
CoffeeScript:
command: "coffee"
bySelectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
JavaScript:
command: "node"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
Ruby:
command: "ruby"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
Perl:
command: "perl"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
PHP:
command: "php"
selectionArgs: (code) -> ['-r', code]
byFileArgs: defaultFileArgs
Python:
command: "python"
selectionArgs: (code) -> ['-c', code]
byFileArgs: defaultFileArgs
'Shell Script (Bash)':
command: "bash"
selectionArgs: (code) -> ['-c', code]
byFileArgs: defaultFileArgs
| Set up selection vs. file args. | Set up selection vs. file args.
| CoffeeScript | mit | efatsi/atom-script,rodionovd/atom-script,idleberg/atom-script,rgbkrk/atom-script,Calyhre/atom-script,jchannon/atom-script,rodionovd/atom-script,anfedorov/atom-script,efatsi/atom-script,efatsi/atom-script,anfedorov/atom-script,rodionovd/atom-script,jchannon/atom-script,rodionovd/atom-script,anfedorov/atom-script,jchannon/atom-script,rodionovd/atom-script,Calyhre/atom-script,efatsi/atom-script,anfedorov/atom-script,Calyhre/atom-script,jchannon/atom-script,jchannon/atom-script,Calyhre/atom-script,jchannon/atom-script,efatsi/atom-script,jchannon/atom-script,chenruixuan/atom-script,MichaelSp/atom-script,rodionovd/atom-script,Calyhre/atom-script,efatsi/atom-script,Calyhre/atom-script,anfedorov/atom-script,rodionovd/atom-script,jchannon/atom-script,efatsi/atom-script,efatsi/atom-script,rodionovd/atom-script,anfedorov/atom-script,jchannon/atom-script,rodionovd/atom-script,anfedorov/atom-script,rodionovd/atom-script,rodionovd/atom-script,efatsi/atom-script,efatsi/atom-script,jchannon/atom-script,jchannon/atom-script,anfedorov/atom-script,Calyhre/atom-script,Calyhre/atom-script,Calyhre/atom-script,anfedorov/atom-script,anfedorov/atom-script,Calyhre/atom-script,rodionovd/atom-script,Calyhre/atom-script,efatsi/atom-script,efatsi/atom-script,Calyhre/atom-script,fscherwi/atom-script,anfedorov/atom-script,TomosBlack/atom-script,efatsi/atom-script,anfedorov/atom-script,rodionovd/atom-script,anfedorov/atom-script |
757e22c5be5aa4be39f9ebb75e61258ec04f47ba | src/templates.coffee | src/templates.coffee | fs = require 'fs'
jade = require 'jade'
path = require './utils/path-from-home'
jsonFile = require './utils/json-file'
error = require './utils/error'
module.exports =
save: ->
jsonFile.write TEMPLATES_FILE, TEMPLATES
getCompiled: (name) ->
compile resolvePaths findTemplate name
show: (name) ->
template = resolvePaths findTemplate name
printFile template.jade, 'Jade Template'
printFile template.data, 'Data'
TEMPLATES_FILE = path.pathFromHome 'templates.json'
TEMPLATES = jsonFile.read TEMPLATES_FILE
resolvePaths = (template) ->
jade: path.pathResolvingHome template.jade
data: path.pathResolvingHome template.data
compile = (template) ->
compileHtml = jade.compileFile template.jade
compileHtml jsonFile.read template.data
findTemplate = (name) ->
template = TEMPLATES[name]
error "No saved template '#{name}'" unless template?
template
printFile = (filePath, label) ->
labelBorder = Array(label.length + 1).join '-'
console.log [labelBorder, label, labelBorder].join '\n'
console.log fs.readFileSync filePath, 'utf-8'
| fs = require 'fs'
jade = require 'jade'
path = require './utils/path-from-home'
jsonFile = require './utils/json-file'
error = require './utils/error'
module.exports =
save: ->
jsonFile.write TEMPLATES_FILE, TEMPLATES
getCompiled: (name) ->
compile resolvePaths findTemplate name
show: (name) ->
template = resolvePaths findTemplate name
printFile template.jade, 'Jade Template'
printFile template.data, 'Data'
TEMPLATES_FILE = path.pathFromHome 'templates.json'
TEMPLATES = jsonFile.read TEMPLATES_FILE
resolvePaths = (template) ->
jade: path.pathResolvingHome template.jade
data: path.pathResolvingHome template.data
compile = (template) ->
compileHtml = jade.compileFile template.jade
compileHtml jsonFile.read template.data
findTemplate = (name) ->
template = TEMPLATES[name]
error "No saved template '#{name}'" unless template?
template
printFile = (filePath, label) ->
labelBorder = Array(label.length + 1).join '-'
console.log [labelBorder, label + ':', filePath, labelBorder].join '\n'
console.log fs.readFileSync filePath, 'utf-8'
| Print paths to template files for template show action | Print paths to template files for template show action
| CoffeeScript | mit | dp28/layer,dp28/layer |
3b19b4359ed679442a6009553efd9abaad169c65 | spec/apm-cli-spec.coffee | spec/apm-cli-spec.coffee | fs = require 'fs'
apm = require '../lib/apm-cli'
describe 'apm command line interface', ->
describe 'when no arguments are present', ->
it 'prints a usage message', ->
spyOn(console, 'log').andCallThrough()
spyOn(console, 'error')
apm.run([])
expect(console.log).not.toHaveBeenCalled()
expect(console.error).toHaveBeenCalled()
expect(console.error.argsForCall[0][0].length).toBeGreaterThan 0
describe 'when the version flag is specified', ->
it 'prints a usage message', ->
spyOn(console, 'log').andCallThrough()
spyOn(console, 'error')
apm.run(['-h'])
expect(console.log).not.toHaveBeenCalled()
expect(console.error).toHaveBeenCalled()
expect(console.error.argsForCall[0][0].length).toBeGreaterThan 0
describe 'when the version flag is specified', ->
it 'prints the version', ->
spyOn(console, 'log')
spyOn(console, 'error')
apm.run(['-v'])
expect(console.error).not.toHaveBeenCalled()
expect(console.log).toHaveBeenCalled()
expect(console.log.argsForCall[0][0]).toBe JSON.parse(fs.readFileSync('package.json')).version
| fs = require 'fs'
apm = require '../lib/apm-cli'
describe 'apm command line interface', ->
describe 'when no arguments are present', ->
it 'prints a usage message', ->
spyOn(console, 'log').andCallThrough()
spyOn(console, 'error')
apm.run([])
expect(console.log).not.toHaveBeenCalled()
expect(console.error).toHaveBeenCalled()
expect(console.error.argsForCall[0][0].length).toBeGreaterThan 0
describe 'when the version flag is specified', ->
it 'prints a usage message', ->
spyOn(console, 'log').andCallThrough()
spyOn(console, 'error')
apm.run(['-h'])
expect(console.log).not.toHaveBeenCalled()
expect(console.error).toHaveBeenCalled()
expect(console.error.argsForCall[0][0].length).toBeGreaterThan 0
describe 'when the version flag is specified', ->
it 'prints the version', ->
spyOn(console, 'log')
spyOn(console, 'error')
apm.run(['-v'])
expect(console.error).not.toHaveBeenCalled()
expect(console.log).toHaveBeenCalled()
expect(console.log.argsForCall[0][0]).toBe JSON.parse(fs.readFileSync('package.json')).version
describe 'when an unrecognized command is specified', ->
it 'prints an error message', ->
spyOn(console, 'log').andCallThrough()
spyOn(console, 'error')
apm.run(['this-will-never-be-a-command'])
expect(console.log).not.toHaveBeenCalled()
expect(console.error).toHaveBeenCalled()
expect(console.error.argsForCall[0][0].length).toBeGreaterThan 0
| Add spec for unrecognized command | Add spec for unrecognized command
| CoffeeScript | mit | VandeurenGlenn/apm,bronson/apm,AtaraxiaEta/apm,bronson/apm,VandeurenGlenn/apm,atom/apm,ethanp/apm,jlord/apm,bcoe/apm,Nikpolik/apm,fscherwi/apm,VandeurenGlenn/apm,jlord/apm,bcoe/apm,AtaraxiaEta/apm,bcoe/apm,pusateri/apm,fscherwi/apm,atom/apm,VandeurenGlenn/apm,fscherwi/apm,ethanp/apm,gutsy/apm,gutsy/apm,AtaraxiaEta/apm,bcoe/apm,fscherwi/apm,AtaraxiaEta/apm,bcoe/apm,jlord/apm,AtaraxiaEta/apm,jlord/apm,bronson/apm,atom/apm,ethanp/apm,fscherwi/apm,Nikpolik/apm,AtaraxiaEta/apm,pusateri/apm,pusateri/apm,pusateri/apm,ethanp/apm,jlord/apm,VandeurenGlenn/apm,ethanp/apm,pusateri/apm,jlord/apm,atom/apm,Nikpolik/apm,bronson/apm,VandeurenGlenn/apm,Nikpolik/apm,pusateri/apm,ethanp/apm,gutsy/apm,bcoe/apm,gutsy/apm,fscherwi/apm |
63f9aed1f4b6ade6197e68e335945a82606a93d5 | src/coffee/engine.coffee | src/coffee/engine.coffee | angular.module 'qbn.engine', ['qbn.quality', 'qbn.storylet', 'qbn.choice', 'qbn.resolve']
.controller 'QbnEngine',
($scope, qualities, storylets, frontalChoices, choiceFactory, resolveFilter) ->
$scope.qualities = qualities.getAll()
updateFrontalChoices = () ->
$scope.choices = frontalChoices.getAll()
return
updateFrontalChoices()
retreat = choiceFactory '!!retreat!!',
'On second thought, maybe not…'
'Return to the previous screen.'
{}, {}, undefined
onwards = choiceFactory '!!onwards!!',
'The story continues…'
'', {}, {}, undefined
$scope.choose = (choice) ->
next = resolveFilter choice.next
storylet = storylets.lookup next
if storylet?
unless $scope.storylet?
storylet.choices = storylet.choices.concat retreat
unless storylet.choices?
storylet.choices = [onwards]
else
updateFrontalChoices()
$scope.storylet = storylet
return
return
| angular.module 'qbn.engine', ['qbn.quality', 'qbn.storylet', 'qbn.choice', 'qbn.resolve']
.controller 'QbnEngine',
($scope, qualities, storylets, frontalChoices, choiceFactory, resolveFilter) ->
$scope.qualities = qualities.getAll()
updateFrontalChoices = () ->
$scope.choices = frontalChoices.getAll()
return
updateFrontalChoices()
retreat = choiceFactory '!!retreat!!',
'On second thought, maybe not…'
'Return to the previous screen.'
{}, {}, undefined
onwards = choiceFactory '!!onwards!!',
'The story continues…'
'', {}, {}, undefined
$scope.choose = (choice) ->
next = resolveFilter choice.next
storylet = storylets.lookup next
if storylet?
unless $scope.storylet?
storylet.choices = storylet.choices.concat retreat
unless storylet.choices.length > 0
storylet.choices = [onwards]
else
updateFrontalChoices()
$scope.storylet = storylet
return
return
| Fix Bug in Onwards Concatenation | Fix Bug in Onwards Concatenation
| CoffeeScript | unlicense | arashikou/exper3-2015 |
9ca742d481be7284b3da13b929bed82fe5cee1bb | angular/core/services/record_loader.coffee | angular/core/services/record_loader.coffee | angular.module('loomioApp').factory 'RecordLoader', (Records) ->
class RecordLoader
constructor: (opts = {}) ->
@loadingFirst = true
@collection = opts.collection
@params = opts.params or {from: 0, per: 25, order: 'id'}
@path = opts.path
@numLoaded = opts.numLoaded or 0
@then = opts.then or (data) -> data
reset: ->
@params['from'] = 0
@numLoaded = 0
fetchRecords: ->
@loading = true
Records[_.camelCase(@collection)].fetch
path: @path
params: @params
.then (data) =>
if data[@collection].length > 0
@numLoaded += data[@collection].length
else
@exhausted = true
data
.then(@then)
.finally =>
@loadingFirst = false
@loading = false
loadMore: (from) ->
if from?
@params['from'] = from
else
@params['from'] += @params['per'] if @numLoaded > 0
@loadingMore = true
@fetchRecords().finally => @loadingMore = false
loadPrevious: (from) ->
if from?
@params['from'] = from
else
@params['from'] -= @params['per'] if @numLoaded > 0
@loadingPrevious = true
@fetchRecords().finally => @loadingPrevious = false
| angular.module('loomioApp').factory 'RecordLoader', (Records) ->
class RecordLoader
constructor: (opts = {}) ->
@loadingFirst = true
@collection = opts.collection
@params = _.merge({from: 0, per: 25, order: 'id'}, opts.params)
@path = opts.path
@numLoaded = opts.numLoaded or 0
@then = opts.then or (data) -> data
reset: ->
@params['from'] = 0
@numLoaded = 0
fetchRecords: ->
@loading = true
Records[_.camelCase(@collection)].fetch
path: @path
params: @params
.then (data) =>
if data[@collection].length > 0
@numLoaded += data[@collection].length
else
@exhausted = true
data
.then(@then)
.finally =>
@loadingFirst = false
@loading = false
loadMore: (from) ->
if from?
@params['from'] = from
else
@params['from'] += @params['per'] if @numLoaded > 0
@loadingMore = true
@fetchRecords().finally => @loadingMore = false
loadPrevious: (from) ->
if from?
@params['from'] = from
else
@params['from'] -= @params['per'] if @numLoaded > 0
@loadingPrevious = true
@fetchRecords().finally => @loadingPrevious = false
| Fix load more on polls | Fix load more on polls
| CoffeeScript | agpl-3.0 | loomio/loomio,loomio/loomio,loomio/loomio,piratas-ar/loomio,piratas-ar/loomio,piratas-ar/loomio,piratas-ar/loomio,loomio/loomio |
1c9dc9b361c9e4c5099ac16e7a6ce0d30bee01af | app/assets/javascripts/organization.coffee | app/assets/javascripts/organization.coffee | window.addAddressRow = ->
count = $("[id^='organization_addresses_attributes']:text").length
newRow = $ """
<div class="form-group">
<label for="organization_addresses_attributes_#{count}_address">Mailing Address</label>
<input class="form-control" data-guard="different" type="text" value="" name="organization[addresses_attributes][#{count}][address]" id="organization_addresses_attributes_#{count}_address">
</div>
<input type="hidden" value="" name="organization[addresses_attributes][#{count}][id]" id="organization_addresses_attributes_#{count}_id">
"""
$("#organization_info").append newRow
$(document).on "click", "#add-new-address", (event) ->
event.preventDefault()
addAddressRow(count)
| window.addAddressRow = ->
count = $("[id^='organization_addresses_attributes']:text").length
newRow = $ """
<div class="form-group">
<label for="organization_addresses_attributes_#{count}_address">Mailing Address</label>
<input class="form-control" data-guard="different" type="text" value="" name="organization[addresses_attributes][#{count}][address]" id="organization_addresses_attributes_#{count}_address">
</div>
"""
$("#organization_info").append newRow
$(document).on "click", "#add-new-address", (event) ->
event.preventDefault()
addAddressRow()
| Remove hidden field and unneeded argument count | Remove hidden field and unneeded argument count
| CoffeeScript | mit | on-site/StockAid,on-site/StockAid,on-site/StockAid |
bb606f3d86753ef6395e777a12c11b16c132012d | Gruntfile.coffee | Gruntfile.coffee | module.exports = (grunt) ->
grunt.initConfig
pkg: '<json:package.json>'
coffee:
client:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'static/js/'
ext: '.js'
server:
expand: true
cwd: 'server-src'
src: ['*.coffee']
dest: 'server-js/'
ext: '.js'
less:
development:
options:
paths: ['styles']
files:
'static/css/servicemap.css': 'styles/servicemap.less'
'static/css/bootstrap.css': 'styles/bootstrap/bootstrap.less'
watch:
files: [
'Gruntfile.coffee'
'src/*.coffee'
'server-src/*.coffee'
]
tasks: 'default'
express:
options:
port: 9001
spawn: true
dev:
options:
script: 'server-js/dev.js'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-express-server'
grunt.registerTask 'default', ['coffee', 'less']
grunt.registerTask 'server', ['coffee', 'less', 'express', 'watch']
| module.exports = (grunt) ->
grunt.initConfig
pkg: '<json:package.json>'
coffee:
client:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'static/js/'
ext: '.js'
server:
expand: true
cwd: 'server-src'
src: ['*.coffee']
dest: 'server-js/'
ext: '.js'
less:
development:
options:
paths: ['styles']
files:
'static/css/servicemap.css': 'styles/servicemap.less'
'static/css/bootstrap.css': 'styles/bootstrap/bootstrap.less'
watch:
files: [
'Gruntfile.coffee'
'src/*.coffee'
'server-src/*.coffee'
'styles/*.less'
]
tasks: 'default'
express:
options:
port: 9001
spawn: true
dev:
options:
script: 'server-js/dev.js'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-express-server'
grunt.registerTask 'default', ['coffee', 'less']
grunt.registerTask 'server', ['coffee', 'less', 'express', 'watch']
| Make grunt watch .less files | Make grunt watch .less files
| CoffeeScript | agpl-3.0 | City-of-Helsinki/servicemap,Zeukkari/servicemap,vaaralav/servicemap,City-of-Helsinki/servicemap,vaaralav/servicemap,vaaralav/servicemap,Zeukkari/servicemap,City-of-Helsinki/servicemap |
9de71a1277f34aa753290d50ce4d7bba95942b67 | src/scripts/oblique.coffee | src/scripts/oblique.coffee | # Description:
# Display an oblique strategy
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot strategy - Returns an oblique strategy
#
# Author:
# hakanensari
module.exports = (robot) ->
robot.respond /\W*(?:an? )?(?:oblique )?strategy\??$/i, (msg) ->
msg.http('http://oblique.io')
.get() (err, res, body) ->
msg.send JSON.parse body
| # Description:
# Suggests an oblique strategy
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot strategy - Suggests a strategy
# hubot a strategy for <user> - Suggests a strategy to user
#
# Notes:
# You can be as verbose as you want as long as you address Hubot and mention
# the word strategy and, optionally, one or more users.
#
# Thanks, Brian Eno.
#
# Author:
# hakanensari
module.exports = (robot) ->
robot.respond /.*strategy/i, (msg) ->
mentions = msg.message.text.match(/(@\w+)/g)
robot.http('http://oblique.io')
.get() (err, res, body) ->
strategy = JSON.parse body
strategy = "#{mentions.join(', ')}: #{strategy}" if mentions
msg.send strategy
| Allow Hubot to suggest strategies to others, in multiple ways | Allow Hubot to suggest strategies to others, in multiple ways
| CoffeeScript | mit | davidsulpy/hubot-scripts,ambikads/hubot-scripts,modulexcite/hubot-scripts,jankowiakmaria/hubot-scripts,contolini/hubot-scripts,jan0sch/hubot-scripts,ryantomlinson/hubot-scripts,Ev1l/hubot-scripts,GrimDerp/hubot-scripts,chauffer/hubot-scripts,yigitbey/hubot-scripts,ericjsilva/hubot-scripts,zecahnin/hubot-scripts,dbkaplun/hubot-scripts,MaxMEllon/hubot-scripts,arcaartem/hubot-scripts,justinwoo/hubot-scripts,opentable/hubot-scripts,azimman/hubot-scripts,terryjbates/hubot-scripts,markstory/hubot-scripts,iilab/hubot-scripts,sklise/hubot-scripts,github/hubot-scripts,phillipalexander/hubot-scripts,cycomachead/hubot-scripts,magicstone1412/hubot-scripts,fromonesrc/hubot-scripts,dhfromkorea/hubot-scripts,jhubert/hubot-scripts,1000hz/hubot-scripts,alexhouse/hubot-scripts,jacobtomlinson/hubot-scripts,wsoula/hubot-scripts,n0mer/hubot-scripts,marksie531/hubot-scripts |
805326361bc8f2e6cc53c33a03b3eb7bb7de8fd3 | src/snippets-reader.coffee | src/snippets-reader.coffee | eval("window = {};")
eval("console = {};")
console.warn = ->
self.postMessage
type: 'warn'
details: arguments
console.log = ->
self.postMessage
type: 'warn'
details: arguments
eval("attachEvent = function(){};")
self.addEventListener 'message', (event) ->
switch event.data.type
when 'start'
window.resourcePath = event.data.resourcePath
importScripts(event.data.requirePath)
self.postMessage(type:'started')
else
self[event.data.type](event.data)
self.loadTextmateSnippets = ({path}) ->
fs = require 'fs'
snippetsDirPath = fs.join(path, 'Snippets')
snippets = fs.list(snippetsDirPath).map (snippetPath) ->
fs.readPlist(snippetPath)
self.postMessage
type: 'loadSnippets'
snippets: snippets
self.loadAtomSnippets = ({path}) ->
fs = require 'fs'
snippetsDirPath = fs.join(path, 'snippets')
snippets = []
for snippetsPath in fs.list(snippetsDirPath)
continue if fs.base(snippetsPath).indexOf('.') is 0
try
snippets.push(fs.readObject(snippetsPath))
catch e
console.warn "Error reading snippets file '#{snippetsPath}'"
self.postMessage
type: 'loadSnippets'
snippets: snippets
| module.exports =
loadTextmateSnippets: ({path}) ->
fs = require 'fs'
snippetsDirPath = fs.join(path, 'Snippets')
snippets = fs.list(snippetsDirPath).map (snippetPath) ->
fs.readPlist(snippetPath)
self.postMessage
type: 'loadSnippets'
snippets: snippets
loadAtomSnippets: ({path}) ->
fs = require 'fs'
snippetsDirPath = fs.join(path, 'snippets')
snippets = []
for snippetsPath in fs.list(snippetsDirPath)
continue if fs.base(snippetsPath).indexOf('.') is 0
try
snippets.push(fs.readObject(snippetsPath))
catch e
console.warn "Error reading snippets file '#{snippetsPath}'"
self.postMessage
type: 'loadSnippets'
snippets: snippets
| Create task shell that bootstraps worker | Create task shell that bootstraps worker
| CoffeeScript | mit | lpommers/snippets,bengy/snippets,atom/snippets,syndbg/snippets,terrycloth/atom-snippets |
528b81dfd1bcbca8891026c55113524d6b76e02f | src/flux/ecosystems.coffee | src/flux/ecosystems.coffee | _ = require 'underscore'
flux = require 'flux-react'
LOADING = 'loading'
FAILED = 'failed'
EcosystemsActions = flux.createActions [
'load'
'loaded'
'FAILED'
]
EcosystemsStore = flux.createStore
actions: _.values(EcosystemsActions)
_asyncStatus: null
load: -> # Used by API
@_asyncStatus = LOADING
@emit('load')
loaded: (ecosystems) ->
@_ecosystems = ecosystems
@emit('loaded')
FAILED: ->
@_asyncStatus = FAILED
@emit('failed')
exports:
isLoaded: -> not _.isEmpty(@_ecosystems)
isLoading: -> @_asyncStatus is LOADING
isFailed: -> @_asyncStatus is FAILED
allBooks: ->
_.map @_ecosystems, (ecosystem) ->
_.extend( _.first(ecosystem.books), {ecosystemId: "#{ecosystem.id}"} )
first: ->
_.first @_ecosystems
getBook: (ecosystemId) ->
_.first( _.findWhere(@_ecosystems, id: parseInt(ecosystemId, 10)).books )
module.exports = {EcosystemsActions, EcosystemsStore}
| _ = require 'underscore'
flux = require 'flux-react'
LOADING = 'loading'
FAILED = 'failed'
EcosystemsActions = flux.createActions [
'load'
'loaded'
'FAILED'
]
EcosystemsStore = flux.createStore
actions: _.values(EcosystemsActions)
_asyncStatus: null
load: -> # Used by API
@_asyncStatus = LOADING
@emit('load')
loaded: (ecosystems) ->
@_ecosystems = ecosystems
@emit('loaded')
FAILED: ->
@_asyncStatus = FAILED
@emit('failed')
exports:
isLoaded: -> not _.isEmpty(@_ecosystems)
isLoading: -> @_asyncStatus is LOADING
isFailed: -> @_asyncStatus is FAILED
allBooks: ->
_.map @_ecosystems, (ecosystem) ->
_.extend( _.first(ecosystem.books), {ecosystemId: "#{ecosystem.id}", ecosystemComments: ecosystem.comments} )
first: ->
_.first @_ecosystems
getBook: (ecosystemId) ->
_.first( _.findWhere(@_ecosystems, id: parseInt(ecosystemId, 10)).books )
module.exports = {EcosystemsActions, EcosystemsStore}
| Add ecosystem comments to book object | Add ecosystem comments to book object
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
22e4c07d9208f0bc8402e620dc62aef618611fe7 | shared/accountButtons.coffee | shared/accountButtons.coffee | Handlebars.registerHelper(
"accountButtons", ->
return new Handlebars.SafeString(Template.entryAccountButtons())
)
Template.entryAccountButtons.helpers
profileUrl: ->
return false unless AccountsEntry.settings.profileRoute
Router.path(AccountsEntry.settings.profileRoute)
wrapLinks: ->
AccountsEntry.settings.wrapLinks
| Handlebars.registerHelper
"accountButtons", ->
return new Handlebars.SafeString(Template.entryAccountButtons())
Template.entryAccountButtons.helpers
profileUrl: ->
return false unless AccountsEntry.settings.profileRoute
AccountsEntry.settings.profileRoute
wrapLinks: ->
AccountsEntry.settings.wrapLinks
| Fix bug - routes are now paths not route names | Fix bug - routes are now paths not route names
| CoffeeScript | mit | mauriciovieira/accounts-entry,timmyg/accounts-entry,valedaemon/accounts-entry,Noamyoungerm/accounts-entry,txs/meteor-wecare-accounts-entry-flow-blaze,valedaemon/accounts-entry,jpatzer/accounts-entry,Vilango/accounts-entry,txs/meteor-wecare-accounts-entry-flow-blaze-global,jpatzer/accounts-entry,ChipCastleDotCom/accounts-entry,jg3526/accounts-entry,mike623/accounts-entry,qing-hai/accounts-entry,Differential/accounts-entry,dovrosenberg/accounts-entry,RiffynInc/meteor-accounts-entry,jg3526/accounts-entry,maxkferg/accounts-entry,Noamyoungerm/accounts-entry,andykingking/accounts-entry,txs/meteor-wecare-accounts-entry-flow-blaze-global,selaias/accounts-entry,AppWorkshop/accounts-entry,AppWorkshop/accounts-entry,vhmh2005/accounts-entry,Vilango/accounts-entry,benmgreene/accounts-entry,benmgreene/accounts-entry,meteorblackbelt/accounts-entry,lnader/meteor-accounts-entry,maxkferg/accounts-entry,RiffynInc/meteor-accounts-entry,selaias/accounts-entry,lnader/meteor-accounts-entry,vhmh2005/accounts-entry,andykingking/accounts-entry,txs/meteor-wecare-accounts-entry-flow-blaze,Differential/accounts-entry,mike623/accounts-entry,ChipCastleDotCom/accounts-entry,meteorblackbelt/accounts-entry,dovrosenberg/accounts-entry,mauriciovieira/accounts-entry |
010bae8cf2823204a59a7af6914f65e3ed892538 | lib/git-write.coffee | lib/git-write.coffee | {BufferedProcess} = require 'atom'
StatusView = require './status-view'
# if all param true, then 'git add .'
gitWrite = (all=false)->
dir = atom.project.getRepo().getWorkingDirectory()
currentFile = atom.workspace.getActiveEditor().getPath()
toStage = if all then '.' else currentFile
new BufferedProcess({
command: 'git'
args: ['add', toStage]
options:
cwd: dir
stderr: (data) ->
new StatusView(type: 'alert', message: data.toString())
exit: (data) ->
new StatusView(type: 'success', message: "Added #{toStage}")
})
module.exports = gitWrite
| {BufferedProcess} = require 'atom'
StatusView = require './status-view'
# if all param true, then 'git add .'
gitWrite = (all=false)->
dir = atom.project.getRepo().getWorkingDirectory()
currentFile = atom.workspace.getActiveEditor().getPath()
toStage = if all then '.' else currentFile
new BufferedProcess({
command: 'git'
args: ['add', toStage]
options:
cwd: dir
stderr: (data) ->
new StatusView(type: 'alert', message: data.toString())
exit: (data) ->
file = if toStage is '.' then 'all files' else toStage
new StatusView(type: 'success', message: "Added #{file}")
})
module.exports = gitWrite
| Change GitWrite success message to show 'all files' or filepath | Change GitWrite success message to show 'all files' or filepath
| CoffeeScript | mit | akonwi/git-plus,akonwi/git-plus |
486c8323841d47a0c8dfd6d690ff5e65d5aedcd8 | src/scripts/views/app.cjsx | src/scripts/views/app.cjsx | React = require 'react'
Router = require 'react-router'
DocumentTitle = require 'react-document-title'
RouteHandler = Router.RouteHandler
Link = Router.Link
module.exports = React.createClass
render: ->
title = 'Third Hand Information'
<DocumentTitle title={ title }>
<div className="wrapper">
<header role="banner"><img className="logo" src="/dist/svg/logo.svg" alt=""/> { title }</header>
<ul>
<li><Link to="app">Home</Link></li>
</ul>
<RouteHandler title={ title } {... @props }/>
</div>
</DocumentTitle>
| React = require 'react'
Router = require 'react-router'
DocumentTitle = require 'react-document-title'
RouteHandler = Router.RouteHandler
Link = Router.Link
module.exports = React.createClass
displayName: 'App'
render: ->
title = 'Third Hand Information'
<DocumentTitle title={ title }>
<div className="wrapper">
<header role="banner"><img className="logo" src="/dist/svg/logo.svg" alt=""/> { title }</header>
<ul>
<li><Link to="app">Home</Link></li>
</ul>
<RouteHandler title={ title } {... @props }/>
</div>
</DocumentTitle>
| Set displayName on App for prettier debugging. | Set displayName on App for prettier debugging.
| CoffeeScript | mit | thirdhand/3rdhand.info,thirdhand/3rdhand.info |
45f6ee28b89560b79a2a3505b0748eb5f04abebc | coffee/cilantro/models/concept.coffee | coffee/cilantro/models/concept.coffee | define ['../core', './field'], (c, field) ->
class ConceptModel extends Backbone.Model
parse: (resp) ->
@fields = []
# Parse and attach field model instances to concept
for attrs in resp.fields
@fields.push(new field.FieldModel attrs, parse: true)
return resp
class ConceptCollection extends Backbone.Collection
model: ConceptModel
url: ->
c.getSessionUrl('concepts')
initialize: ->
super
c.subscribe c.SESSION_OPENED, => @fetch()
c.subscribe c.SESSION_CLOSED, => @reset()
@on 'reset', @resolve
search: (query, handler) ->
c.Backbone.ajax
url: c._.result @, 'url'
data: q: query
dataType: 'json'
success: (resp) -> handler(resp)
{ ConceptModel, ConceptCollection }
| define ['../core', './field'], (c, field) ->
class ConceptModel extends c.Backbone.Model
parse: (resp) ->
@fields = []
# Parse and attach field model instances to concept
for attrs in resp.fields
@fields.push(new field.FieldModel attrs, parse: true)
return resp
class ConceptCollection extends c.Backbone.Collection
model: ConceptModel
url: ->
c.getSessionUrl('concepts')
initialize: ->
super
c.subscribe c.SESSION_OPENED, => @fetch()
c.subscribe c.SESSION_CLOSED, => @reset()
@on 'reset', @resolve
search: (query, handler) ->
c.Backbone.ajax
url: c._.result @, 'url'
data: q: query
dataType: 'json'
success: (resp) -> handler(resp)
{ ConceptModel, ConceptCollection }
| Fix missing reference to cilantro namespace | Fix missing reference to cilantro namespace
| CoffeeScript | bsd-2-clause | chop-dbhi/cilantro,chop-dbhi/cilantro,chop-dbhi/cilantro |
a2a658711251e6dddec597cd3196fa679d2ea562 | lib/main.coffee | lib/main.coffee | Whitespace = require './whitespace'
module.exports =
configDefaults:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: true
ignoreWhitespaceOnlyLines: false
ensureSingleTrailingNewline: true
activate: ->
@whitespace = new Whitespace()
deactivate: ->
@whitespace?.destroy()
@whitespace = null
| Whitespace = require './whitespace'
module.exports =
config:
removeTrailingWhitespace:
type: 'boolean'
default: true
scopes:
'.source.jade':
default: false
ignoreWhitespaceOnCurrentLine:
type: 'boolean'
default: true
ignoreWhitespaceOnlyLines:
type: 'boolean'
default: false
ensureSingleTrailingNewline:
type: 'boolean'
default: true
activate: ->
@whitespace = new Whitespace()
deactivate: ->
@whitespace?.destroy()
@whitespace = null
| Convert configDefaults into config schema | Convert configDefaults into config schema
Default jade to removeWhitespace: false | CoffeeScript | mit | atom/whitespace |
265320be4e3430cb612c6ca415172cd4efb7c23d | assets/index.coffee | assets/index.coffee | #= require ./vendor/qunit
QUnit.config.hidepassed = true
QUnit.config.testTimeout = 5000
QUnit.begin (suiteDetails) ->
Blade.suiteDidBegin(suiteDetails)
failedAssertions = []
QUnit.testStart (testDetails) ->
failedAssertions = []
QUnit.log (assertionDetails) ->
unless assertionDetails.result
failedAssertions.push(assertionDetails)
QUnit.testDone (testDetails) ->
name = "#{testDetails.module}: #{testDetails.name}"
pass = testDetails.failed is 0
message = formatAssertions(failedAssertions)
Blade.testDidEnd({name, pass, message})
QUnit.done (suiteDetails) ->
window.global_test_results = suiteDetails
Blade.suiteDidEnd(suiteDetails)
formatAssertions = (assertions = []) ->
if assertions.length
(formatAssertion(assertion) for assertion in assertions).join("\n---\n")
formatAssertion = ({message, actual, expected, source}) ->
lines = []
if message
lines.push("Message: #{JSON.stringify(message)}")
if expected
lines.push("Expected: #{JSON.stringify(expected)}")
if actual
lines.push("Actual: #{JSON.stringify(actual)}")
if source
lines.push("Source:")
for sourceLine in source.split("\n").slice(0,3)
lines.push(" #{sourceLine.trim()}")
lines.join("\n")
| #= require ./vendor/qunit
QUnit.config.hidepassed = true
QUnit.config.testTimeout = 5000
QUnit.begin (suiteDetails) ->
total = suiteDetails.totalTests
Blade.suiteDidBegin({total})
failedAssertions = []
QUnit.testStart (testDetails) ->
failedAssertions = []
QUnit.log (assertionDetails) ->
unless assertionDetails.result
failedAssertions.push(assertionDetails)
QUnit.testDone (testDetails) ->
name = "#{testDetails.module}: #{testDetails.name}"
status = if testDetails.failed is 0 then "pass" else "fail"
message = formatAssertions(failedAssertions)
Blade.testDidEnd({name, status, message})
QUnit.done (suiteDetails) ->
window.global_test_results = suiteDetails
total = suiteDetails.totalTests
Blade.suiteDidEnd({total})
formatAssertions = (assertions = []) ->
if assertions.length
(formatAssertion(assertion) for assertion in assertions).join("\n---\n")
formatAssertion = ({message, actual, expected, source}) ->
lines = []
if message
lines.push("Message: #{JSON.stringify(message)}")
if expected
lines.push("Expected: #{JSON.stringify(expected)}")
if actual
lines.push("Actual: #{JSON.stringify(actual)}")
if source
lines.push("Source:")
for sourceLine in source.split("\n").slice(0,3)
lines.push(" #{sourceLine.trim()}")
lines.join("\n")
| Fix "total", set "status" not "pass" | Fix "total", set "status" not "pass"
| CoffeeScript | mit | javan/blade_runner-qunit_adapter,javan/blade-qunit_adapter,javan/blade-qunit_adapter,javan/blade_runner-qunit_adapter,javan/blade-qunit_adapter,javan/blade_runner-qunit_adapter |
a483232ebf9f993075dc12287b9fe3bc69de1996 | lib/index.coffee | lib/index.coffee |
window.bone = {}
eventSplitter = /^(\S+)\s*(.*)$/
setupEvent = (eventName, rootSelector, selector, action) ->
bone.view = (selector, options) ->
view = {}
events = options.events
for eventSelector, functionName of events
continue if functionName is 'events'
do (eventSelector, functionName) ->
match = eventSelector.match eventSplitter
eventName = match[1]
subSelector = match[2]
fullSelector = selector
fullSelector += " #{subSelector}" if subSelector?
action = options[functionName]
#View: [Selector:Action]
console.log('View: ['+fullSelector+" : "+eventName+"]");
$('body').on eventName, fullSelector, (event) ->
root = $(fullSelector).parents(selector)[0]
action root, event
for name, action of options
continue if name is 'events'
do (name, action) ->
view[name] = (data) ->
for element in $(selector)
do (element) ->
action element, data
return view
bone.io = {}
bone.io.sources = {}
bone.io.get = (source) ->
socket = bone.io.sources[source]
return socket if socket?
socket = io.connect()
bone.io.sources[source] = socket
return socket
bone.io.route = (source, actions) ->
socket = bone.io.get(source)
for name, action of actions
socket.on "#{source}:#{name}", action
bone.io.configure = (source, options) ->
# Configure this somehow...
|
window.bone = {}
eventSplitter = /^(\S+)\s*(.*)$/
setupEvent = (eventName, rootSelector, selector, action) ->
bone.view = (selector, options) ->
view = {}
events = options.events
for eventSelector, functionName of events
continue if functionName is 'events'
do (eventSelector, functionName) ->
match = eventSelector.match eventSplitter
eventName = match[1]
subSelector = match[2]
fullSelector = selector
fullSelector += " #{subSelector}" if subSelector?
action = options[functionName]
#View: [Selector:Action]
console.log('View: ['+fullSelector+" : "+eventName+"]");
$ -> $('body').on eventName, fullSelector, (event) ->
root = $(fullSelector).parents(selector)[0]
action root, event
for name, action of options
continue if name is 'events'
do (name, action) ->
view[name] = (data) ->
for element in $(selector)
do (element) ->
action element, data
return view
bone.io = {}
bone.io.sources = {}
bone.io.get = (source) ->
socket = bone.io.sources[source]
return socket if socket?
socket = io.connect()
bone.io.sources[source] = socket
return socket
bone.io.route = (source, actions) ->
socket = bone.io.get(source)
for name, action of actions
socket.on "#{source}:#{name}", action
bone.io.configure = (source, options) ->
# Configure this somehow...
| Move ready function into view. | Move ready function into view.
| CoffeeScript | mit | techpines/bone.io,robomc/bone.io,robomc/bone.io |
9ae1d39ecfa2c9b28e8bd9b642e56d276a8ea295 | src/JournalStore.coffee | src/JournalStore.coffee | noflo = require 'noflo'
class IDBJournalStore extends noflo.journal.JournalStore
constructor: (graph, @db) ->
super graph
@transactions = []
genKey: (revId) -> "#{@graph.properties.id}_#{revId}"
putTransaction: (revId, entries) ->
@lastRevision = revId if revId > @lastRevision
trans = @db.transaction ['journals'], 'readwrite'
store = trans.objectStore 'journals'
# We're using add for writing, which will correctly fail if revId alreadyn exists
# for the graph
req = store.add
id: @genKey revId
graph: @graph.properties.id
revId: revId
entries: entries
fetchTransaction: (revId) ->
return @transactions[revId]
init: (cb) ->
trans = @db.transaction ['journals']
store = trans.objectStore 'journals'
idx = store.index 'graph'
idx.openCursor().onsuccess = (event) =>
cursor = event.target.result
return cb() unless cursor
@transactions[cursor.value.revId] = cursor.value.entries
@lastRevision = cursor.value.revId if cursor.value.revId > @lastRevision
do cursor.continue
exports.IDBJournalStore = IDBJournalStore
| noflo = require 'noflo'
class IDBJournalStore extends noflo.journal.JournalStore
constructor: (graph, @db) ->
super graph
@transactions = []
genKey: (revId) -> "#{@graph.properties.id}_#{revId}"
putTransaction: (revId, entries) ->
super revId, entries
trans = @db.transaction ['journals'], 'readwrite'
store = trans.objectStore 'journals'
# We're using add for writing, which will correctly fail if revId alreadyn exists
# for the graph
req = store.add
id: @genKey revId
graph: @graph.properties.id
revId: revId
entries: entries
@transactions[revId] = entries
fetchTransaction: (revId) ->
return @transactions[revId]
init: (cb) ->
trans = @db.transaction ['journals']
store = trans.objectStore 'journals'
idx = store.index 'graph'
idx.openCursor().onsuccess = (event) =>
cursor = event.target.result
return cb() unless cursor
@transactions[cursor.value.revId] = cursor.value.entries
@lastRevision = cursor.value.revId if cursor.value.revId > @lastRevision
do cursor.continue
exports.IDBJournalStore = IDBJournalStore
| Call parent to get events going for journal activities | Call parent to get events going for journal activities
| CoffeeScript | mit | lxfschr/noflo-ui,flyboarder/noflo-ui,rasata/noflo-ui,oportocala/noflo-ui,lxfschr/noflo-ui,taylorzane/noflo-ui,noflo/noflo-ui,rdf-pipeline/noflo-server,rasata/noflo-ui,taylorzane/noflo-ui,rdf-pipeline/noflo-server,noflo/noflo-ui,oportocala/noflo-ui |
0e725270cf7f002b3c670ebc7c6800b9e43f7b8d | src/ui/entry/entry.coffee | src/ui/entry/entry.coffee | entryModule = angular.module("entertain.io.app.entry", [])
.controller 'EntryCtrl', ['$scope', '$http'
($scope, $http) ->
$scope.entries = []
socket = io()
$scope.userAmount = 0
$scope.yeah = ->
socket.emit 'yeah', "foobar"
false
socket.on 'userAmount', (msg) ->
$scope.userAmount = msg
$scope.$apply()
return
socket.on 'yeah', (socket) ->
console.log "OMFG"
return
]
module.exports = entryModule.name | entryModule = angular.module("entertain.io.app.entry", [])
.controller 'EntryCtrl', ['$scope', '$http'
($scope, $http) ->
$scope.entries = []
socket = io()
$scope.updateFeed = ->
socket.emit 'updateFeed'
false
socket.on 'feedUpdate', (feeds) ->
$scope.entries.push feeds
$scope.$apply()
return
]
module.exports = entryModule.name | Update Client-Logic (recieve feeds fromt the server) | Update Client-Logic (recieve feeds fromt the server)
| CoffeeScript | mit | sm0k1nggnu/entertain.io |
50b95e5d2a5f093d4f1894cc3853f2f8144036c2 | test/lib/when-test.coffee | test/lib/when-test.coffee | describe 'when', ->
Given -> @when = requireSubject('lib/when')
Given -> @create = requireSubject('lib/create')
describe 'unconditional stubbing', ->
Given -> @testDouble = @create()
context 'foo', ->
Given -> @when(@testDouble()).thenReturn("foo")
Then -> @testDouble() == "foo"
context 'bar', ->
Given -> @when(@testDouble()).thenReturn("bar")
Then -> @testDouble() == "bar"
describe 'conditional stubbing', ->
Given -> @testDouble = @create()
Given -> @when(@testDouble(1)).thenReturn("foo")
Given -> @when(@testDouble(2)).thenReturn("bar")
Then -> @testDouble() == undefined
Then -> @testDouble(1) == "foo"
Then -> @testDouble(2) == "bar"
describe 'multiple test doubles', ->
Given -> @td1 = @when(@create()()).thenReturn("lol1")
Given -> @td2 = @when(@create()()).thenReturn("lol2")
Then -> @td1() == "lol1"
Then -> @td2() == "lol2"
| describe 'when', ->
Given -> @when = requireSubject('lib/when')
Given -> @create = requireSubject('lib/create')
describe 'unconditional stubbing', ->
Given -> @testDouble = @create()
context 'foo', ->
Given -> @when(@testDouble()).thenReturn("foo")
Then -> @testDouble() == "foo"
context 'bar', ->
Given -> @when(@testDouble()).thenReturn("bar")
Then -> @testDouble() == "bar"
describe 'conditional stubbing', ->
Given -> @testDouble = @create()
Given -> @when(@testDouble(1)).thenReturn("foo")
Given -> @when(@testDouble(2)).thenReturn("bar")
Given -> @when(@testDouble(lol: 'cheese')).thenReturn('nom')
Given -> @when(@testDouble(lol: 'fungus')).thenReturn('eww')
Given -> @when(@testDouble({lol: 'fungus'}, 2)).thenReturn('eww2')
Then -> @testDouble() == undefined
And -> @testDouble(1) == "foo"
And -> @testDouble(2) == "bar"
And -> @testDouble(lol: 'cheese') == "nom"
And -> @testDouble(lol: 'fungus') == "eww"
And -> @testDouble({lol: 'fungus'}, 2) == "eww2"
describe 'multiple test doubles', ->
Given -> @td1 = @when(@create()()).thenReturn("lol1")
Given -> @td2 = @when(@create()()).thenReturn("lol2")
Then -> @td1() == "lol1"
Then -> @td2() == "lol2"
| Add some complexities to the conditional stubbing | Add some complexities to the conditional stubbing | CoffeeScript | mit | testdouble/testdouble.js,testdouble/testdouble.js,testdouble/testdouble.js |
4c0b60c0288c76fabc5eb232b7eb20be5ef5fdf3 | client/ide/routes.coffee | client/ide/routes.coffee | do ->
KD.registerRoutes 'IDE',
'/:name?/IDE' : ({params:{name}, query})->
router = KD.getSingleton 'router'
router.openSection 'IDE', name, query
'/:name?/IDE/VM' : ({params:{name}, query})->
KD.singletons.router.handleRoute 'IDE'
'/:name?/IDE/VM/:slug' : ({params:{name, slug}, query})->
{appManager} = KD.singletons
callback = (app) ->
log '@acet handle this VM please', slug
appManager.open 'IDE', callback
| do ->
KD.registerRoutes 'IDE',
'/:name?/IDE' : ({params:{name}, query})->
router = KD.getSingleton 'router'
router.openSection 'IDE', name, query
'/:name?/IDE/VM/:slug' : ({params:{name, slug}, query})->
appManager = KD.getSingleton 'appManager'
ideApps = appManager.appControllers.IDE
fallback = ->
appManager.open 'IDE', { forceNew: yes }, (app) ->
app.mountedMachineUId = slug
return fallback() unless ideApps?.instances
for instance in ideApps.instances when instance.mountedMachineUId is slug
ideInstance = instance
if ideInstance then appManager.showInstance ideInstance else fallback()
| Handle route to mount VM specific filetree. | Finder: Handle route to mount VM specific filetree.
| CoffeeScript | agpl-3.0 | szkl/koding,drewsetski/koding,andrewjcasal/koding,alex-ionochkin/koding,rjeczalik/koding,acbodine/koding,drewsetski/koding,acbodine/koding,andrewjcasal/koding,sinan/koding,kwagdy/koding-1,gokmen/koding,mertaytore/koding,alex-ionochkin/koding,sinan/koding,koding/koding,sinan/koding,andrewjcasal/koding,usirin/koding,szkl/koding,szkl/koding,andrewjcasal/koding,mertaytore/koding,koding/koding,kwagdy/koding-1,jack89129/koding,szkl/koding,alex-ionochkin/koding,kwagdy/koding-1,kwagdy/koding-1,usirin/koding,szkl/koding,koding/koding,drewsetski/koding,cihangir/koding,mertaytore/koding,rjeczalik/koding,acbodine/koding,alex-ionochkin/koding,rjeczalik/koding,sinan/koding,mertaytore/koding,drewsetski/koding,acbodine/koding,usirin/koding,kwagdy/koding-1,kwagdy/koding-1,andrewjcasal/koding,andrewjcasal/koding,cihangir/koding,koding/koding,gokmen/koding,jack89129/koding,szkl/koding,andrewjcasal/koding,jack89129/koding,gokmen/koding,cihangir/koding,rjeczalik/koding,mertaytore/koding,rjeczalik/koding,cihangir/koding,alex-ionochkin/koding,jack89129/koding,cihangir/koding,jack89129/koding,usirin/koding,cihangir/koding,sinan/koding,gokmen/koding,acbodine/koding,usirin/koding,koding/koding,sinan/koding,koding/koding,drewsetski/koding,drewsetski/koding,rjeczalik/koding,kwagdy/koding-1,mertaytore/koding,alex-ionochkin/koding,jack89129/koding,koding/koding,acbodine/koding,szkl/koding,usirin/koding,gokmen/koding,cihangir/koding,drewsetski/koding,drewsetski/koding,gokmen/koding,gokmen/koding,rjeczalik/koding,sinan/koding,rjeczalik/koding,mertaytore/koding,andrewjcasal/koding,gokmen/koding,cihangir/koding,szkl/koding,mertaytore/koding,usirin/koding,acbodine/koding,sinan/koding,alex-ionochkin/koding,kwagdy/koding-1,alex-ionochkin/koding,jack89129/koding,jack89129/koding,usirin/koding,acbodine/koding,koding/koding |
e9e17dcae925fbff6ebe94c9b174b584e7fcb825 | test/src/specs/app/TestHelpers.coffee | test/src/specs/app/TestHelpers.coffee | @expectRequiredParameters = (type, expectedParameterNames) ->
originalType = type
paramList = {}
#check is this is an Abstract type
if(type.isAbstract && type.isAbstract())
type = class A extends type
#add the super classes parameters so that they arent in the tests
if originalType.__super__ && originalType.__super__.constructor
for name in originalType.__super__.constructor.expectedParameters
paramList[name] = name
doTest = (name, params) ->
it "should fail without parameter '#{name}'", ->
try
new type params
expect("Should have failed").toEqual("because parameter is required")
catch e
if e.getRootError
message = e.getRootError().message
else
message = e.message
expect(message).toEqual("The constructor expects the parameter '#{name}' to be passed in as a config parameter")
describe "New Object", ->
for name in expectedParameterNames
#build each test case for expected parameters
params = _.clone(paramList) if _.toArray(paramList).length > 0
doTest(name, params)
paramList[name] = name
| @expectRequiredParameters = (type, expectedParameterNames) ->
originalType = type
paramList = {}
baseExpectedParams = []
#check is this is an Abstract type
if(type.isAbstract && type.isAbstract())
type = class A extends type
#add the super classes parameters so that they arent in the tests
if originalType.__super__ && originalType.__super__.constructor && originalType.__super__.constructor.expectedParameters
baseExpectedParams = originalType.__super__.constructor.expectedParameters
for name in originalType.__super__.constructor.expectedParameters
paramList[name] = name
doTest = (name, params) ->
it "should fail without parameter '#{name}'", ->
try
new type params
expect("Should have failed").toEqual("because parameter is required")
catch e
if e.getRootError
message = e.getRootError().message
else
message = e.message
expect(message).toEqual("The constructor expects the parameter '#{name}' to be passed in as a config parameter")
describe "New Object", ->
#if this has expectedParameters then make sure we are testing for all expected params
if(originalType.expectedParameters)
it "should be testing for all expected parameters", ->
diff = _.difference(originalType.expectedParameters, baseExpectedParams)
expect(expectedParameterNames).toEqual(diff)
for name in expectedParameterNames
#build each test case for expected parameters
params = _.clone(paramList) if _.toArray(paramList).length > 0
doTest(name, params)
paramList[name] = name
| Add default test when checking Expected parameters to ensure that tests are being aware of 'required' option params | Add default test when checking Expected parameters to ensure that tests are being aware of 'required' option params
| CoffeeScript | mit | jono-tt/App-Engine |
4f023ee9a06e4d22be88f25cc55b1e70bd9cbfaf | src/msgflo.coffee | src/msgflo.coffee |
runtime = require '../src/runtime'
## Main
program = require 'commander'
main = () ->
program
.option('--host <hostname>', 'Host', String, 'localhost')
.option('--port <port>', 'Port', Number, 3569)
.option('--broker <uri>', 'Broker address', String, 'amqp://localhost')
.option('--ide <uri>', 'FBP IDE address', String, 'http://app.flowhub.io')
.option('--graph <file.json>', 'Initial graph to load', String, '')
.parse(process.argv)
r = new runtime.Runtime program
r.start (err, address, liveUrl) ->
throw err if err
console.log "msgflo started on #{address}"
console.log 'Open in Flowhub: ' + liveUrl
exports.main = main
exports.transport = require('msgflo-nodejs').transport
exports.participant = require('msgflo-nodejs').participant
exports.foreignParticipant = require '../src/foreign-participant'
exports.coordinator = require '../src/coordinator'
exports.runtime = require '../src/runtime'
exports.common = require '../src/common'
exports.setup = require '../src/setup'
exports.manager = require '../src/manager'
exports.library = require '../src/library'
exports.procfile = require '../src/procfile'
|
runtime = require '../src/runtime'
## Main
program = require 'commander'
main = () ->
program
.option('--host <hostname>', 'Host', String, 'localhost')
.option('--port <port>', 'Port', Number, 3569)
.option('--broker <uri>', 'Broker address', String, 'amqp://localhost')
.option('--ide <uri>', 'FBP IDE address', String, 'http://app.flowhub.io')
.option('--graph <file.json>', 'Initial graph to load', String, '')
.parse(process.argv)
r = new runtime.Runtime program
r.start (err, address, liveUrl) ->
throw err if err
console.log "msgflo started on #{address}"
console.log 'Open in Flowhub: ' + liveUrl
exports.main = main
exports.transport = require('msgflo-nodejs').transport
exports.participant = require('msgflo-nodejs').participant
exports.foreignParticipant = require '../src/foreign-participant'
exports.coordinator = require '../src/coordinator'
exports.runtime = require '../src/runtime'
exports.common = require '../src/common'
exports.setup = require '../src/setup'
exports.manager = require '../src/manager'
exports.library = require '../src/library'
exports.procfile = require '../src/procfile'
exports.utils
spy: require '../src/utils/spy'
| Make available as public interface | utils/spy: Make available as public interface
| CoffeeScript | mit | msgflo/msgflo,msgflo/msgflo,msgflo/msgflo |
7527b69f849f5b30de9898cab26da115155f84fb | client/lanes/testing/BeforeEach.coffee | client/lanes/testing/BeforeEach.coffee | SYNC_RESPONSE = {}
Lanes.Test.syncSucceedWith = (data) ->
SYNC_RESPONSE.success = true
SYNC_RESPONSE.total = data.length if _.isArray(data)
SYNC_RESPONSE.data = _.cloneDeep(data)
Lanes.Test.syncRespondWith = (obj) ->
_.extend(SYNC_RESPONSE, obj)
afterEach ->
Lanes.current_user._events = @__user_events
beforeEach ->
@__user_events = Lanes.current_user._events
Lanes.Models.ServerCache.MODELS = {}
Lanes.Models.ServerCache.COLLECTIONS = {}
window.LT = Lanes.Test
SYNC_RESPONSE = {
success: true
message: ''
data: []
}
originalFn = Lanes.Models.Sync.perform
spyOn(Lanes.Models.Sync, 'perform').and.callFake( (method, options) ->
_.Promise.resolve(SYNC_RESPONSE)
)
Lanes.Models.Sync.perform.lastOptions = ->
this.calls.mostRecent()?.args[1]
Lanes.Models.Sync.restorePerform = (fn) ->
spy = Lanes.Models.Sync.perform
Lanes.Models.Sync.perform = originalFn
try
fn()
finally
Lanes.Models.Sync.perform = spy
| SYNC_RESPONSE = {}
Lanes.Test.syncSucceedWith = (data) ->
SYNC_RESPONSE.success = true
SYNC_RESPONSE.total = data.length if _.isArray(data)
SYNC_RESPONSE.data = _.cloneDeep(data)
Lanes.Test.syncRespondWith = (obj) ->
_.extend(SYNC_RESPONSE, obj)
afterEach ->
Lanes.current_user._events = @__user_events
Lanes.Models.PubSub.types.reset()
Lanes.Models.PubSub.mb = @prevMB
beforeEach ->
@__user_events = Lanes.current_user._events
Lanes.Models.ServerCache.MODELS = {}
Lanes.Models.ServerCache.COLLECTIONS = {}
window.LT = Lanes.Test
SYNC_RESPONSE = {
success: true
message: ''
data: []
}
@prevMB = Lanes.Models.PubSub.mb
Lanes.Models.PubSub.mb = jasmine.createSpyObj('MessageBus', [
'subscribe', 'unsubscribe'
])
originalFn = Lanes.Models.Sync.perform
spyOn(Lanes.Models.Sync, 'perform').and.callFake( (method, options) ->
_.Promise.resolve(SYNC_RESPONSE)
)
Lanes.Models.Sync.perform.lastOptions = ->
this.calls.mostRecent()?.args[1]
Lanes.Models.Sync.restorePerform = (fn) ->
spy = Lanes.Models.Sync.perform
Lanes.Models.Sync.perform = originalFn
try
fn()
finally
Lanes.Models.Sync.perform = spy
| Reset PubSub after each spec | Reset PubSub after each spec
| CoffeeScript | mit | argosity/lanes,argosity/lanes,argosity/lanes,argosity/hippo,argosity/hippo,argosity/hippo |
e7a1408e9dc56d51a00b1f0ff83899057ba377c2 | js/application.coffee | js/application.coffee | class App
Routers: {}
Models: {}
Collections: {}
Views: {}
init: ->
window.flight = new Flight()
new @Routers.AppRouter
Backbone.history.start()
@Collections.Activities.fetch()
window.app = new App
`
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};
String.prototype.truncate = function(n,useWordBoundary) {
var toLong = this.length>n,
s_ = toLong ? this.substr(0,n-1) : this;
s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
return toLong ? s_ +'...' : s_;
};
String.prototype.escapeHTML = function () {
return(this.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"'));
};
String.prototype.ellipse = function(len) {
return (this.length > len) ? this.substr(0, len) + "..." : this;
}
`
| class App
Routers: {}
Models: {}
Collections: {}
Views: {}
init: ->
window.flight = new Flight()
new @Routers.AppRouter
Backbone.history.start()
@Collections.Activities.fetch()
$('#menu-button').click ->
flight.slideOutMenu()
window.app = new App
`
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};
String.prototype.truncate = function(n,useWordBoundary) {
var toLong = this.length>n,
s_ = toLong ? this.substr(0,n-1) : this;
s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
return toLong ? s_ +'...' : s_;
};
String.prototype.escapeHTML = function () {
return(this.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"'));
};
String.prototype.ellipse = function(len) {
return (this.length > len) ? this.substr(0, len) + "..." : this;
}
`
| Call menu on menu button click, this should be a class. | Call menu on menu button click, this should be a class.
| CoffeeScript | mit | zestia/glide |
975a9778479d330194cf60b38fcf3e767d7daed8 | js/routers/AppRouter.coffee | js/routers/AppRouter.coffee | class AppRouter extends Backbone.Router
routes:
'': 'homePage'
'panel/:id': 'goToPanel'
homePage: ->
collection = new app.Collections.ActivityCollection
@view = new app.Views.Home collection: collection
collection.fetch()
flight.goTo "#panel-1"
goToPanel: (id) ->
@view = new app.Views["Panel_" + id]
page = @view.render(id).el
flight.goTo page
@app = window.app ? {}
@app.Routers.AppRouter = AppRouter
| class AppRouter extends Backbone.Router
routes:
'': 'homePage'
'panel/:id': 'goToPanel'
homePage: ->
collection = new app.Collections.ActivityCollection
@view = new app.Views.Home collection: collection
collection.fetch()
@view.render()
flight.goTo "#panel-1"
goToPanel: (id) ->
@view = new app.Views["Panel_" + id]
@view.render(id).el
flight.goTo "#panel-" + id
@app = window.app ? {}
@app.Routers.AppRouter = AppRouter
| Use id's to transition page instead of rendered page element. | Use id's to transition page instead of rendered page element.
| CoffeeScript | mit | zestia/glide |
0504e8476dbd7dc1cd8a059e40d6e7d1c354e7d7 | menus/markdown-preview.cson | menus/markdown-preview.cson | 'menu': [
'label': 'Packages'
'submenu': [
'label': 'Markdown'
'submenu': [
'label': 'Toggle Preview'
'command': 'markdown-preview:toggle'
]
]
]
| 'menu': [
'label': 'Packages'
'submenu': [
'label': 'Markdown'
'submenu': [
'label': 'Toggle Preview'
'command': 'markdown-preview:toggle'
]
]
]
'context-menu':
'.markdown-preview':
'Save As HTML\u2026': 'core:save-as'
| Add save as HTML menu | Add save as HTML menu
| CoffeeScript | mit | tkssharma/markdown-preview,ArnaudRinquin/markdown-preview,rugk/markdown-preview,makyo/markdown-preview,Galadirith/markdown-preview,grimmer0125/markdown-preview-kramdown,sctlee/markdown-preview,atom/markdown-preview |
03eb6eb066965801bc0c04a93db514d3af96c347 | views/components/ship-parts/slotitems-data.coffee | views/components/ship-parts/slotitems-data.coffee | __ = window.i18n.data.__.bind(i18n.data)
__n = window.i18n.data.__n.bind(i18n.data)
types =
"api_taik": "HP"
"api_souk": "Armor"
"api_houg": "Firepower"
"api_raig": "Torpedo"
"api_soku": "Speed"
"api_baku": "Bombing"
"api_tyku": "AA"
"api_tais": "ASW"
"api_houm": "Accuracy"
"api_raim": "Torpedo Accuracy"
"api_houk": "Evasion"
"api_raik": "Torpedo Evasion"
"api_bakk": "Bombing Evasion"
"api_saku": "LOS"
"api_sakb": "Anti-LOS"
"api_luck": "Luck"
"api_leng": "Range"
module.exports =
getItemData: (slotitem) ->
data = []
for type of types
if slotitem[type] > 0
data.push "#{__ types[type]}: #{slotitem[type]}"
return data
| if window.i18n?.data?
__ = window.i18n.data.__.bind(i18n.data)
else
path = require 'path-extra'
i18n = new (require 'i18n-2')
locales: ['en-US', 'ja-JP', 'zh-CN', 'zh-TW']
defaultLocale: 'zh-CN'
directory: path.join ROOT, 'i18n', 'data'
updateFiles: false
indent: "\t"
extension: '.json'
devMode: false
i18n.setLocale(window.language)
__ = i18n.__.bind(i18n)
types =
"api_taik": "HP"
"api_souk": "Armor"
"api_houg": "Firepower"
"api_raig": "Torpedo"
"api_soku": "Speed"
"api_baku": "Bombing"
"api_tyku": "AA"
"api_tais": "ASW"
"api_houm": "Accuracy"
"api_raim": "Torpedo Accuracy"
"api_houk": "Evasion"
"api_raik": "Torpedo Evasion"
"api_bakk": "Bombing Evasion"
"api_saku": "LOS"
"api_sakb": "Anti-LOS"
"api_luck": "Luck"
"api_leng": "Range"
module.exports =
getItemData: (slotitem) ->
data = []
for type of types
if slotitem[type] > 0
data.push "#{__ types[type]}: #{slotitem[type]}"
return data
| Add i18n when env.coffee isn't required | Add i18n when env.coffee isn't required
| CoffeeScript | mit | syncsyncsynchalt/poi,dushi792/poi,nagatoyk/poi,PHELiOX/poi,yudachi/poi,PHELiOX/poi,poooi/poi,syncsyncsynchalt/poi,yudachi/poi,syncsyncsynchalt/poi,yudachi/poi,poooi/poi,KagamiChan/poi,poooi/poi,gnattu/poi,syncsyncsynchalt/poi,nagatoyk/poi,dushi792/poi,dushi792/poi,gnattu/poi,poooi/poi,KagamiChan/poi |
11f0eeeb8d2c556fc2dd880572da391cbcd921fc | lib/barista_test.coffee | lib/barista_test.coffee | sys = require "sys"
fs = require "fs"
assert_module = require "assert"
coffee = require "coffee-script"
helpers = require("coffee-script/helpers").helpers
# Parse our command-line arguments.
test_file_paths = process.argv[1...process.argv.length]
# Set up a basic test environment. This code is based on the code at
# http://github.com/jashkenas/coffee-script/blob/master/Cakefile ,
# which implements the standard Coffee
passed = failed = 0
helpers.extend global, assert_module
global.ok = (args...) ->
res = assert_module.ok(args...)
passed += 1
res
# Called when the tests are done.
testsDone = ->
tag = if failed > 0 then "ERR" else "OK"
sys.puts "#{tag}: #{passed} passed, #{failed} failed"
if failed > 0
process.exit(1)
# Pretend to run our test files. Again, this is based on the standard
# Cakefile.
files_left = test_file_paths.length
for path in test_file_paths
fs.readFile path, (err, data) ->
files_left -= 1
try
coffee.run data.toString(), fileName: path
catch err
failed += 1
sys.puts err.stack.toString()
if files_left is 0
testsDone()
| sys = require "sys"
fs = require "fs"
assert_module = require "assert"
coffee = require "coffee-script"
helpers = require("coffee-script/helpers").helpers
# Parse our command-line arguments.
test_file_paths = process.argv[1...process.argv.length]
# ANSI color codes. Borrowed from
# http://github.com/jashkenas/coffee-script/blob/master/Cakefile , which
# implements a test runner for internal use by CoffeeScript.
red = '\033[0;31m'
green = '\033[0;32m'
reset = '\033[0m'
# Set up a basic test environment. Based on the standard Cakefile.
passed = failed = 0
helpers.extend global, assert_module
global.ok = (args...) ->
res = assert_module.ok(args...)
passed += 1
res
# Called when the tests are done.
testsDone = ->
tag = if failed > 0 then "#{red}ERR" else "#{green}OK"
sys.puts "\n#{tag}:#{reset} #{passed} passed, #{failed} failed"
if failed > 0
process.exit(1)
# Pretend to run our test files. Again, this is based on the standard
# Cakefile.
files_left = test_file_paths.length
for path in test_file_paths
fs.readFile path, (err, data) ->
files_left -= 1
try
coffee.run data.toString(), fileName: path
sys.print "."
catch err
failed += 1
sys.puts "\n#{err.stack.toString()}"
if files_left is 0
testsDone()
| Make cosmetic improvements to the output | Make cosmetic improvements to the output
| CoffeeScript | mit | aranetic/barista_test |
e6cef21097f0e1233ec5a513aec84574536658be | src/relative-resolve.coffee | src/relative-resolve.coffee | fs = require 'fs'
path = require 'path'
{sync: resolve} = require 'resolve'
CORE_MODULES = require './core-modules'
isCore = require './is-core'
canonicalise = require './canonicalise'
resolvePath = ({extensions, aliases, root, cwd, path: givenPath}, pkgMainField = 'browser') ->
packageFilter = (pkg) ->
if pkg[pkgMainField]
pkg.main = pkg[pkgMainField]
return pkg
aliases ?= {}
if isCore givenPath
return if {}.hasOwnProperty.call aliases, givenPath
corePath = CORE_MODULES[givenPath]
unless fs.existsSync corePath
throw new Error "Core module \"#{givenPath}\" has not yet been ported to the browser"
givenPath = corePath
# try regular CommonJS requires
try
resolve givenPath, {extensions, basedir: cwd or root, packageFilter}
catch e
# support non-standard root-relative requires
try
resolve (path.join root, givenPath), {extensions, packageFilter}
catch e
throw new Error "Cannot find module \"#{givenPath}\" in \"#{root}\""
module.exports = ({extensions, aliases, root, cwd, path: givenPath}) ->
aliases ?= {}
resolved = resolvePath {extensions, aliases, root, cwd, path: givenPath}
canonicalName = if isCore givenPath then givenPath else canonicalise root, resolved
if {}.hasOwnProperty.call aliases, canonicalName
resolved = aliases[canonicalName] and resolvePath {extensions, aliases, root, path: aliases[canonicalName]}
{filename: resolved, canonicalName}
| fs = require 'fs'
path = require 'path'
{sync: resolve} = require 'resolve'
CORE_MODULES = require './core-modules'
isCore = require './is-core'
canonicalise = require './canonicalise'
resolvePath = ({extensions, aliases, root, cwd, path: givenPath}, pkgMainField = 'browser') ->
packageFilter = (pkg) ->
if pkg[pkgMainField]
pkg.main = pkg[pkgMainField]
return pkg
aliases ?= {}
if isCore givenPath
return if {}.hasOwnProperty.call aliases, givenPath
corePath = CORE_MODULES[givenPath]
unless fs.existsSync corePath
throw new Error "Core module \"#{givenPath}\" has not yet been ported to the browser"
givenPath = corePath
# try regular CommonJS requires
try
resolve givenPath, {extensions, basedir: cwd or root, packageFilter}
catch e
# support non-standard root-relative requires
try
resolve (path.join root, givenPath), {extensions, packageFilter}
catch e
throw new Error "Cannot find module \"#{givenPath}\" in \"#{root}\""
module.exports = ({extensions, aliases, root, cwd, path: givenPath}) ->
aliases ?= {}
resolved = resolvePath {extensions, aliases, root, cwd, path: givenPath}
canonicalName = canonicalise root, resolved
if {}.hasOwnProperty.call aliases, canonicalName
resolved = aliases[canonicalName] and resolvePath {extensions, aliases, root, path: aliases[canonicalName]}
{filename: resolved, canonicalName}
| Fix canonicalization of core modules | Fix canonicalization of core modules
| CoffeeScript | bsd-3-clause | tarruda/powerbuild |
8db4f82dc4e14571716fb6bccbe57a27a60474d6 | src/config-schema.coffee | src/config-schema.coffee | path = require 'path'
fs = require 'fs-plus'
# This is loaded by atom.coffee. See https://atom.io/docs/api/latest/Config for
# more information about config schemas.
module.exports =
core:
type: 'object'
properties:
showUnreadBadge:
type: 'boolean'
default: true
showImportant:
type: 'boolean'
default: true
disabledPackages:
type: 'array'
default: []
items:
type: 'string'
themes:
type: 'array'
default: ['ui-light']
items:
type: 'string'
keymapTemplate:
type: 'string'
default: 'Gmail'
attachments:
type: 'object'
properties:
downloadPolicy:
type: 'string'
default: 'on-read'
enum: ['on-receive', 'on-read', 'manually']
reading:
type: 'object'
properties:
markAsReadDelay:
type: 'integer'
default: 500
sending:
type: 'object'
properties:
sounds:
type: 'boolean'
default: true
defaultReplyType:
type: 'string'
default: 'reply-all'
enum: ['reply', 'reply-all']
if process.platform in ['win32', 'linux']
module.exports.core.properties.autoHideMenuBar =
type: 'boolean'
default: false
description: 'Automatically hide the menu bar and toggle it by pressing Alt. This is only supported on Windows & Linux.'
| path = require 'path'
fs = require 'fs-plus'
# This is loaded by atom.coffee. See https://atom.io/docs/api/latest/Config for
# more information about config schemas.
module.exports =
core:
type: 'object'
properties:
workspace:
type: 'object'
properties:
mode:
type: 'string'
default: 'list'
enum: ['split', 'list']
showUnreadBadge:
type: 'boolean'
default: true
showImportant:
type: 'boolean'
default: true
disabledPackages:
type: 'array'
default: []
items:
type: 'string'
themes:
type: 'array'
default: ['ui-light']
items:
type: 'string'
keymapTemplate:
type: 'string'
default: 'Gmail'
attachments:
type: 'object'
properties:
downloadPolicy:
type: 'string'
default: 'on-read'
enum: ['on-receive', 'on-read', 'manually']
reading:
type: 'object'
properties:
markAsReadDelay:
type: 'integer'
default: 500
sending:
type: 'object'
properties:
sounds:
type: 'boolean'
default: true
defaultReplyType:
type: 'string'
default: 'reply-all'
enum: ['reply', 'reply-all']
if process.platform in ['win32', 'linux']
module.exports.core.properties.autoHideMenuBar =
type: 'boolean'
default: false
description: 'Automatically hide the menu bar and toggle it by pressing Alt. This is only supported on Windows & Linux.'
| Add to config schema so it defaults to list properly | fix(workspace-mode): Add to config schema so it defaults to list properly
| CoffeeScript | mit | simonft/nylas-mail,nylas/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,nirmit/nylas-mail,nylas-mail-lives/nylas-mail,simonft/nylas-mail,simonft/nylas-mail,nylas-mail-lives/nylas-mail,nylas/nylas-mail,nylas/nylas-mail,nirmit/nylas-mail,nirmit/nylas-mail,simonft/nylas-mail,nylas-mail-lives/nylas-mail,nirmit/nylas-mail,nylas-mail-lives/nylas-mail,nylas/nylas-mail,simonft/nylas-mail,nirmit/nylas-mail |
66a5c3a5c9d47a1aadf2f68d3adfb7dde327aa50 | lib/markdown-preview.coffee | lib/markdown-preview.coffee | url = require 'url'
fs = require 'fs-plus'
MarkdownPreviewView = require './markdown-preview-view'
module.exports =
configDefaults:
grammars: [
'source.gfm'
'text.plain'
'text.plain.null-grammar'
]
activate: ->
atom.workspaceView.command 'markdown-preview:show', =>
@show()
atom.workspace.registerOpener (uriToOpen) ->
{protocol, host, pathname} = url.parse(uriToOpen)
pathname = decodeURI(pathname) if pathname
return unless protocol is 'markdown-preview:'
if host is 'editor'
new MarkdownPreviewView(editorId: pathname.substring(1))
else
new MarkdownPreviewView(filePath: pathname)
show: ->
editor = atom.workspace.getActiveEditor()
return unless editor?
grammars = atom.config.get('markdown-preview.grammars') ? []
return unless editor.getGrammar().scopeName in grammars
previousActivePane = atom.workspace.getActivePane()
uri = "markdown-preview://editor/#{editor.id}"
atom.workspace.open(uri, split: 'right', searchAllPanes: true).done (markdownPreviewView) ->
if markdownPreviewView instanceof MarkdownPreviewView
markdownPreviewView.renderMarkdown()
previousActivePane.activate()
| url = require 'url'
fs = require 'fs-plus'
MarkdownPreviewView = require './markdown-preview-view'
module.exports =
configDefaults:
grammars: [
'source.gfm'
'source.litcoffee'
'text.plain'
'text.plain.null-grammar'
]
activate: ->
atom.workspaceView.command 'markdown-preview:show', =>
@show()
atom.workspace.registerOpener (uriToOpen) ->
{protocol, host, pathname} = url.parse(uriToOpen)
pathname = decodeURI(pathname) if pathname
return unless protocol is 'markdown-preview:'
if host is 'editor'
new MarkdownPreviewView(editorId: pathname.substring(1))
else
new MarkdownPreviewView(filePath: pathname)
show: ->
editor = atom.workspace.getActiveEditor()
return unless editor?
grammars = atom.config.get('markdown-preview.grammars') ? []
return unless editor.getGrammar().scopeName in grammars
previousActivePane = atom.workspace.getActivePane()
uri = "markdown-preview://editor/#{editor.id}"
atom.workspace.open(uri, split: 'right', searchAllPanes: true).done (markdownPreviewView) ->
if markdownPreviewView instanceof MarkdownPreviewView
markdownPreviewView.renderMarkdown()
previousActivePane.activate()
| Add source.litcoffee to default grammars | Add source.litcoffee to default grammars
Closes #38
| CoffeeScript | mit | Galadirith/markdown-preview,sctlee/markdown-preview,atom/markdown-preview,tkssharma/markdown-preview,ArnaudRinquin/markdown-preview,rugk/markdown-preview,makyo/markdown-preview,danielgtaylor/atom-api-blueprint-preview,grimmer0125/markdown-preview-kramdown |
c3224c4dede2c8f8aa8ea87edf53d1773dfd7c14 | test/presenters_spec.coffee | test/presenters_spec.coffee | Presenters = require "../lib/presenters"
helpers = require "./helpers"
describe "Presenters", ->
before ->
@prediction1 = new helpers.PredictionStub stopName: "Michigan & 29th Street"
@prediction2 = new helpers.PredictionStub {stopName: "Michigan & 28th Street", minutesFromNow: 1}
@allPredictions = [@prediction1, @prediction2]
describe "WebPresenter", ->
beforeEach ->
@presenter = new Presenters.WebPresenter({}, @allPredictions)
describe "formatPredictions", ->
it "returns an object with values for the given prediction data", ->
@presenter.formatPrediction(@prediction2).should.eql
stopName: '28th Street'
estimate: 1
percentComplete: 90
describe "buildTitle", ->
it "returns an object with route data", ->
@presenter.buildTitle().should.eql
routeNumber: '1'
routeDirection: 'North Bound'
busNumber: '1234'
# describe "generateBody", ->
# describe "respond", ->
describe "SMSPresenter", ->
beforeEach ->
@presenter = new Presenters.SMSPresenter({}, @allPredictions)
describe "formatPredictions", ->
it "returns a string for the given prediction", ->
@presenter.formatPrediction(@prediction2).should.equal "In 1m: 28th Street"
describe "buildTitle", ->
it "returns a string with route data", ->
@presenter.buildTitle().should.equal "Rt 1:"
# describe "generateBody", ->
# describe "respond", ->
| Presenters = require "../lib/presenters"
helpers = require "./helpers"
describe "Presenters", ->
before ->
@prediction1 = new helpers.PredictionStub stopName: "Michigan & 29th Street"
@prediction2 = new helpers.PredictionStub {stopName: "Michigan & 28th Street", minutesFromNow: 1}
@allPredictions = [@prediction1, @prediction2]
describe "WebPresenter", ->
beforeEach ->
@presenter = new Presenters.WebPresenter({}, @allPredictions)
describe "formatPredictions", ->
it "returns an object with values for the given prediction data", ->
@presenter.formatPrediction(@prediction2).should.eql
stopName: '28th Street'
estimate: 1
percentComplete: 90
describe "buildGeneralContext", ->
it "returns an object with route data", ->
@presenter.buildGeneralContext().should.eql
routeNumber: '1'
routeDirection: 'North Bound'
busNumber: '1234'
# describe "generateBody", ->
# describe "respond", ->
describe "SMSPresenter", ->
beforeEach ->
@presenter = new Presenters.SMSPresenter({}, @allPredictions)
describe "formatPredictions", ->
it "returns a string for the given prediction", ->
@presenter.formatPrediction(@prediction2).should.equal "In 1m: 28th Street"
describe "buildTitle", ->
it "returns a string with route data", ->
@presenter.buildTitle().should.equal "Rt 1:"
# describe "generateBody", ->
# describe "respond", ->
| Fix method name in presenter spec | Fix method name in presenter spec
| CoffeeScript | mit | banterability/busted |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.