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
19cf333e52fa93e24bf57ecf3aefe07d425d9819
src/packages/fuzzy-finder/lib/load-paths-task.coffee
src/packages/fuzzy-finder/lib/load-paths-task.coffee
_ = require 'underscore' BufferedProcess = require 'buffered-process' $ = require 'jquery' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['-l', rootPath] args.unshift('--addVCSIgnores') if config.get('nak.addVCSIgnores') args.unshift('-d', ignoredNames.join(',')) if ignoredNames.length > 0 args.unshift('--follow') paths = [] deferred = $.Deferred() exit = (code) => if code is -1 deferred.reject({command, code}) else @callback(paths) deferred.resolve() stdout = (data) -> paths.push(_.compact(data.split('\n'))...) @process = new BufferedProcess({command, args, stdout, exit}) deferred abort: -> if @process? @process.kill() @process = null
_ = require 'underscore' BufferedProcess = require 'buffered-process' $ = require 'jquery' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['--list', rootPath] args.unshift('--addVCSIgnores') if config.get('nak.addVCSIgnores') args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0 args.unshift('--follow') paths = [] deferred = $.Deferred() exit = (code) => if code is -1 deferred.reject({command, code}) else @callback(paths) deferred.resolve() stdout = (data) -> paths.push(_.compact(data.split('\n'))...) @process = new BufferedProcess({command, args, stdout, exit}) deferred abort: -> if @process? @process.kill() @process = null
Use long opts for readability
Use long opts for readability
CoffeeScript
mit
decaffeinate-examples/atom,amine7536/atom,florianb/atom,avdg/atom,fredericksilva/atom,PKRoma/atom,paulcbetts/atom,russlescai/atom,florianb/atom,bencolon/atom,Jdesk/atom,charleswhchan/atom,NunoEdgarGub1/atom,rmartin/atom,targeter21/atom,decaffeinate-examples/atom,ali/atom,nrodriguez13/atom,kjav/atom,ironbox360/atom,FoldingText/atom,KENJU/atom,kc8wxm/atom,fredericksilva/atom,boomwaiza/atom,constanzaurzua/atom,oggy/atom,folpindo/atom,boomwaiza/atom,Klozz/atom,gisenberg/atom,FIT-CSE2410-A-Bombs/atom,githubteacher/atom,devoncarew/atom,bj7/atom,Jandersolutions/atom,ReddTea/atom,Andrey-Pavlov/atom,constanzaurzua/atom,fedorov/atom,kjav/atom,jeremyramin/atom,n-riesco/atom,jjz/atom,gontadu/atom,champagnez/atom,rmartin/atom,nrodriguez13/atom,Neron-X5/atom,Ingramz/atom,RobinTec/atom,harshdattani/atom,scv119/atom,mostafaeweda/atom,fscherwi/atom,originye/atom,brettle/atom,jacekkopecky/atom,tmunro/atom,mertkahyaoglu/atom,transcranial/atom,deepfox/atom,hellendag/atom,001szymon/atom,RobinTec/atom,SlimeQ/atom,tjkr/atom,wiggzz/atom,jjz/atom,g2p/atom,prembasumatary/atom,splodingsocks/atom,hpham04/atom,helber/atom,Jonekee/atom,h0dgep0dge/atom,erikhakansson/atom,batjko/atom,nvoron23/atom,jeremyramin/atom,erikhakansson/atom,anuwat121/atom,abe33/atom,n-riesco/atom,nvoron23/atom,efatsi/atom,amine7536/atom,sekcheong/atom,Jandersoft/atom,liuderchi/atom,ReddTea/atom,ralphtheninja/atom,kc8wxm/atom,transcranial/atom,erikhakansson/atom,targeter21/atom,charleswhchan/atom,efatsi/atom,darwin/atom,liuxiong332/atom,Sangaroonaom/atom,omarhuanca/atom,Hasimir/atom,jlord/atom,synaptek/atom,hagb4rd/atom,davideg/atom,mertkahyaoglu/atom,ashneo76/atom,gisenberg/atom,Neron-X5/atom,ilovezy/atom,constanzaurzua/atom,SlimeQ/atom,omarhuanca/atom,bolinfest/atom,johnhaley81/atom,harshdattani/atom,deepfox/atom,ardeshirj/atom,mostafaeweda/atom,dannyflax/atom,ralphtheninja/atom,splodingsocks/atom,jlord/atom,me6iaton/atom,hpham04/atom,russlescai/atom,batjko/atom,Ju2ender/atom,pombredanne/atom,basarat/atom,lovesnow/atom,YunchengLiao/atom,ykeisuke/atom,john-kelly/atom,fedorov/atom,davideg/atom,g2p/atom,ppamorim/atom,ilovezy/atom,0x73/atom,jeremyramin/atom,cyzn/atom,Shekharrajak/atom,crazyquark/atom,Galactix/atom,pkdevbox/atom,Rodjana/atom,mertkahyaoglu/atom,AlbertoBarrago/atom,devmario/atom,Klozz/atom,SlimeQ/atom,Austen-G/BlockBuilder,Dennis1978/atom,RuiDGoncalves/atom,Mokolea/atom,davideg/atom,einarmagnus/atom,amine7536/atom,pkdevbox/atom,oggy/atom,yamhon/atom,acontreras89/atom,kittens/atom,mostafaeweda/atom,kdheepak89/atom,SlimeQ/atom,h0dgep0dge/atom,vjeux/atom,chfritz/atom,codex8/atom,gzzhanghao/atom,kandros/atom,liuxiong332/atom,tisu2tisu/atom,decaffeinate-examples/atom,johnrizzo1/atom,yomybaby/atom,qiujuer/atom,niklabh/atom,AlbertoBarrago/atom,jlord/atom,Jandersolutions/atom,charleswhchan/atom,prembasumatary/atom,RobinTec/atom,CraZySacX/atom,Rodjana/atom,scippio/atom,nucked/atom,Andrey-Pavlov/atom,BogusCurry/atom,RuiDGoncalves/atom,kaicataldo/atom,nrodriguez13/atom,yalexx/atom,jacekkopecky/atom,jtrose2/atom,fscherwi/atom,lovesnow/atom,isghe/atom,mostafaeweda/atom,synaptek/atom,woss/atom,vjeux/atom,ppamorim/atom,Arcanemagus/atom,ObviouslyGreen/atom,einarmagnus/atom,vjeux/atom,YunchengLiao/atom,targeter21/atom,kittens/atom,githubteacher/atom,synaptek/atom,abcP9110/atom,kc8wxm/atom,fredericksilva/atom,vinodpanicker/atom,AlbertoBarrago/atom,Hasimir/atom,n-riesco/atom,vhutheesing/atom,beni55/atom,batjko/atom,fang-yufeng/atom,ardeshirj/atom,jacekkopecky/atom,Austen-G/BlockBuilder,FIT-CSE2410-A-Bombs/atom,john-kelly/atom,dkfiresky/atom,qiujuer/atom,elkingtonmcb/atom,woss/atom,scv119/atom,dkfiresky/atom,qskycolor/atom,Arcanemagus/atom,Rodjana/atom,Ju2ender/atom,h0dgep0dge/atom,Shekharrajak/atom,woss/atom,bcoe/atom,kc8wxm/atom,Abdillah/atom,dannyflax/atom,kdheepak89/atom,sillvan/atom,vhutheesing/atom,scippio/atom,fang-yufeng/atom,me-benni/atom,chengky/atom,GHackAnonymous/atom,john-kelly/atom,bradgearon/atom,mrodalgaard/atom,rlugojr/atom,ashneo76/atom,nvoron23/atom,vinodpanicker/atom,panuchart/atom,Arcanemagus/atom,ppamorim/atom,prembasumatary/atom,palita01/atom,Galactix/atom,ironbox360/atom,ivoadf/atom,hharchani/atom,rjattrill/atom,dijs/atom,tisu2tisu/atom,ilovezy/atom,mertkahyaoglu/atom,alexandergmann/atom,DiogoXRP/atom,andrewleverette/atom,crazyquark/atom,rxkit/atom,qiujuer/atom,yangchenghu/atom,sebmck/atom,dannyflax/atom,pombredanne/atom,liuderchi/atom,jlord/atom,darwin/atom,Locke23rus/atom,atom/atom,rjattrill/atom,hagb4rd/atom,matthewclendening/atom,svanharmelen/atom,svanharmelen/atom,ezeoleaf/atom,devmario/atom,pengshp/atom,Sangaroonaom/atom,stinsonga/atom,panuchart/atom,Rychard/atom,bolinfest/atom,lisonma/atom,kittens/atom,MjAbuz/atom,fedorov/atom,lpommers/atom,sillvan/atom,liuxiong332/atom,tmunro/atom,medovob/atom,FIT-CSE2410-A-Bombs/atom,russlescai/atom,dsandstrom/atom,beni55/atom,ezeoleaf/atom,jjz/atom,harshdattani/atom,CraZySacX/atom,crazyquark/atom,sotayamashita/atom,jacekkopecky/atom,bcoe/atom,KENJU/atom,Ingramz/atom,niklabh/atom,AdrianVovk/substance-ide,devmario/atom,alexandergmann/atom,AlexxNica/atom,davideg/atom,yamhon/atom,dijs/atom,ashneo76/atom,Shekharrajak/atom,PKRoma/atom,AlexxNica/atom,bencolon/atom,ReddTea/atom,stuartquin/atom,xream/atom,rsvip/aTom,qiujuer/atom,Jandersoft/atom,Jdesk/atom,charleswhchan/atom,fang-yufeng/atom,yalexx/atom,g2p/atom,chengky/atom,mnquintana/atom,gabrielPeart/atom,ObviouslyGreen/atom,FoldingText/atom,florianb/atom,brettle/atom,Jandersolutions/atom,pkdevbox/atom,fscherwi/atom,n-riesco/atom,ilovezy/atom,dsandstrom/atom,execjosh/atom,Austen-G/BlockBuilder,hellendag/atom,abcP9110/atom,hharchani/atom,abcP9110/atom,0x73/atom,nucked/atom,dkfiresky/atom,pengshp/atom,G-Baby/atom,pombredanne/atom,bsmr-x-script/atom,jtrose2/atom,Abdillah/atom,Galactix/atom,darwin/atom,jtrose2/atom,atom/atom,Huaraz2/atom,stuartquin/atom,qskycolor/atom,GHackAnonymous/atom,rjattrill/atom,Ju2ender/atom,cyzn/atom,Jandersoft/atom,tjkr/atom,tmunro/atom,synaptek/atom,stinsonga/atom,execjosh/atom,sebmck/atom,qskycolor/atom,matthewclendening/atom,t9md/atom,rjattrill/atom,yalexx/atom,elkingtonmcb/atom,basarat/atom,stuartquin/atom,sebmck/atom,amine7536/atom,pengshp/atom,Locke23rus/atom,russlescai/atom,Austen-G/BlockBuilder,medovob/atom,sebmck/atom,RobinTec/atom,hakatashi/atom,Galactix/atom,niklabh/atom,qiujuer/atom,me6iaton/atom,Locke23rus/atom,crazyquark/atom,vcarrera/atom,bcoe/atom,medovob/atom,hharchani/atom,jordanbtucker/atom,jacekkopecky/atom,sillvan/atom,Jandersolutions/atom,yangchenghu/atom,transcranial/atom,alexandergmann/atom,NunoEdgarGub1/atom,oggy/atom,pombredanne/atom,isghe/atom,ykeisuke/atom,t9md/atom,helber/atom,mrodalgaard/atom,Jonekee/atom,chengky/atom,deepfox/atom,rsvip/aTom,Ju2ender/atom,codex8/atom,liuxiong332/atom,basarat/atom,sotayamashita/atom,einarmagnus/atom,john-kelly/atom,matthewclendening/atom,abcP9110/atom,oggy/atom,chfritz/atom,cyzn/atom,Ju2ender/atom,dkfiresky/atom,vcarrera/atom,sxgao3001/atom,ykeisuke/atom,liuxiong332/atom,NunoEdgarGub1/atom,jjz/atom,jacekkopecky/atom,bj7/atom,andrewleverette/atom,gisenberg/atom,vjeux/atom,Austen-G/BlockBuilder,rsvip/aTom,jtrose2/atom,toqz/atom,brumm/atom,Jandersoft/atom,DiogoXRP/atom,kevinrenaers/atom,Ingramz/atom,githubteacher/atom,Huaraz2/atom,palita01/atom,folpindo/atom,ReddTea/atom,kdheepak89/atom,tanin47/atom,Abdillah/atom,AlisaKiatkongkumthon/atom,scv119/atom,tony612/atom,deoxilix/atom,hellendag/atom,kandros/atom,kaicataldo/atom,mdumrauf/atom,daxlab/atom,ironbox360/atom,yomybaby/atom,originye/atom,hagb4rd/atom,sillvan/atom,FoldingText/atom,Jandersoft/atom,lisonma/atom,andrewleverette/atom,anuwat121/atom,yamhon/atom,execjosh/atom,deepfox/atom,Austen-G/BlockBuilder,tanin47/atom,Hasimir/atom,AlisaKiatkongkumthon/atom,gontadu/atom,daxlab/atom,rlugojr/atom,hharchani/atom,me-benni/atom,bsmr-x-script/atom,scv119/atom,vcarrera/atom,rmartin/atom,Jandersolutions/atom,stinsonga/atom,helber/atom,yomybaby/atom,gisenberg/atom,rsvip/aTom,jordanbtucker/atom,ali/atom,charleswhchan/atom,targeter21/atom,qskycolor/atom,fredericksilva/atom,Hasimir/atom,burodepeper/atom,jtrose2/atom,GHackAnonymous/atom,originye/atom,sekcheong/atom,russlescai/atom,woss/atom,wiggzz/atom,lisonma/atom,rookie125/atom,rmartin/atom,einarmagnus/atom,fang-yufeng/atom,kdheepak89/atom,acontreras89/atom,isghe/atom,folpindo/atom,sxgao3001/atom,hharchani/atom,johnhaley81/atom,FoldingText/atom,beni55/atom,rlugojr/atom,batjko/atom,ppamorim/atom,dsandstrom/atom,toqz/atom,Hasimir/atom,seedtigo/atom,boomwaiza/atom,johnrizzo1/atom,vcarrera/atom,deoxilix/atom,RobinTec/atom,NunoEdgarGub1/atom,devoncarew/atom,oggy/atom,devoncarew/atom,rsvip/aTom,mostafaeweda/atom,ivoadf/atom,Mokolea/atom,gontadu/atom,kittens/atom,yalexx/atom,Klozz/atom,acontreras89/atom,nucked/atom,wiggzz/atom,bradgearon/atom,mnquintana/atom,hpham04/atom,rxkit/atom,champagnez/atom,codex8/atom,florianb/atom,avdg/atom,tjkr/atom,toqz/atom,gabrielPeart/atom,yomybaby/atom,kc8wxm/atom,lisonma/atom,dsandstrom/atom,YunchengLiao/atom,GHackAnonymous/atom,tony612/atom,dannyflax/atom,deoxilix/atom,bryonwinger/atom,bj7/atom,vcarrera/atom,chengky/atom,panuchart/atom,basarat/atom,Huaraz2/atom,constanzaurzua/atom,xream/atom,Andrey-Pavlov/atom,basarat/atom,svanharmelen/atom,alfredxing/atom,Abdillah/atom,fredericksilva/atom,mdumrauf/atom,brettle/atom,Andrey-Pavlov/atom,FoldingText/atom,Neron-X5/atom,AdrianVovk/substance-ide,hpham04/atom,paulcbetts/atom,0x73/atom,lpommers/atom,avdg/atom,constanzaurzua/atom,crazyquark/atom,fedorov/atom,phord/atom,abcP9110/atom,amine7536/atom,me6iaton/atom,efatsi/atom,nvoron23/atom,palita01/atom,tony612/atom,hagb4rd/atom,CraZySacX/atom,Neron-X5/atom,brumm/atom,MjAbuz/atom,kittens/atom,abe33/atom,rookie125/atom,atom/atom,Rychard/atom,brumm/atom,sebmck/atom,liuderchi/atom,bcoe/atom,codex8/atom,hpham04/atom,yangchenghu/atom,ezeoleaf/atom,omarhuanca/atom,prembasumatary/atom,AlisaKiatkongkumthon/atom,burodepeper/atom,ilovezy/atom,kevinrenaers/atom,ivoadf/atom,stinsonga/atom,acontreras89/atom,Neron-X5/atom,kdheepak89/atom,yalexx/atom,Galactix/atom,RuiDGoncalves/atom,lovesnow/atom,n-riesco/atom,vhutheesing/atom,tony612/atom,h0dgep0dge/atom,dkfiresky/atom,kandros/atom,vjeux/atom,paulcbetts/atom,batjko/atom,dsandstrom/atom,sxgao3001/atom,Jdesk/atom,rmartin/atom,vinodpanicker/atom,me6iaton/atom,ardeshirj/atom,ali/atom,splodingsocks/atom,isghe/atom,G-Baby/atom,burodepeper/atom,0x73/atom,bryonwinger/atom,basarat/atom,fang-yufeng/atom,BogusCurry/atom,florianb/atom,codex8/atom,tony612/atom,sekcheong/atom,sxgao3001/atom,Rychard/atom,ObviouslyGreen/atom,Dennis1978/atom,chfritz/atom,fedorov/atom,bryonwinger/atom,KENJU/atom,GHackAnonymous/atom,alfredxing/atom,omarhuanca/atom,AdrianVovk/substance-ide,PKRoma/atom,MjAbuz/atom,splodingsocks/atom,sekcheong/atom,kjav/atom,toqz/atom,paulcbetts/atom,xream/atom,devoncarew/atom,john-kelly/atom,Shekharrajak/atom,targeter21/atom,bolinfest/atom,YunchengLiao/atom,liuderchi/atom,KENJU/atom,Jdesk/atom,G-Baby/atom,seedtigo/atom,001szymon/atom,devmario/atom,DiogoXRP/atom,phord/atom,isghe/atom,jjz/atom,ali/atom,acontreras89/atom,YunchengLiao/atom,Jdesk/atom,scippio/atom,Sangaroonaom/atom,vinodpanicker/atom,ali/atom,pombredanne/atom,sotayamashita/atom,rxkit/atom,champagnez/atom,devoncarew/atom,AlexxNica/atom,jordanbtucker/atom,omarhuanca/atom,seedtigo/atom,mnquintana/atom,FoldingText/atom,bsmr-x-script/atom,decaffeinate-examples/atom,lisonma/atom,sxgao3001/atom,devmario/atom,woss/atom,anuwat121/atom,matthewclendening/atom,davideg/atom,gabrielPeart/atom,rookie125/atom,KENJU/atom,sillvan/atom,lovesnow/atom,deepfox/atom,Abdillah/atom,me-benni/atom,MjAbuz/atom,prembasumatary/atom,Jonekee/atom,qskycolor/atom,matthewclendening/atom,mertkahyaoglu/atom,NunoEdgarGub1/atom,johnhaley81/atom,einarmagnus/atom,bradgearon/atom,nvoron23/atom,synaptek/atom,Shekharrajak/atom,gzzhanghao/atom,johnrizzo1/atom,BogusCurry/atom,gisenberg/atom,sekcheong/atom,Mokolea/atom,hakatashi/atom,alfredxing/atom,t9md/atom,ezeoleaf/atom,Dennis1978/atom,ralphtheninja/atom,hagb4rd/atom,bryonwinger/atom,mrodalgaard/atom,abe33/atom,me6iaton/atom,elkingtonmcb/atom,daxlab/atom,tanin47/atom,hakatashi/atom,SlimeQ/atom,kjav/atom,chengky/atom,mnquintana/atom,mnquintana/atom,ppamorim/atom,phord/atom,lpommers/atom,dijs/atom,kaicataldo/atom,kjav/atom,001szymon/atom,Andrey-Pavlov/atom,mdumrauf/atom,bcoe/atom,toqz/atom,lovesnow/atom,kevinrenaers/atom,hakatashi/atom,tisu2tisu/atom,MjAbuz/atom,vinodpanicker/atom,gzzhanghao/atom,ReddTea/atom,bencolon/atom,dannyflax/atom,yomybaby/atom,dannyflax/atom,jlord/atom
3fda3a8dc47d65d23bf836c3ef35569d1ed2e2b4
keymaps/debugger-ui-default.cson
keymaps/debugger-ui-default.cson
'atom-text-editor': 'alt-cmd-r': 'debugger:start-locally' 'alt-cmd-e': 'debugger:stop' 'alt-cmd-c': 'debugger:resume' 'alt-cmd-y': 'debugger:pause' 'f6': 'debugger:step-over' 'f7': 'debugger:step-into'
'atom-text-editor': 'alt-cmd-r': 'debugger:start' 'alt-cmd-e': 'debugger:stop' 'alt-cmd-c': 'debugger:resume' 'alt-cmd-y': 'debugger:pause' 'alt-cmd-7': 'debugger:toggle-breakpoint-at-current-line' 'f6': 'debugger:step-over' 'f7': 'debugger:step-into'
Change keymap according to upstream command changes
Change keymap according to upstream command changes
CoffeeScript
mit
AtomDebugger/debugger-ui-default
9c0ceb69e947ce97f7d7d6218b9abfb4f3521dd5
battle-detail.coffee
battle-detail.coffee
require 'coffee-react/register' require "#{ROOT}/views/env" i18n = require './node_modules/i18n' {join} = require 'path-extra' i18n.configure locales: ['en-US', 'ja-JP', 'zh-CN', 'zh-TW'] defaultLocale: 'zh-CN' directory: join(__dirname, 'assets', 'i18n') updateFiles: false indent: '\t' extension: '.json' i18n.setLocale(window.language) window.__ = i18n.__ require './views'
require 'coffee-react/register' require "#{ROOT}/views/env" try require 'poi-plugin-translator' catch error console.error error i18n = require './node_modules/i18n' {join} = require 'path-extra' i18n.configure locales: ['en-US', 'ja-JP', 'zh-CN', 'zh-TW'] defaultLocale: 'zh-CN' directory: join(__dirname, 'assets', 'i18n') updateFiles: false indent: '\t' extension: '.json' i18n.setLocale(window.language) window.__ = i18n.__ require './views'
Use poi-plugin-translator to translate ships and items
Use poi-plugin-translator to translate ships and items
CoffeeScript
mit
poooi/plugin-battle-detail
3ec6063aab6257f1e836dfefc7e2901c745d5f7e
src/watch.coffee
src/watch.coffee
fs = require 'fs' path = require 'path' vm = require './vm' walk = require './walk' {parseArgs} = require './utils' module.exports = parseArgs (basePath, opts, cb) -> {relative, excluded} = opts opts.patch ?= true modules = {} watching = {} watch = (dir, isModule) -> return modules[dir] = true if isModule watching[dir].close() if watching[dir] watching[dir] = fs.watch dir, (event, filename) -> filename = path.join dir, filename return if excluded filename fs.stat filename, (err, stats) -> # ignore non-existent files return if err? or not stats? # watch new directory created if stats.isDirectory() watch filename else # callback with modified file cb (relative filename), stats, modules[filename] ? false watch basePath walk basePath, opts, (filename, stats) -> return if excluded filename watch filename if stats.isDirectory() if opts.patch vm (filename, stats) -> return if excluded filename watch filename, true if stats.isDirectory() watch
fs = require 'fs' path = require 'path' vm = require './vm' walk = require './walk' {parseArgs} = require './utils' module.exports = parseArgs (basePath, opts, cb) -> {relative, excluded} = opts opts.patch ?= true opts.recurse ?= true modules = {} watching = {} watch = (dir, isModule) -> return modules[dir] = true if isModule watching[dir].close() if watching[dir] watching[dir] = fs.watch dir, (event, filename) -> filename = path.join dir, filename return if excluded filename fs.stat filename, (err, stats) -> # ignore non-existent files return if err? or not stats? # watch new directory created if stats.isDirectory() watch filename else # callback with modified file cb (relative filename), stats, modules[filename] ? false watch basePath if opts.recurse walk basePath, opts, (filename, stats) -> return if excluded filename watch filename if stats.isDirectory() if opts.patch vm (filename, stats) -> return if excluded filename watch filename, true if stats.isDirectory() watch
Make it possible to not recurse through dir.
Make it possible to not recurse through dir.
CoffeeScript
mit
zeekay/vigil
0c87a66207bc620e73122a7f7b64422e0553f8d7
src/date-format.coffee
src/date-format.coffee
angular .module('angular-w') .directive('dateFormat', ['dateFilter', (dateFilter)-> restrict: 'A' require: 'ngModel' link: (scope, element, attrs, ngModel)-> ngModel.$formatters.push (value)-> console.log(value) dateFilter(value, attrs.dateFormat) ngModel.$parsers.push (value)-> new Date(value) ])
angular .module('angular-w') .directive('dateFormat', ['dateFilter', (dateFilter)-> restrict: 'A' require: 'ngModel' link: (scope, element, attrs, ngModel)-> ngModel.$formatters.push (value)-> date = if angular.isString(value) milis = Date.parse(value) new Date(milis) unless isNaN(milis) else value dateFilter(date, attrs.dateFormat) ngModel.$parsers.push (value)-> new Date(value) ])
Fix dateFormat directive to accept string model values.
Fix dateFormat directive to accept string model values.
CoffeeScript
mit
lykmapipo/formstamp,formstamp/formstamp,formstamp/formstamp,lykmapipo/formstamp,lykmapipo/formstamp,formstamp/formstamp
c84846970d87c3037798e65fe901ec51d3bf53ae
spec/appSpec.coffee
spec/appSpec.coffee
describe 'Laere Module', -> # load the controller's module beforeEach module 'laere' HeaderController = scope = null # Initialize the controller and a mock scope beforeEach inject ($controller, $rootScope) -> scope = $rootScope.$new() HeaderController = $controller 'HeaderController', $scope: scope it 'should have a defined menu', -> console.log scope expect(scope.menu).toBeDefined()
describe 'Laere Module', -> # load the controller's module beforeEach module 'laere' HeaderController = scope = null # Initialize the controller and a mock scope beforeEach inject ($controller, $rootScope) -> scope = $rootScope.$new() HeaderController = $controller 'HeaderController', $scope: scope it 'should have a defined menu', -> console.log scope expect(scope.global).toBeDefined()
Fix test, no more menu on header.
Fix test, no more menu on header.
CoffeeScript
mit
moongate/laere-ui,moongate/laere-ui
ba2a06ee3f7be5e1ea4fe0c607a23603067f613a
app/assets/javascripts/langtrainer_frontend_backbone/views/unit_selector.js.coffee
app/assets/javascripts/langtrainer_frontend_backbone/views/unit_selector.js.coffee
class Langtrainer.LangtrainerApp.Views.UnitSelector extends Backbone.View _.extend(@prototype, Langtrainer.LangtrainerApp.Views.Extensions.Localized) template: JST['langtrainer_frontend_backbone/templates/unit_selector'] id: 'unit-selector' events: 'change select': 'onChange' initialize: -> @listenTo @collection, 'reset', @render @initLocalization(onLocaleChanged: @render) render: -> that = @ if @collection.length > 0 @$el.hide().html(@template( units: @collection.models model: @model label: LangtrainerI18n.t('label.unit') )) @$input = @.$('select') @$input.selectpicker(noneSelectedText: '') @$el.show() @ onChange: (ev) -> slug = $(ev.target).val() if slug != @model.get('slug') @model.set('slug', slug)
class Langtrainer.LangtrainerApp.Views.UnitSelector extends Backbone.View _.extend(@prototype, Langtrainer.LangtrainerApp.Views.Extensions.Localized) template: JST['langtrainer_frontend_backbone/templates/unit_selector'] id: 'unit-selector' events: 'change select': 'onChange' initialize: -> @listenTo @collection, 'reset', @render @initLocalization(onLocaleChanged: @render) render: -> that = @ if @collection.length > 0 @$el.hide().html(@template( units: @collection.models model: @model label: LangtrainerI18n.t('label.unit') )) @$input = @.$('select') @$input.selectpicker(noneSelectedText: '') @$el.show() @ onChange: (ev) -> slug = $(ev.target).val() if slug != @model.get('slug') @model.set @collection.findWhere(slug: slug).attributes
Change all attributes of current unit when another unit is selected
Change all attributes of current unit when another unit is selected
CoffeeScript
mit
langtrainer/langtrainer_frontend_backbone,langtrainer/langtrainer_frontend_backbone,langtrainer/langtrainer_frontend_backbone
6ac784d6701495b865c37a7c537e8c4f8e6f7ae7
lib/generators/rails_script/install/templates/base.js.coffee
lib/generators/rails_script/install/templates/base.js.coffee
window.App ||= {} class App.Base constructor: -> return this create: -> $this.new() return update: -> $this.edit() return
window.App ||= {} class App.Base constructor: -> return this create: -> if typeof $this.new == 'function' return $this.new() update: -> if typeof $this.edit == 'function' return $this.edit()
Make sure new/edit exists before calling them on create/update.
Make sure new/edit exists before calling them on create/update.
CoffeeScript
mit
gemgento/rails_script,kpheasey/rails_script
9afa9f12517a135a3c3a31f20dcdd33489be7f1e
lib/markdown-preview.coffee
lib/markdown-preview.coffee
url = require 'url' fs = require 'fs-plus' MarkdownPreviewView = require './markdown-preview-view' module.exports = activate: -> atom.workspaceView.command 'markdown-preview:show', => @show() atom.workspace.registerOpener (uriToOpen) -> {protocol, pathname} = url.parse(uriToOpen) return unless protocol is 'markdown-preview:' and fs.isFileSync(pathname) new MarkdownPreviewView(pathname) show: -> editor = atom.workspace.getActiveEditor() return unless editor? unless editor.getGrammar().scopeName is "source.gfm" console.warn("Cannot render markdown for '#{editor.getUri() ? 'untitled'}'") return unless fs.existsSync(editor.getPath()) console.warn("Cannot render markdown for '#{editor.getPath() ? 'untitled'}'") return previousActivePane = atom.workspace.getActivePane() uri = "markdown-preview://#{editor.getPath()}" atom.workspace.open(uri, split: 'right', searchAllPanes: true).done (markdownPreviewView) -> markdownPreviewView.renderMarkdown() previousActivePane.activate()
url = require 'url' fs = require 'fs-plus' MarkdownPreviewView = require './markdown-preview-view' module.exports = activate: -> atom.workspaceView.command 'markdown-preview:show', => @show() atom.workspace.registerOpener (uriToOpen) -> {protocol, pathname} = url.parse(uriToOpen) return unless protocol is 'markdown-preview:' and fs.isFileSync(pathname) new MarkdownPreviewView(pathname) show: -> editor = atom.workspace.getActiveEditor() return unless editor? unless editor.getGrammar().scopeName is "source.gfm" console.warn("Cannot render markdown for '#{editor.getUri() ? 'untitled'}'") return unless fs.isFileSync(editor.getPath()) console.warn("Cannot render markdown for '#{editor.getPath() ? 'untitled'}'") return previousActivePane = atom.workspace.getActivePane() uri = "markdown-preview://#{editor.getPath()}" atom.workspace.open(uri, split: 'right', searchAllPanes: true).done (markdownPreviewView) -> markdownPreviewView.renderMarkdown() previousActivePane.activate()
Use isFileSync instead of existsSync
Use isFileSync instead of existsSync
CoffeeScript
mit
atom/markdown-preview,grimmer0125/markdown-preview-kramdown,makyo/markdown-preview,ArnaudRinquin/markdown-preview,rugk/markdown-preview,Galadirith/markdown-preview,danielgtaylor/atom-api-blueprint-preview,tkssharma/markdown-preview,sctlee/markdown-preview
7b179a89c09affc124251a81cf79e0fa792a0407
.config/atom/snippets.cson
.config/atom/snippets.cson
# Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' '.source.js': 'block-comment': 'prefix': '/**' 'body': '/*\n * $1\n */' 'console-log': 'prefix': 'cl' 'body': 'console.log($1);' 'describe': 'prefix': 'describe' 'body': 'describe(\'$1\', function() {\n $2\n});' 'it': 'prefix': 'it' 'body': 'it(\'should $1\', function() {\n $2\n});' 'fun': 'prefix': 'fun' 'body': 'function() {\n $1\n};' # Each scope (e.g. '.source.coffee' above) can only be declared once. # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it in the # Atom Flight Manual: # https://atom.io/docs/latest/using-atom-basic-customization#cson
# Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' '.source.js': 'block-comment': 'prefix': '/**' 'body': '/*\n * $1\n */' 'console-log': 'prefix': 'cl' 'body': 'console.log($1);' 'describe': 'prefix': 'describe' 'body': 'describe(\'$1\', function() {\n $2\n});' 'it': 'prefix': 'it' 'body': 'it(\'should $1\', function() {\n $2\n});' 'fun': 'prefix': 'fun' 'body': 'function() {\n $1\n};' 'use-strict': 'prefix': 'us' 'body': '\'use strict\';' # Each scope (e.g. '.source.coffee' above) can only be declared once. # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it in the # Atom Flight Manual: # https://atom.io/docs/latest/using-atom-basic-customization#cson
Add use strict atom snippet
Add use strict atom snippet
CoffeeScript
mit
glepretre/dotfiles
06324f9095f5ee531f78b66ccdc776304b356155
src/index.coffee
src/index.coffee
Promise = require 'zousan' Promise.suppressUncaughtRejectionError = true class PromiseInspection constructor: ({@state, @value, @reason}) -> isFulfilled: -> @state is 'fulfilled' isRejected: -> @state is 'rejected' Promise.reflect = (promise) -> new Promise (resolve, reject) -> promise .then (value) -> resolve new PromiseInspection state: 'fulfilled' value: value .catch (err) -> resolve new PromiseInspection state: 'rejected' reason: err Promise.settle = (promises) -> Promise.all promises.map Promise.reflect Promise::callback = (cb) -> if typeof cb is 'function' @then (value) -> cb null, value @catch (error) -> cb error, null @ module.exports = Promise
Promise = require 'zousan' Promise.suppressUncaughtRejectionError = false class PromiseInspection constructor: ({@state, @value, @reason}) -> isFulfilled: -> @state is 'fulfilled' isRejected: -> @state is 'rejected' Promise.reflect = (promise) -> new Promise (resolve, reject) -> promise .then (value) -> resolve new PromiseInspection state: 'fulfilled' value: value .catch (err) -> resolve new PromiseInspection state: 'rejected' reason: err Promise.settle = (promises) -> Promise.all promises.map Promise.reflect Promise::callback = (cb) -> if typeof cb is 'function' @then (value) -> cb null, value @catch (error) -> cb error, null @ module.exports = Promise
Make sure to not suppress errors.
Make sure to not suppress errors.
CoffeeScript
mit
zeekay/broken
3817c5fca9d0ae2ac52c688560858dc8598ac813
src/rabbitmq.coffee
src/rabbitmq.coffee
AMQPStats = require 'amqp-stats' debug = require('debug')('guv:rabbitmq') url = require 'url' amqpOptions = (str) -> o = {} u = url.parse str [ user, password ] = u.auth.split ':' o.hostname = u.host # includes port o.username = user o.password = password o.protocol = 'https' return o exports.getStats = (config, callback) -> options = amqpOptions config.broker debug 'options', options amqp = new AMQPStats options amqp.queues (err, res, queues) -> debug 'got queue info', err, queues?.length return callback err if err details = {} stats = {} for queue in queues details[queue.name] = queue stats[queue.name] = queue.messages_ready return callback null, stats, details
AMQPStats = require 'amqp-stats' debug = require('debug')('guv:rabbitmq') url = require 'url' amqpOptions = (str) -> o = {} u = url.parse str [ user, password ] = u.auth.split ':' o.hostname = u.host # includes port o.username = user o.password = password o.protocol = 'https' return o exports.getStats = (config, callback) -> options = amqpOptions config.broker debug 'options', options amqp = new AMQPStats options amqp.queues (err, res, queues) -> debug 'got queue info', err, queues?.length return callback err if err details = {} stats = {} for queue in queues details[queue.name] = queue stats[queue.name] = queue.messages return callback null, stats, details
Read total number of messages instead of those in queue
RabbitMQ: Read total number of messages instead of those in queue Reduces issue where workers were being shut down when they had work in progress: the messages went back to queue and then had to start up more workers again. Especially painful for min=0 roles. Will cause us to overestimate a bit generally, but thats fine.
CoffeeScript
mit
the-grid/guv,the-grid/guv,flowhub/guv
df4197475e175e4885699a6ec561541c13e49f75
client/ide/fs/fsfolder.coffee
client/ide/fs/fsfolder.coffee
class FSFolder extends FSFile fetchContents:(callback, dontWatch=yes)-> { treeController } = @getOptions() @emit "fs.job.started" @vmController.run method : 'fs.readDirectory' vmName : @vmName withArgs : onChange : if dontWatch then null else (change)=> FSHelper.folderOnChange @vmName, @path, change, treeController path : FSHelper.plainPath @path , (err, response)=> if not err and response?.files files = FSHelper.parseWatcher @vmName, @path, response.files, treeController @registerWatcher response @emit "fs.job.finished", err, files else @emit "fs.job.finished", err callback? err, files save:(callback)-> @emit "fs.save.started" @vmController.run vmName : @vmName method : 'fs.createDirectory' withArgs : path : FSHelper.plainPath @path , (err, res)=> if err then warn err @emit "fs.save.finished", err, res callback? err, res saveAs:(callback)-> log 'Not implemented yet.' callback? null remove:(callback)-> @off 'fs.delete.finished' @on 'fs.delete.finished', => return unless finder = KD.getSingleton 'finderController' finder.stopWatching @path super callback, yes registerWatcher:(response)-> {@stopWatching} = response finder = KD.getSingleton 'finderController' return unless finder finder.registerWatcher @path, @stopWatching if @stopWatching
class FSFolder extends FSFile fetchContents:(callback, dontWatch=yes)-> { treeController } = @getOptions() @emit "fs.job.started" @vmController.run method : 'fs.readDirectory' vmName : @vmName withArgs : onChange : if dontWatch then null else (change)=> FSHelper.folderOnChange @vmName, @path, change, treeController path : FSHelper.plainPath @path , (err, response)=> if not err and response?.files files = FSHelper.parseWatcher @vmName, @path, response.files, treeController @registerWatcher response @emit "fs.job.finished", err, files else @emit "fs.job.finished", err callback? err, files save:(callback)-> @emit "fs.save.started" @vmController.run vmName : @vmName method : 'fs.createDirectory' withArgs : path : FSHelper.plainPath @path , (err, res)=> if err then warn err @emit "fs.save.finished", err, res callback? err, res saveAs:(callback)-> log 'Not implemented yet.' callback? null remove:(callback)-> @off 'fs.delete.finished' @on 'fs.delete.finished', => finder = @treeController.delegate finder?.stopWatching @path super callback, yes registerWatcher:(response)-> {@stopWatching} = response finder = @treeController.delegate finder?.registerWatcher @path, @stopWatching if @stopWatching
Use treeController's delegate as FinderController since there is no more FinderController singleton
FSFolder: Use treeController's delegate as FinderController since there is no more FinderController singleton
CoffeeScript
agpl-3.0
acbodine/koding,koding/koding,mertaytore/koding,kwagdy/koding-1,jack89129/koding,cihangir/koding,szkl/koding,mertaytore/koding,mertaytore/koding,usirin/koding,jack89129/koding,rjeczalik/koding,usirin/koding,koding/koding,andrewjcasal/koding,jack89129/koding,rjeczalik/koding,drewsetski/koding,alex-ionochkin/koding,gokmen/koding,drewsetski/koding,cihangir/koding,sinan/koding,szkl/koding,sinan/koding,sinan/koding,jack89129/koding,gokmen/koding,usirin/koding,acbodine/koding,cihangir/koding,szkl/koding,koding/koding,mertaytore/koding,andrewjcasal/koding,cihangir/koding,andrewjcasal/koding,koding/koding,jack89129/koding,kwagdy/koding-1,gokmen/koding,mertaytore/koding,cihangir/koding,rjeczalik/koding,acbodine/koding,drewsetski/koding,andrewjcasal/koding,kwagdy/koding-1,acbodine/koding,mertaytore/koding,drewsetski/koding,sinan/koding,cihangir/koding,sinan/koding,usirin/koding,jack89129/koding,gokmen/koding,usirin/koding,alex-ionochkin/koding,acbodine/koding,koding/koding,alex-ionochkin/koding,rjeczalik/koding,kwagdy/koding-1,andrewjcasal/koding,koding/koding,alex-ionochkin/koding,andrewjcasal/koding,gokmen/koding,sinan/koding,usirin/koding,gokmen/koding,drewsetski/koding,mertaytore/koding,kwagdy/koding-1,mertaytore/koding,gokmen/koding,kwagdy/koding-1,rjeczalik/koding,alex-ionochkin/koding,jack89129/koding,szkl/koding,acbodine/koding,kwagdy/koding-1,drewsetski/koding,acbodine/koding,rjeczalik/koding,alex-ionochkin/koding,koding/koding,andrewjcasal/koding,szkl/koding,cihangir/koding,sinan/koding,usirin/koding,acbodine/koding,cihangir/koding,usirin/koding,rjeczalik/koding,koding/koding,gokmen/koding,rjeczalik/koding,szkl/koding,szkl/koding,drewsetski/koding,szkl/koding,alex-ionochkin/koding,kwagdy/koding-1,sinan/koding,andrewjcasal/koding,alex-ionochkin/koding,jack89129/koding,drewsetski/koding
2ba3e21539241bd4ec956b1cbde3ed94b9e0953f
app/assets/javascripts/popover.js.coffee
app/assets/javascripts/popover.js.coffee
$(document).on 'ready page:load', -> $("a.popover").click -> event.preventDefault() popover_src = $(this).children("img").attr("data-src") popover_caption = $(this).children("img").attr("alt") popover_width = $(this).children("img").attr("data-width") popover_height = $(this).children("img").attr("data-height") $("div#popover img").attr "src", popover_src $("div#popover img").attr "alt", popover_caption $("div#popover img").attr "width", popover_width $("div#popover img").attr "height", popover_height $("div#popover").fadeIn "fast" $("div#popover button").click -> event.preventDefault() $("div#popover").fadeOut "fast"
$(document).on 'ready page:load', -> $("a.popover").click (event) -> event.preventDefault() popover_src = $(this).children("img").attr("data-src") popover_caption = $(this).children("img").attr("alt") popover_width = $(this).children("img").attr("data-width") popover_height = $(this).children("img").attr("data-height") $("div#popover img").attr "src", popover_src $("div#popover img").attr "alt", popover_caption $("div#popover img").attr "width", popover_width $("div#popover img").attr "height", popover_height $("div#popover").fadeIn "fast" $("div#popover button").click -> event.preventDefault() $("div#popover").fadeOut "fast"
Add event parameter to popover click event
Add event parameter to popover click event
CoffeeScript
mit
chrisalley/chris-alley-rails,chrisalley/chris-alley-rails,chrisalley/chris-alley-old,chrisalley/chris-alley-old
ff758930a606de9c200201cf9ff49db95e5a7ab3
tasks/gyp.coffee
tasks/gyp.coffee
gyp = require('node-gyp')() # The first two arguments are apparently necessary as else nopt won’t include # loglevel as an option. defaultArgv = ['node', '.', '--loglevel=silent'] # It is necessary to execute rebuild manually as calling node-gyp’s rebuild # programmatically fires the callback function too early. manualRebuild = (callback) -> gyp.commands.clean [], (error) -> callback(error) if error gyp.commands.configure [], (error) -> callback(error) if error gyp.commands.build [], callback module.exports = (grunt) -> grunt.registerMultiTask 'gyp', 'Run node-gyp commands from Grunt.', -> done = @async() options = @options debug: false argv = defaultArgv.slice() # If we do not push '--no-debug' node-gyp might keep the debug option on # as it was set on an earlier run. if options.debug then argv.push '--debug' else argv.push '--no-debug' gyp.parseArgv argv gypCallback = (error) -> if error then done(false) else done() @data.command = 'rebuild' if !@data.command switch @data.command when 'clean' then gyp.commands.clean [], gypCallback when 'configure' then gyp.commands.configure [], gypCallback when 'build' then gyp.commands.build [], gypCallback when 'rebuild' then manualRebuild gypCallback
gyp = require('node-gyp')() # The first two arguments are apparently necessary as else nopt won’t include # loglevel as an option. defaultArgv = ['node', '.', '--loglevel=silent'] # It is necessary to execute rebuild manually as calling node-gyp’s rebuild # programmatically fires the callback function too early. manualRebuild = (callback) -> gyp.commands.clean [], (error) -> return callback(error) if error gyp.commands.configure [], (error) -> return callback(error) if error gyp.commands.build [], callback module.exports = (grunt) -> grunt.registerMultiTask 'gyp', 'Run node-gyp commands from Grunt.', -> done = @async() options = @options debug: false argv = defaultArgv.slice() # If we do not push '--no-debug' node-gyp might keep the debug option on # as it was set on an earlier run. if options.debug then argv.push '--debug' else argv.push '--no-debug' gyp.parseArgv argv gypCallback = (error) -> if error then done(false) else done() @data.command = 'rebuild' if !@data.command switch @data.command when 'clean' then gyp.commands.clean [], gypCallback when 'configure' then gyp.commands.configure [], gypCallback when 'build' then gyp.commands.build [], gypCallback when 'rebuild' then manualRebuild gypCallback
Stop execution on rebuild if one command fails
Stop execution on rebuild if one command fails Before, the callback was called with an error but execution continued on.
CoffeeScript
bsd-2-clause
SonicHedgehog/grunt-node-gyp
3032c72ee788a004403b91855db1cd9781d0cba4
config.coffee
config.coffee
# # Using ["The Twelve-Factor App"](http://12factor.net/) as a reference all # environment configuration will live in environment variables. This file # simply lays out all of those environment variables with sensible defaults # for development. # module.exports = NODE_ENV: "development" PORT: 4000 APP_URL: "http://localhost:4000" API_URL: "http://api.are.na/v2" PUSHER_KEY: '19beda1f7e2ca403abab' S3_KEY: null S3_SECRET: null SESSION_SECRET: '3rv3ll-mAnd1ngo' SESSION_COOKIE_MAX_AGE: 31536000000 SESSION_COOKIE_KEY: 'arena.session' BLOG_URL: 'http://127.0.0.1:4000/' COOKIE_DOMAIN: null ASSET_PATH: '/assets/' IMAGE_PATH: '/images/' IMAGE_PROXY_URL: 'http://images.are.na' REDIS_URL: null GOOGLE_ANALYTICS_ID: null STRIPE_PUBLISHABLE_KEY: null # Override any values with env variables if they exist for key, val of module.exports val = (process.env[key] or val) module.exports[key] = try JSON.parse(val) catch then val
# # Using ["The Twelve-Factor App"](http://12factor.net/) as a reference all # environment configuration will live in environment variables. This file # simply lays out all of those environment variables with sensible defaults # for development. # module.exports = NODE_ENV: "development" PORT: 4000 APP_URL: "http://localhost:4000" API_URL: "http://api.are.na/v2" PUSHER_KEY: '19beda1f7e2ca403abab' S3_KEY: null S3_SECRET: null SESSION_SECRET: '3rv3ll-mAnd1ngo' SESSION_COOKIE_MAX_AGE: 31536000000 SESSION_COOKIE_KEY: 'arena.session' BLOG_URL: 'http://posts.are.na' COOKIE_DOMAIN: null ASSET_PATH: '/assets/' IMAGE_PATH: '/images/' IMAGE_PROXY_URL: 'http://images.are.na' REDIS_URL: null GOOGLE_ANALYTICS_ID: null STRIPE_PUBLISHABLE_KEY: null # Override any values with env variables if they exist for key, val of module.exports val = (process.env[key] or val) module.exports[key] = try JSON.parse(val) catch then val
Revert back to production posts
Revert back to production posts
CoffeeScript
mit
broskoski/ervell,arenahq/ervell,broskoski/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,arenahq/ervell,aredotna/ervell
e642374b74a0186ab01d6a6c08af6b0fc2ffffd0
src/scripts/servant.coffee
src/scripts/servant.coffee
# Hubot is very attentive module.exports = (robot) -> name_regex = new RegExp("#{robot.name}\\?$", "i") robot.hear name_regex, (msg) -> msg.reply "Yes, master?"
# Hubot is very attentive (ping hubot) phrases = [ "Yes, master?" "At your service" "Unleash my strength" "I'm here. As always" "By your command" "Ready to work!" "Yes, milord?" "More work?" "Ready for action" "Orders?" "What do you need?" "Say the word" "Aye, my lord" "Locked and loaded" "Aye, sir?" "I await your command" "Your honor?" "Command me!" "At once" "What ails you?" "Yes, my firend?" "Is my aid required?" "Do you require my aid?" "My powers are ready" "It's hammer time!" "I'm your robot" "I'm on the job" "You're interrupting my calculations!" "What is your wish?" "How may I serve?" "At your call" "You require my assistance?" "What is it now?" "Hmm?" "I'm coming through!" "I'm here, mortal" "I'm ready and waiting" "Ah, at last" "I'm here" "Something need doing?" ] module.exports = (robot) -> name_regex = new RegExp("#{robot.name}\\?$", "i") robot.hear name_regex, (msg) -> msg.reply msg.random phrases
Add more phrases to ping hubot
Add more phrases to ping hubot
CoffeeScript
mit
marksie531/hubot-scripts,ericjsilva/hubot-scripts,alexhouse/hubot-scripts,arcaartem/hubot-scripts,amhorton/hubot-scripts,magicstone1412/hubot-scripts,yigitbey/hubot-scripts,bruno/hubot-scripts,iilab/hubot-scripts,cycomachead/hubot-scripts,contolini/hubot-scripts,janx/hubot-scripts,markstory/hubot-scripts,Tyriont/hubot-scripts,azimman/hubot-scripts,terryjbates/hubot-scripts,1000hz/hubot-scripts,jan0sch/hubot-scripts,justinwoo/hubot-scripts,chauffer/hubot-scripts,flores/hubot-scripts,gregburek/emojibot,DataDog/hubot-scripts,GrimDerp/hubot-scripts,Ev1l/hubot-scripts,1stdibs/hubot-scripts,sklise/hubot-scripts,zecahnin/hubot-scripts,davidsulpy/hubot-scripts,fromonesrc/hubot-scripts,flores/hubot-scripts,wsoula/hubot-scripts,jacobtomlinson/hubot-scripts,dyg2104/hubot-scripts,opentable/hubot-scripts,josephcarmello/hubot-scripts,modulexcite/hubot-scripts,jhubert/hubot-scripts,jankowiakmaria/hubot-scripts,DataDog/hubot-scripts,ambikads/hubot-scripts,github/hubot-scripts,dhfromkorea/hubot-scripts,dbkaplun/hubot-scripts,MaxMEllon/hubot-scripts,bruno/hubot-scripts,n0mer/hubot-scripts,phillipalexander/hubot-scripts,ryantomlinson/hubot-scripts
5781ac00ba3d6f28c6a60ddcc433a5effb5cddd7
app/assets/javascripts/controllers/manuscript_manager_template_edit_controller.js.coffee
app/assets/javascripts/controllers/manuscript_manager_template_edit_controller.js.coffee
ETahi.ManuscriptManagerTemplateEditController = Ember.ObjectController.extend dirty: false paperTypes: (-> @get('journal.paperTypes') ).property('journal.paperTypes.@each') sortedPhases: Ember.computed.alias 'phases' actions: changeTaskPhase: (task, targetPhase) -> task.get('phase').removeTask(task) targetPhase.addTask(task) @set('dirty', true) addPhase: (position) -> newPhase = ETahi.TemplatePhase.create name: 'New Phase' @get('phases').insertAt(position, newPhase) @set('dirty', true) removePhase: (phase) -> phaseArray = @get('phases') phaseArray.removeAt(phaseArray.indexOf(phase)) @set('dirty', true) addTask: (phase, taskName) -> unless Ember.isBlank(taskName) newTask = ETahi.TemplateTask.create type: taskName phase.addTask(newTask) @set('dirty', true) removeTask: (task) -> task.destroy() @set('dirty', true) savePhase: (phase) -> @set('dirty', true) rollbackPhase: (phase, oldName) -> phase.set('name', oldName) saveTemplate: -> @get('model').save().then (template) => @transitionToRoute('manuscript_manager_template.edit', template) rollbackTemplate: -> @get('model').rollback() @set('dirty', false)
ETahi.ManuscriptManagerTemplateEditController = Ember.ObjectController.extend dirty: false paperTypes: (-> @get('journal.paperTypes') ).property('journal.paperTypes.@each') sortedPhases: Ember.computed.alias 'phases' actions: changeTaskPhase: (task, targetPhase) -> task.get('phase').removeTask(task) targetPhase.addTask(task) @set('dirty', true) addPhase: (position) -> newPhase = ETahi.TemplatePhase.create name: 'New Phase' @get('phases').insertAt(position, newPhase) @set('dirty', true) removePhase: (phase) -> phaseArray = @get('phases') phaseArray.removeAt(phaseArray.indexOf(phase)) @set('dirty', true) addTask: (phase, taskName) -> unless Ember.isBlank(taskName) newTask = ETahi.TemplateTask.create type: taskName phase.addTask(newTask) @set('dirty', true) removeTask: (task) -> task.destroy() @set('dirty', true) savePhase: (phase) -> @set('dirty', true) rollbackPhase: (phase, oldName) -> phase.set('name', oldName) saveTemplate: -> @get('model').save().then (template) => @set('dirty', false) @transitionToRoute('manuscript_manager_template.edit', template) rollbackTemplate: -> @get('model').rollback() @set('dirty', false)
Fix dirty tracking after save
Fix dirty tracking after save
CoffeeScript
mit
johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi
05de158f44e72207193c4fb86952a74b6ab3cebe
app/assets/javascripts/resolve/load_permalink.js.coffee
app/assets/javascripts/resolve/load_permalink.js.coffee
$ -> $("*[data-umlaut-toggle-permalink]").click (event) -> originalLink = $(this) valueContainer = $("#umlaut-permalink-container") loadedLink = $(".umlaut-permalink-content a") url = loadedLink.attr("href") if url == undefined loadedLink = $("#umlaut-permalink-content") url = loadedLink.attr("href") input = $("<input />") input.attr("value", url) input.addClass("form-control") valueContainer.html("Cut and paste the following URL:") valueContainer.append(input) valueContainer.append(loadedLink.attr("id","umlaut-permalink-content")) loadedLink.hide() input.select()
$ -> $("*[data-umlaut-toggle-permalink]").click (event) -> if $(".umlaut-permalink-container input").is(":visible") $(".umlaut-permalink-container input").select() permalinkLoaded = setInterval -> if $(".umlaut-permalink-container a").is(":visible") reformatPermalink(event) clearInterval(permalinkLoaded) , 0 reformatPermalink = (event) -> originalLink = $(this) valueContainer = $("#umlaut-permalink-container") loadedLink = $(".umlaut-permalink-container a") url = loadedLink.attr("href") input = $("<input />") input.attr("value", url) input.attr("readonly", "true") input.addClass("form-control") valueContainer.html("Cut and paste the following URL:") valueContainer.append(input) input.select()
Fix permalink reformat to wait for link to load if its the first time the page opened
Fix permalink reformat to wait for link to load if its the first time the page opened
CoffeeScript
mit
NYULibraries/getit,NYULibraries/getit,NYULibraries/getit,NYULibraries/getit
2fc177c2e7d8f498704686c4236ee1a49f8b8c7e
assets/js/add_observation.coffee
assets/js/add_observation.coffee
$ = jQuery $ -> current_jd = +$("#current-jd").text() $("#id_jd").val(current_jd)
$ = jQuery $ -> current_jd = +$("#current-jd").text() $("#id_jd").val(current_jd) detail_fields = $("#div_id_comp1, #div_id_comp2, #div_id_comment_code, #div_id_chart, #div_id_notes") detail_fields.hide()
Hide detailed observation fields by default.
Hide detailed observation fields by default.
CoffeeScript
mit
zsiciarz/variablestars.net,zsiciarz/variablestars.net,zsiciarz/variablestars.net
f049a63b7e2fcc556d8a513db8f2729b2545cbd9
LoggerFactory.coffee
LoggerFactory.coffee
class LoggerFactory instance = null @get: -> instance ?= new LoggerFactory createLogger: (namespace)-> log.debug 'LoggerFactory.createLogger()', arguments if namespace? expect(namespace).to.be.a('string').that.has.length.above(0) prefix = namespace + ':' expect(Loglevel).to.be.a 'function' return Loglevel(prefix) createPackageLogger: (packageName)-> return @createLogger(packageName) createAppLogger: (appName)-> return @createLogger(appName) loglevel = LoggerFactory.get()
class LoggerFactory instance = null @get: -> instance ?= new LoggerFactory createLogger: (namespace, defaultLevel)-> log.debug 'LoggerFactory.createLogger()', arguments if namespace? expect(namespace).to.be.a('string').that.has.length.above(0) prefix = namespace + ':' expect(Loglevel).to.be.a 'function' logger = Loglevel(prefix) logger.setLevel(defaultLevel) if defaultLevel? return logger createPackageLogger: (packageName)-> return @createLogger(packageName) createAppLogger: (appName)-> return @createLogger(appName) loglevel = LoggerFactory.get()
Support providing a defaultLevel when in logger factory
Support providing a defaultLevel when in logger factory
CoffeeScript
mit
practicalmeteor/meteor-loglevel,solderzzc/meteor-loglevel
dffbe9a5bf905b07adb27e7ac6f387c3a6a489dc
app/config.coffee
app/config.coffee
storage = require 'node-persist' storage.initSync() config = storage.getItemSync 'config' module.exports = getConfig: -> defaultDelay: 3 defaultDuration: 0.5 defaultTransition: "none" checkCycles: 2
storage = require 'node-persist' storage.initSync() config = storage.getItemSync 'config' module.exports = getConfig: -> defaultDelay: 3 defaultDuration: 0.5 defaultTransition: "none" checkCycles: 1
Check for new slides after every cycle
Check for new slides after every cycle
CoffeeScript
mit
Rezonation/sisetv,Rezonation/sisetv
d8f4763a5c6946c3323f2567cb1554244c844c05
test/unit/model/view.coffee
test/unit/model/view.coffee
sinon = require 'sinon' should = require 'should' describe 'Client model: View', -> helper = require '../helper' helper.evalConcatenatedFile 'client/code/model/tool.coffee' helper.evalConcatenatedFile 'client/code/model/view.coffee' describe 'URL', -> beforeEach -> @tool = Cu.Model.Tool.findOrCreate name: 'test-plugin' displayName: 'Test Plugin' @view = Cu.Model.View.findOrCreate user: 'test' box: 'box1' tool: 'test-plugin' it 'has a related tool', -> tool = @view.get('tool') tool.get('displayName').should.equal 'Test Plugin' class TestDb class Model constructor: (obj) -> for k of obj @[k] = obj[k] toObject: -> @ save: (callback) -> callback null @find: (_args, callback) -> callback null, [ new Model(name: 'test'), new Model(name: 'test2') ] View = require('model/view')(TestDb) describe 'Server model: View', -> before -> @saveSpy = sinon.spy TestDb.prototype, 'save' @findSpy = sinon.spy TestDb, 'find' @view = new View user: 'ickle' name: 'test' displayName: 'Test' box: 'sdjfsdf' context 'when view.save is called', -> before (done) -> @view.save done it 'calls mongoose save method', -> @saveSpy.calledOnce.should.be.true context 'when view.findAll is called', -> before (done) -> View.findAll (err, res) => @results = res done() it 'should return View results', -> @results[0].should.be.an.instanceOf View @results[0].name.should.equal 'test' @results.length.should.equal 2
sinon = require 'sinon' should = require 'should' describe 'Client model: View', -> helper = require '../helper' helper.evalConcatenatedFile 'client/code/model/tool.coffee' helper.evalConcatenatedFile 'client/code/model/view.coffee' describe 'URL', -> beforeEach -> @tool = Cu.Model.Tool.findOrCreate name: 'test-plugin' displayName: 'Test Plugin' @view = Cu.Model.View.findOrCreate user: 'test' box: 'box1' tool: 'test-plugin' it 'has a related tool', -> tool = @view.get('tool') tool.get('displayName').should.equal 'Test Plugin' class TestDb class Model constructor: (obj) -> for k of obj @[k] = obj[k] toObject: -> @ save: (callback) -> callback null @find: (_args, callback) -> callback null, [ new Model(name: 'test'), new Model(name: 'test2') ]
Remove old View test, which can't possibly work as Views don't have their own persistent model on server side
Remove old View test, which can't possibly work as Views don't have their own persistent model on server side
CoffeeScript
agpl-3.0
scraperwiki/custard,scraperwiki/custard,scraperwiki/custard
83ad5fd520b3c132724732474759db92a8b7809c
client/lib/cordova/push.coffee
client/lib/cordova/push.coffee
if Meteor.isCordova Tracker.autorun -> if RocketChat.settings.get('Push_enable') is true Push.Configure {} Push.addListener 'token', (token) -> Meteor.call 'log', 'token', arguments Push.addListener 'error', (err) -> Meteor.call 'log', 'error', arguments if error.type == 'apn.cordova' Meteor.call 'log', err.error Push.addListener 'register', (evt) -> Meteor.call 'log', 'register', arguments Push.addListener 'alert', (notification) -> Meteor.call 'log', 'alert', arguments Push.addListener 'sound', (notification) -> Meteor.call 'log', 'sound', arguments Push.addListener 'badge', (notification) -> Meteor.call 'log', 'badge', arguments Push.addListener 'startup', (notification) -> Meteor.call 'log', 'startup', arguments Push.addListener 'message', (notification) -> Meteor.call 'log', 'message', arguments
if Meteor.isCordova Tracker.autorun -> if RocketChat.settings.get('Push_enable') is true Push.Configure badge: true sound: true alert: true vibrate: true Push.addListener 'token', (token) -> Meteor.call 'log', 'token', arguments Push.addListener 'error', (err) -> Meteor.call 'log', 'error', arguments if error.type == 'apn.cordova' Meteor.call 'log', err.error Push.addListener 'register', (evt) -> Meteor.call 'log', 'register', arguments Push.addListener 'alert', (notification) -> Meteor.call 'log', 'alert', arguments Push.addListener 'sound', (notification) -> Meteor.call 'log', 'sound', arguments Push.addListener 'badge', (notification) -> Meteor.call 'log', 'badge', arguments Push.addListener 'startup', (notification) -> Meteor.call 'log', 'startup', arguments Push.addListener 'message', (notification) -> Meteor.call 'log', 'message', arguments
Add config for badge, sound, alert and vibrate for Push Notifications
Add config for badge, sound, alert and vibrate for Push Notifications
CoffeeScript
mit
jeann2013/Rocket.Chat,LearnersGuild/Rocket.Chat,christmo/Rocket.Chat,liemqv/Rocket.Chat,BHWD/noouchat,JamesHGreen/Rocket_API,dmitrijs-balcers/Rocket.Chat,webcoding/Rocket.Chat,I-am-Gabi/Rocket.Chat,lonbaker/Rocket.Chat,fatihwk/Rocket.Chat,flaviogrossi/Rocket.Chat,rasata/Rocket.Chat,inoio/Rocket.Chat,lukaroski/traden,danielbressan/Rocket.Chat,k0nsl/Rocket.Chat,sargentsurg/Rocket.Chat,xasx/Rocket.Chat,litewhatever/Rocket.Chat,Gyubin/Rocket.Chat,acaronmd/Rocket.Chat,kkochubey1/Rocket.Chat,NMandapaty/Rocket.Chat,adamteece/Rocket.Chat,Maysora/Rocket.Chat,callmekatootie/Rocket.Chat,BHWD/noouchat,katopz/Rocket.Chat,arvi/Rocket.Chat,cnash/Rocket.Chat,Flitterkill/Rocket.Chat,icaromh/Rocket.Chat,subesokun/Rocket.Chat,williamfortunademoraes/Rocket.Chat,timkinnane/Rocket.Chat,lukaroski/traden,BorntraegerMarc/Rocket.Chat,Deepakkothandan/Rocket.Chat,JamesHGreen/Rocket.Chat,coreyaus/Rocket.Chat,berndsi/Rocket.Chat,AimenJoe/Rocket.Chat,jbsavoy18/rocketchat-1,AlecTroemel/Rocket.Chat,pkgodara/Rocket.Chat,PavelVanecek/Rocket.Chat,abduljanjua/TheHub,fduraibi/Rocket.Chat,PavelVanecek/Rocket.Chat,revspringjake/Rocket.Chat,sunhaolin/Rocket.Chat,celloudiallo/Rocket.Chat,abduljanjua/TheHub,atyenoria/Rocket.Chat,Gudii/Rocket.Chat,steedos/chat,Abdelhamidhenni/Rocket.Chat,danielbressan/Rocket.Chat,linnovate/hi,inoio/Rocket.Chat,nathantreid/Rocket.Chat,jbsavoy18/rocketchat-1,callmekatootie/Rocket.Chat,thunderrabbit/Rocket.Chat,acaronmd/Rocket.Chat,litewhatever/Rocket.Chat,tlongren/Rocket.Chat,soonahn/Rocket.Chat,umeshrs/rocket-chat-integration,liuliming2008/Rocket.Chat,amaapp/ama,xboston/Rocket.Chat,KyawNaingTun/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,Jandersolutions/Rocket.Chat,LearnersGuild/Rocket.Chat,parkmap/Rocket.Chat,icaromh/Rocket.Chat,BorntraegerMarc/Rocket.Chat,apnero/tactixteam,adamteece/Rocket.Chat,Achaikos/Rocket.Chat,amaapp/ama,glnarayanan/Rocket.Chat,Sing-Li/Rocket.Chat,mccambridge/Rocket.Chat,slava-sh/Rocket.Chat,bopjesvla/chatmafia,alenodari/Rocket.Chat,Deepakkothandan/Rocket.Chat,ut7/Rocket.Chat,christmo/Rocket.Chat,TribeMedia/Rocket.Chat,pachox/Rocket.Chat,inoxth/Rocket.Chat,BHWD/noouchat,kkochubey1/Rocket.Chat,mccambridge/Rocket.Chat,mohamedhagag/Rocket.Chat,xasx/Rocket.Chat,pachox/Rocket.Chat,Kiran-Rao/Rocket.Chat,jyx140521/Rocket.Chat,timkinnane/Rocket.Chat,LearnersGuild/echo-chat,nishimaki10/Rocket.Chat,revspringjake/Rocket.Chat,pitamar/Rocket.Chat,mhurwi/Rocket.Chat,Gyubin/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,Kiran-Rao/Rocket.Chat,rasata/Rocket.Chat,flaviogrossi/Rocket.Chat,pachox/Rocket.Chat,gitaboard/Rocket.Chat,karlprieb/Rocket.Chat,galrotem1993/Rocket.Chat,fatihwk/Rocket.Chat,KyawNaingTun/Rocket.Chat,acaronmd/Rocket.Chat,wtsarchive/Rocket.Chat,pitamar/Rocket.Chat,anhld/Rocket.Chat,Flitterkill/Rocket.Chat,ziedmahdi/Rocket.Chat,klatys/Rocket.Chat,jadeqwang/Rocket.Chat,marzieh312/Rocket.Chat,leohmoraes/Rocket.Chat,erikmaarten/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,capensisma/Rocket.Chat,acidsound/Rocket.Chat,Ninotna/Rocket.Chat,bopjesvla/chatmafia,sikofitt/Rocket.Chat,warcode/Rocket.Chat,icaromh/Rocket.Chat,Dianoga/Rocket.Chat,slava-sh/Rocket.Chat,flaviogrossi/Rocket.Chat,JisuPark/Rocket.Chat,jyx140521/Rocket.Chat,Sing-Li/Rocket.Chat,Achaikos/Rocket.Chat,4thParty/Rocket.Chat,katopz/Rocket.Chat,fduraibi/Rocket.Chat,JisuPark/Rocket.Chat,haoyixin/Rocket.Chat,lukaroski/traden,nabiltntn/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,cdwv/Rocket.Chat,NMandapaty/Rocket.Chat,yuyixg/Rocket.Chat,ZBoxApp/Rocket.Chat,jeann2013/Rocket.Chat,ederribeiro/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,coreyaus/Rocket.Chat,ut7/Rocket.Chat,JamesHGreen/Rocket_API,LeonardOliveros/Rocket.Chat,lonbaker/Rocket.Chat,erikmaarten/Rocket.Chat,gitaboard/Rocket.Chat,snaiperskaya96/Rocket.Chat,christmo/Rocket.Chat,ndarilek/Rocket.Chat,nishimaki10/Rocket.Chat,Ninotna/Rocket.Chat,williamfortunademoraes/Rocket.Chat,ludiculous/Rocket.Chat,ahmadassaf/Rocket.Chat,Maysora/Rocket.Chat,JisuPark/Rocket.Chat,umeshrs/rocket-chat,ahmadassaf/Rocket.Chat,j-ew-s/Rocket.Chat,bopjesvla/chatmafia,Sing-Li/Rocket.Chat,erikmaarten/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,haoyixin/Rocket.Chat,igorstajic/Rocket.Chat,4thParty/Rocket.Chat,xboston/Rocket.Chat,pitamar/Rocket.Chat,acidicX/Rocket.Chat,freakynit/Rocket.Chat,wicked539/Rocket.Chat,lonbaker/Rocket.Chat,himeshp/Rocket.Chat,matthewshirley/Rocket.Chat,Movile/Rocket.Chat,AimenJoe/Rocket.Chat,alenodari/Rocket.Chat,fatihwk/Rocket.Chat,klatys/Rocket.Chat,marzieh312/Rocket.Chat,leohmoraes/Rocket.Chat,wtsarchive/Rocket.Chat,warcode/Rocket.Chat,ziedmahdi/Rocket.Chat,uniteddiversity/Rocket.Chat,ludiculous/Rocket.Chat,AimenJoe/Rocket.Chat,mhurwi/Rocket.Chat,ndarilek/Rocket.Chat,matthewshirley/Rocket.Chat,cdwv/Rocket.Chat,galrotem1993/Rocket.Chat,NMandapaty/Rocket.Chat,intelradoux/Rocket.Chat,ggazzo/Rocket.Chat,bt/Rocket.Chat,bt/Rocket.Chat,ludiculous/Rocket.Chat,slava-sh/Rocket.Chat,inoxth/Rocket.Chat,biomassives/Rocket.Chat,jonathanhartman/Rocket.Chat,steedos/chat,ZBoxApp/Rocket.Chat,tntobias/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,igorstajic/Rocket.Chat,k0nsl/Rocket.Chat,soonahn/Rocket.Chat,sikofitt/Rocket.Chat,LeonardOliveros/Rocket.Chat,psadaic/Rocket.Chat,Ninotna/Rocket.Chat,ZBoxApp/Rocket.Chat,jessedhillon/Rocket.Chat,marzieh312/Rocket.Chat,abhishekshukla0302/trico,himeshp/Rocket.Chat,qnib/Rocket.Chat,williamfortunademoraes/Rocket.Chat,jonathanhartman/Rocket.Chat,inoxth/Rocket.Chat,rasata/Rocket.Chat,Codebrahma/Rocket.Chat,danielbressan/Rocket.Chat,tlongren/Rocket.Chat,Gudii/Rocket.Chat,jonathanhartman/Rocket.Chat,abduljanjua/TheHub,florinnichifiriuc/Rocket.Chat,Dianoga/Rocket.Chat,tradetiger/Rocket.Chat,karlprieb/Rocket.Chat,HeapCity/Heap.City,klatys/Rocket.Chat,tntobias/Rocket.Chat,wangleihd/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,pkgodara/Rocket.Chat,lucasgolino/Rocket.Chat,litewhatever/Rocket.Chat,phlkchan/Rocket.Chat,adamteece/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,Kiran-Rao/Rocket.Chat,umeshrs/rocket-chat-integration,acaronmd/Rocket.Chat,igorstajic/Rocket.Chat,ziedmahdi/Rocket.Chat,acidicX/Rocket.Chat,mwharrison/Rocket.Chat,soonahn/Rocket.Chat,atyenoria/Rocket.Chat,KyawNaingTun/Rocket.Chat,BorntraegerMarc/Rocket.Chat,AlecTroemel/Rocket.Chat,steedos/chat,Gudii/Rocket.Chat,mrinaldhar/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,liuliming2008/Rocket.Chat,Codebrahma/Rocket.Chat,tntobias/Rocket.Chat,mccambridge/Rocket.Chat,revspringjake/Rocket.Chat,LearnersGuild/Rocket.Chat,madmanteam/Rocket.Chat,umeshrs/rocket-chat-integration,parkmap/Rocket.Chat,AlecTroemel/Rocket.Chat,wangleihd/Rocket.Chat,nabiltntn/Rocket.Chat,ziedmahdi/Rocket.Chat,phlkchan/Rocket.Chat,freakynit/Rocket.Chat,Achaikos/Rocket.Chat,ealbers/Rocket.Chat,TribeMedia/Rocket.Chat,LearnersGuild/echo-chat,ahmadassaf/Rocket.Chat,tntobias/Rocket.Chat,sscpac/chat-locker,tzellman/Rocket.Chat,timkinnane/Rocket.Chat,alexbrazier/Rocket.Chat,TribeMedia/Rocket.Chat,fatihwk/Rocket.Chat,HeapCity/Heap.City,mwharrison/Rocket.Chat,Jandersoft/Rocket.Chat,igorstajic/Rocket.Chat,freakynit/Rocket.Chat,mrinaldhar/Rocket.Chat,LearnersGuild/Rocket.Chat,OtkurBiz/Rocket.Chat,tlongren/Rocket.Chat,mrsimpson/Rocket.Chat,mohamedhagag/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,mwharrison/Rocket.Chat,bt/Rocket.Chat,abduljanjua/TheHub,amaapp/ama,leohmoraes/Rocket.Chat,mrsimpson/Rocket.Chat,sargentsurg/Rocket.Chat,org100h1/Rocket.Panda,j-ew-s/Rocket.Chat,tzellman/Rocket.Chat,wtsarchive/Rocket.Chat,jessedhillon/Rocket.Chat,OtkurBiz/Rocket.Chat,mhurwi/Rocket.Chat,berndsi/Rocket.Chat,JamesHGreen/Rocket.Chat,capensisma/Rocket.Chat,haoyixin/Rocket.Chat,himeshp/Rocket.Chat,kkochubey1/Rocket.Chat,mitar/Rocket.Chat,apnero/tactixteam,yuyixg/Rocket.Chat,ut7/Rocket.Chat,lucasgolino/Rocket.Chat,nrhubbar/Rocket.Chat,katopz/Rocket.Chat,Jandersolutions/Rocket.Chat,JamesHGreen/Rocket_API,JamesHGreen/Rocket.Chat,parkmap/Rocket.Chat,mwharrison/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,tzellman/Rocket.Chat,litewhatever/Rocket.Chat,k0nsl/Rocket.Chat,mrsimpson/Rocket.Chat,coreyaus/Rocket.Chat,sunhaolin/Rocket.Chat,abhishekshukla0302/trico,fduraibi/Rocket.Chat,Jandersoft/Rocket.Chat,apnero/tactixteam,fduraibi/Rocket.Chat,Achaikos/Rocket.Chat,org100h1/Rocket.Panda,celloudiallo/Rocket.Chat,ederribeiro/Rocket.Chat,alenodari/Rocket.Chat,snaiperskaya96/Rocket.Chat,liuliming2008/Rocket.Chat,cdwv/Rocket.Chat,Movile/Rocket.Chat,jadeqwang/Rocket.Chat,PavelVanecek/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,ederribeiro/Rocket.Chat,cdwv/Rocket.Chat,jessedhillon/Rocket.Chat,ndarilek/Rocket.Chat,linnovate/hi,ggazzo/Rocket.Chat,ndarilek/Rocket.Chat,flaviogrossi/Rocket.Chat,VoiSmart/Rocket.Chat,subesokun/Rocket.Chat,OtkurBiz/Rocket.Chat,yuyixg/Rocket.Chat,jeann2013/Rocket.Chat,Dianoga/Rocket.Chat,cnash/Rocket.Chat,mhurwi/Rocket.Chat,ggazzo/Rocket.Chat,4thParty/Rocket.Chat,intelradoux/Rocket.Chat,mohamedhagag/Rocket.Chat,uniteddiversity/Rocket.Chat,webcoding/Rocket.Chat,psadaic/Rocket.Chat,qnib/Rocket.Chat,alexbrazier/Rocket.Chat,glnarayanan/Rocket.Chat,inoxth/Rocket.Chat,acidicX/Rocket.Chat,wtsarchive/Rocket.Chat,jbsavoy18/rocketchat-1,karlprieb/Rocket.Chat,anhld/Rocket.Chat,liemqv/Rocket.Chat,VoiSmart/Rocket.Chat,k0nsl/Rocket.Chat,mitar/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,galrotem1993/Rocket.Chat,steedos/chat,biomassives/Rocket.Chat,liemqv/Rocket.Chat,pitamar/Rocket.Chat,xasx/Rocket.Chat,tradetiger/Rocket.Chat,klatys/Rocket.Chat,org100h1/Rocket.Panda,mrsimpson/Rocket.Chat,VoiSmart/Rocket.Chat,Sing-Li/Rocket.Chat,florinnichifiriuc/Rocket.Chat,I-am-Gabi/Rocket.Chat,TribeMedia/Rocket.Chat,madmanteam/Rocket.Chat,gitaboard/Rocket.Chat,jbsavoy18/rocketchat-1,Deepakkothandan/Rocket.Chat,4thParty/Rocket.Chat,amaapp/ama,nrhubbar/Rocket.Chat,mrinaldhar/Rocket.Chat,danielbressan/Rocket.Chat,karlprieb/Rocket.Chat,org100h1/Rocket.Panda,xasx/Rocket.Chat,NMandapaty/Rocket.Chat,ut7/Rocket.Chat,alexbrazier/Rocket.Chat,marzieh312/Rocket.Chat,qnib/Rocket.Chat,jeanmatheussouto/Rocket.Chat,sikofitt/Rocket.Chat,thunderrabbit/Rocket.Chat,subesokun/Rocket.Chat,nathantreid/Rocket.Chat,sscpac/chat-locker,Dianoga/Rocket.Chat,snaiperskaya96/Rocket.Chat,Gudii/Rocket.Chat,biomassives/Rocket.Chat,jonathanhartman/Rocket.Chat,liuliming2008/Rocket.Chat,JamesHGreen/Rocket.Chat,xboston/Rocket.Chat,HeapCity/Heap.City,Gyubin/Rocket.Chat,ahmadassaf/Rocket.Chat,acidsound/Rocket.Chat,Maysora/Rocket.Chat,yuyixg/Rocket.Chat,intelradoux/Rocket.Chat,berndsi/Rocket.Chat,ealbers/Rocket.Chat,nathantreid/Rocket.Chat,Kiran-Rao/Rocket.Chat,Codebrahma/Rocket.Chat,acidsound/Rocket.Chat,haoyixin/Rocket.Chat,BorntraegerMarc/Rocket.Chat,OtkurBiz/Rocket.Chat,nrhubbar/Rocket.Chat,lukaroski/traden,snaiperskaya96/Rocket.Chat,AimenJoe/Rocket.Chat,jeanmatheussouto/Rocket.Chat,mitar/Rocket.Chat,pkgodara/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,umeshrs/rocket-chat,LearnersGuild/echo-chat,jyx140521/Rocket.Chat,wicked539/Rocket.Chat,j-ew-s/Rocket.Chat,atyenoria/Rocket.Chat,LeonardOliveros/Rocket.Chat,webcoding/Rocket.Chat,nishimaki10/Rocket.Chat,bt/Rocket.Chat,Movile/Rocket.Chat,abhishekshukla0302/trico,thunderrabbit/Rocket.Chat,Movile/Rocket.Chat,psadaic/Rocket.Chat,xboston/Rocket.Chat,florinnichifiriuc/Rocket.Chat,timkinnane/Rocket.Chat,nishimaki10/Rocket.Chat,tradetiger/Rocket.Chat,LearnersGuild/echo-chat,nabiltntn/Rocket.Chat,LeonardOliveros/Rocket.Chat,umeshrs/rocket-chat,capensisma/Rocket.Chat,anhld/Rocket.Chat,ealbers/Rocket.Chat,sargentsurg/Rocket.Chat,Flitterkill/Rocket.Chat,PavelVanecek/Rocket.Chat,mccambridge/Rocket.Chat,soonahn/Rocket.Chat,qnib/Rocket.Chat,abhishekshukla0302/trico,intelradoux/Rocket.Chat,cnash/Rocket.Chat,lucasgolino/Rocket.Chat,pkgodara/Rocket.Chat,matthewshirley/Rocket.Chat,wicked539/Rocket.Chat,glnarayanan/Rocket.Chat,inoio/Rocket.Chat,I-am-Gabi/Rocket.Chat,ggazzo/Rocket.Chat,Gyubin/Rocket.Chat,AlecTroemel/Rocket.Chat,Flitterkill/Rocket.Chat,celloudiallo/Rocket.Chat,ealbers/Rocket.Chat,madmanteam/Rocket.Chat,cnash/Rocket.Chat,Jandersoft/Rocket.Chat,phlkchan/Rocket.Chat,jeanmatheussouto/Rocket.Chat,galrotem1993/Rocket.Chat,warcode/Rocket.Chat,wicked539/Rocket.Chat,arvi/Rocket.Chat,alexbrazier/Rocket.Chat,Jandersolutions/Rocket.Chat,Deepakkothandan/Rocket.Chat,arvi/Rocket.Chat,pachox/Rocket.Chat,mrinaldhar/Rocket.Chat,mitar/Rocket.Chat,JamesHGreen/Rocket_API,wangleihd/Rocket.Chat,callmekatootie/Rocket.Chat,uniteddiversity/Rocket.Chat,tlongren/Rocket.Chat,jadeqwang/Rocket.Chat,sunhaolin/Rocket.Chat,sscpac/chat-locker,matthewshirley/Rocket.Chat,subesokun/Rocket.Chat
7c85af7b278a44d17322bf9f063d2b65d440cc91
index.coffee
index.coffee
fs = require 'fs' path = require 'path' module.exports = (robot, scripts) -> scriptsPath = path.resolve(__dirname, 'src') fs.exists scriptsPath, (exists) -> if exists for script in fs.readdirSync(scriptsPath) if scripts? and '*' not in scripts robot.loadFile(scriptsPath, script) if script in scripts else robot.loadFile(scriptsPath, script)
fs = require 'fs' path = require 'path' module.exports = (robot, scripts) -> scriptsPath = path.resolve(__dirname, 'src') if fs.existsSync scriptsPath for script in fs.readdirSync(scriptsPath).sort() if scripts? and '*' not in scripts robot.loadFile(scriptsPath, script) if script in scripts else robot.loadFile(scriptsPath, script)
Load / run scripts synchronously
Load / run scripts synchronously
CoffeeScript
mit
ClaudeBot/hubot-ab,ClaudeBot/hubot-ab
7de93feed03cdf65da7672a470623ddb666cf17e
keymaps/foldingtext-markdown.cson
keymaps/foldingtext-markdown.cson
'ft-outline-editor': 'ctrl-cmd-c': 'foldingtext-markdown:copy-markdown' 'ctrl-cmd-v': 'foldingtext-markdown:paste-markdown' 'ft-outline-editor.outlineMode': 't p': 'foldingtext-markdown:make-paragraph' 't h': 'foldingtext-markdown:make-header' 't c': 'foldingtext-markdown:make-code-block' 't q': 'foldingtext-markdown:make-block-quote' 't o': 'foldingtext-markdown:make-ordered-list' 't u': 'foldingtext-markdown:make-bullet-list'
'ft-outline-editor': 'ctrl-cmd-c': 'foldingtext-markdown:copy-markdown' 'ctrl-cmd-v': 'foldingtext-markdown:paste-markdown' 'ft-outline-editor.outlineMode': 'm p': 'foldingtext-markdown:make-paragraph' 'm h': 'foldingtext-markdown:make-header' 'm c': 'foldingtext-markdown:make-code-block' 'm q': 'foldingtext-markdown:make-block-quote' 'm o': 'foldingtext-markdown:make-ordered-list' 'm u': 'foldingtext-markdown:make-bullet-list'
Change set markdown type shortcuts to start with 'm'
Change set markdown type shortcuts to start with 'm'
CoffeeScript
mit
FoldingText/foldingtext-markdown
0fa65999244cea8a768d673d1fbcc0163baab09c
grunt/tasks/test.coffee
grunt/tasks/test.coffee
module.exports = (grunt)-> _ = grunt.util._ init_config = grunt.config() # mocha mocha_requires = [ "coffee-script" "should" "requirejs" "underscore" "backbone" "jquery" ] mocha_requires.push "./spec/spec_helper.coffee" if require("fs").existsSync("./spec/spec_helper.coffee") _(init_config).extend mochaTest: spec: options: reporter: "tap" require: mocha_requires src: [ "./spec/src/coffee/**/*_spec.coffee" ] # apply config grunt.initConfig init_config # load tasks pkg = grunt.file.readJSON 'package.json' for task of pkg.devDependencies when /^grunt-/.test task grunt.loadNpmTasks task # test grunt.registerTask( "test" [ "mochaTest:spec" ] )
module.exports = (grunt)-> _ = grunt.util._ init_config = grunt.config() # mocha mocha_requires = [ "coffee-script" "should" "requirejs" "underscore" "backbone" "jquery" ] mocha_requires.push "./spec/spec_helper.coffee" if require("fs").existsSync("./spec/spec_helper.coffee") _(init_config).extend mochaTest: spec: options: reporter: "spec" colors: false require: mocha_requires src: [ "./spec/src/coffee/**/*_spec.coffee" ] # apply config grunt.initConfig init_config # load tasks pkg = grunt.file.readJSON 'package.json' for task of pkg.devDependencies when /^grunt-/.test task grunt.loadNpmTasks task # test grunt.registerTask( "test" [ "mochaTest:spec" ] )
Change mocha options: tap -> spec, colors = false
Change mocha options: tap -> spec, colors = false
CoffeeScript
mit
sh19910711/github-issues-label-manager,sh19910711/github-issues-label-manager,sh19910711/github-issues-label-manager
3249407464e8b06280e387623da6641c3c0595ff
lib/fs-util.coffee
lib/fs-util.coffee
path = require 'path' {File} = require 'atom' module.exports = toExt: (srcPath, ext) -> srcExt = path.extname srcPath return path.join( path.dirname(srcPath), "#{path.basename(srcPath, srcExt)}.#{ext}" ) resolvePath: (srcPath) -> destination = atom.config.get('coffee-compile.destination') or '.' flatten = atom.config.get('coffee-compile.flatten') cwd = atom.config.get('coffee-compile.cwd') or '.' [projectPath, relativePath] = atom.project.relativizePath(srcPath) # Remove all path parts if flatten relativePath = path.basename relativePath relativePath = path.relative cwd, relativePath return path.join projectPath, destination, relativePath writeFile: (filename, data) -> file = new File(filename) file.create().then -> file.write data isPathInSrc: (srcPath) -> source = atom.config.get('coffee-compile.source') or ['.'] cwd = atom.config.get('coffee-compile.cwd') or '.' [projectPath, relativePath] = atom.project.relativizePath(srcPath) return false unless !!projectPath source.some (folderPath) -> fullFolderPath = path.join projectPath, cwd, folderPath relative = path.relative srcPath, fullFolderPath return relative isnt "" and !/\w+/.test(relative)
path = require 'path' {File} = require 'atom' module.exports = toExt: (srcPath, ext) -> srcExt = path.extname srcPath return path.join( path.dirname(srcPath), "#{path.basename(srcPath, srcExt)}.#{ext}" ) resolvePath: (srcPath) -> destination = atom.config.get('coffee-compile.destination') or '.' flatten = atom.config.get('coffee-compile.flatten') cwd = atom.config.get('coffee-compile.cwd') or '.' [projectPath, relativePath] = atom.project.relativizePath(srcPath) # Remove all path parts if flatten relativePath = path.basename relativePath relativePath = path.relative cwd, relativePath return path.join projectPath, destination, relativePath writeFile: (filename, data) -> file = new File(filename) file.create().then -> file.write data isPathInSrc: (srcPath) -> source = atom.config.get('coffee-compile.source') or ['.'] cwd = atom.config.get('coffee-compile.cwd') or '.' [projectPath, relativePath] = atom.project.relativizePath(srcPath) return false unless !!projectPath source.some (folderPath) -> # if for some reason projectPath, cwd or folderPath aren't strings if typeof projectPath isnt 'string' or typeof cwd isnt 'string' or typeof folderPath isnt 'string' return false fullFolderPath = path.join projectPath, cwd, folderPath relative = path.relative srcPath, fullFolderPath return relative isnt "" and !/\w+/.test(relative)
Make sure all variables are string before joining
Make sure all variables are string before joining
CoffeeScript
mit
adrianlee44/atom-coffee-compile
6667520d70c8d1f1fe57f0acecc12515ca86d8bb
examples/hello-server/app.coffee
examples/hello-server/app.coffee
express = require "express" jsdom = require("jsdom").jsdom $ = require "jquery" transparency = require "transparency" # Register transparency as a plugin for the given jQuery instance transparency.register $ app = express.createServer() app.configure -> app.use app.router app.configure "development", -> app.use express.errorHandler( dumpExceptions: true showStack: true ) app.get "/", (req, res) -> data = [ title: "Hello" , title: "Howdy" , title: "Cheers" , title: "Byebye" ] ### templating with jsdom - uncomment to use doc = jsdom """ <div id="templates"> <!-- Items template --> <ul id="items"> <li class="title"></li> </ul> <!-- Person template --> <div class="person"> <div class="name"></div> <div class="email"></div> </div> </div> """ template = doc.getElementById "items" result = transparency.render template, data res.send template.outerHTML ### # templating with jQuery - remove if using jsdom template = $ """ <ul id="items"> <li class="title"></li> </ul> """ result = template.render data res.send template[0].outerHTML app.listen 3000 console.log "Express server listening on port %d in %s mode", app.address().port, app.settings.env
express = require "express" jsdom = require("jsdom").jsdom $ = require "jquery" transparency = require "transparency" # Register transparency as a plugin for the given jQuery instance transparency.register $ app = express() app.configure -> app.use app.router app.configure "development", -> app.use express.errorHandler( dumpExceptions: true showStack: true ) app.get "/", (req, res) -> data = [ title: "Hello" , title: "Howdy" , title: "Cheers" , title: "Byebye" ] ### templating with jsdom - uncomment to use doc = jsdom """ <div id="templates"> <!-- Items template --> <ul id="items"> <li class="title"></li> </ul> <!-- Person template --> <div class="person"> <div class="name"></div> <div class="email"></div> </div> </div> """ template = doc.getElementById "items" result = transparency.render template, data res.send template.outerHTML ### # templating with jQuery - remove if using jsdom template = $ """ <ul id="items"> <li class="title"></li> </ul> """ result = template.render data res.send template[0].outerHTML app.listen 3000 console.log "Express server listening on port 3000 in %s mode", app.settings.env
Update server example to work with latest Express
Update server example to work with latest Express
CoffeeScript
mit
leonidas/transparency,chorks/transparency,laomu1988/transparency,chorks/transparency,cravelight/transparency,leonidas/transparency,phcomputer/template,laomu1988/transparency,phcomputer/template,cravelight/transparency
4859997191dda5b40e7bbf817248956110636814
lib/common-utils.coffee
lib/common-utils.coffee
debug = require('debug')('sphere-product-import-common-utils') _ = require 'underscore' _.mixin require 'underscore-mixins' class CommonUtils constructor: (@logger) -> debug "Enum Validator initialized." uniqueObjectFilter: (objCollection) => uniques = [] _.each objCollection, (obj) => if not @isObjectPresentInArray(uniques, obj) then uniques.push(obj) uniques isObjectPresentInArray: (array, object) -> present = false _.each array, (element) -> if _.isEqual(object, element) present = true present module.exports = CommonUtils
debug = require('debug')('sphere-product-import-common-utils') _ = require 'underscore' _.mixin require 'underscore-mixins' class CommonUtils constructor: (@logger) -> debug "Enum Validator initialized." uniqueObjectFilter: (objCollection) => uniques = [] _.each objCollection, (obj) => if not @isObjectPresentInArray(uniques, obj) then uniques.push(obj) uniques isObjectPresentInArray: (array, object) -> _.find array, (element) -> _.isEqual(element, object) module.exports = CommonUtils
Update -> method to use _.find.
Update -> method to use _.find.
CoffeeScript
mit
sphereio/sphere-product-import
8e6a78741f1169eeadc6d2d169a39dce6447a735
jobs/index.coffee
jobs/index.coffee
# Copyright 2013 Matt Farmer # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module.exports = (jobs) -> require('./scrape-sessions')(jobs) require('./scrape-vote-list')(jobs) jobs.process 'poll', (job, done) -> # Queue up jobs that should run on each poll. jobs.create('scrape sessions').save() jobs.create('scrape people').save() #jobs.create('scrape committees').save() #jobs.create('scrape legislation').save() #jobs.create('scrape votes').save() # Schedule the next poll. # todo done() # Create initial poll jobs.create('poll').save()
# Copyright 2013 Matt Farmer # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module.exports = (jobs) -> require('./scrape-sessions')(jobs) require('./scrape-vote-list')(jobs) jobs.process 'poll', (job, done) -> # Queue up jobs that should run on each poll. jobs.create('scrape sessions').save() jobs.create('scrape representatives').save() #jobs.create('scrape committees').save() #jobs.create('scrape legislation').save() #jobs.create('scrape votes').save() # Schedule the next poll. # todo done() # Create initial poll jobs.create('poll').save()
Convert job init from "scrape people" to "scrape rep.."
Convert job init from "scrape people" to "scrape rep.."
CoffeeScript
agpl-3.0
gaodp/gga-api,gaodp/gga-api
28352be72946015f3c91a8354db528a1eca440ca
app/assets/javascripts/admin/order_cycles/controllers/simple.js.coffee
app/assets/javascripts/admin/order_cycles/controllers/simple.js.coffee
angular.module('admin.order_cycles').controller "AdminSimpleCreateOrderCycleCtrl", ($scope, OrderCycle, Enterprise, EnterpriseFee) -> $scope.enterprises = Enterprise.index (enterprises) => enterprise = enterprises[Object.keys(enterprises)[0]] OrderCycle.addSupplier enterprise.id OrderCycle.addDistributor enterprise.id OrderCycle.setExchangeVariants(OrderCycle.order_cycle.incoming_exchanges[0], Enterprise.suppliedVariants(enterprise.id), true) OrderCycle.order_cycle.coordinator_id = enterprise.id $scope.enterprise_fees = EnterpriseFee.index() $scope.order_cycle = OrderCycle.order_cycle $scope.loaded = -> Enterprise.loaded && EnterpriseFee.loaded $scope.removeDistributionOfVariant = angular.noop $scope.addCoordinatorFee = ($event) -> $event.preventDefault() OrderCycle.addCoordinatorFee() $scope.enterpriseFeesForEnterprise = (enterprise_id) -> EnterpriseFee.forEnterprise(parseInt(enterprise_id)) $scope.submit = -> OrderCycle.mirrorIncomingToOutgoingProducts() OrderCycle.create()
angular.module('admin.order_cycles').controller "AdminSimpleCreateOrderCycleCtrl", ($scope, OrderCycle, Enterprise, EnterpriseFee) -> $scope.enterprises = Enterprise.index (enterprises) => enterprise = enterprises[Object.keys(enterprises)[0]] OrderCycle.addSupplier enterprise.id OrderCycle.addDistributor enterprise.id $scope.outgoing_exchange = OrderCycle.order_cycle.outgoing_exchanges[0] OrderCycle.setExchangeVariants(OrderCycle.order_cycle.incoming_exchanges[0], Enterprise.suppliedVariants(enterprise.id), true) OrderCycle.order_cycle.coordinator_id = enterprise.id $scope.enterprise_fees = EnterpriseFee.index() $scope.order_cycle = OrderCycle.order_cycle $scope.loaded = -> Enterprise.loaded && EnterpriseFee.loaded $scope.removeDistributionOfVariant = angular.noop $scope.addCoordinatorFee = ($event) -> $event.preventDefault() OrderCycle.addCoordinatorFee() $scope.enterpriseFeesForEnterprise = (enterprise_id) -> EnterpriseFee.forEnterprise(parseInt(enterprise_id)) $scope.submit = -> OrderCycle.mirrorIncomingToOutgoingProducts() OrderCycle.create()
Save pickup time and instructions
Save pickup time and instructions
CoffeeScript
agpl-3.0
levent/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,Em-AK/openfoodnetwork,Matt-Yorkley/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,MikeiLL/openfoodnetwork,lin-d-hop/openfoodnetwork,RohanM/openfoodnetwork,oeoeaio/openfoodnetwork,folklabs/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,ltrls/openfoodnetwork,oeoeaio/openfoodnetwork,openfoodfoundation/openfoodnetwork,MikeiLL/openfoodnetwork,levent/openfoodnetwork,KateDavis/openfoodnetwork,ltrls/openfoodnetwork,Matt-Yorkley/openfoodnetwork,MikeiLL/openfoodnetwork,ltrls/openfoodnetwork,MikeiLL/openfoodnetwork,folklabs/openfoodnetwork,mkllnk/openfoodnetwork,levent/openfoodnetwork,lin-d-hop/openfoodnetwork,stveep/openfoodnetwork,folklabs/openfoodnetwork,mkllnk/openfoodnetwork,ecocitycore/openfoodnetwork,RohanM/openfoodnetwork,oeoeaio/openfoodnetwork,levent/openfoodnetwork,ecocitycore/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,stveep/openfoodnetwork,mkllnk/openfoodnetwork,oeoeaio/openfoodnetwork,RohanM/openfoodnetwork,KateDavis/openfoodnetwork,Em-AK/openfoodnetwork,folklabs/openfoodnetwork,ecocitycore/openfoodnetwork,Em-AK/openfoodnetwork,RohanM/openfoodnetwork,Matt-Yorkley/openfoodnetwork,ecocitycore/openfoodnetwork,openfoodfoundation/openfoodnetwork,KateDavis/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,stveep/openfoodnetwork,Em-AK/openfoodnetwork,ltrls/openfoodnetwork,stveep/openfoodnetwork,KateDavis/openfoodnetwork
9401a2a7e60eee946aff65ba0918f63e0f804333
assets/javascripts/evaluator/structure_identifier.coffee
assets/javascripts/evaluator/structure_identifier.coffee
V = Visualizer identifyObservable = R.curryN 2, (baseId, observable) -> rootId = baseId + 'r' recursionLevel = (rootId.match(/r/g) || []).length - 1 observable.root.args ?= V.Roots[observable.root.type].getDefaultArgs?(recursionLevel) root: R.assoc('id', rootId, R.pick(['type', 'args'], observable.root)) operators: R.mapIndexed(identifyOperator(rootId)(recursionLevel), observable.operators) identifyOperator = R.curryN 4, (rootId, recursionLevel, operator, index) -> id = rootId + Array(index + 2).join("o") definition = V.Operators[operator.type] args = operator.args? && operator.args || definition.getDefaultArgs?(recursionLevel) newOperator = R.mixin(R.pick(['type'], operator), id: id, args: args, recursionType: definition.recursionType) if V.Operators[operator.type].getDefaultObservable observable = operator.observable || definition.getDefaultObservable(recursionLevel) R.mixin newOperator, observable: identifyObservable(id)(observable) else newOperator V.identifyStructure = identifyObservable('')
V = Visualizer identifyObservable = R.curryN 2, (baseId, observable) -> rootId = baseId + 'r' recursionLevel = (rootId.match(/r/g) || []).length - 1 if !observable.root.args? observable.root.args = V.Roots[observable.root.type].getDefaultArgs?(recursionLevel) root: R.assoc('id', rootId, R.pick(['type', 'args'], observable.root)) operators: R.mapIndexed(identifyOperator(rootId)(recursionLevel), observable.operators) identifyOperator = R.curryN 4, (rootId, recursionLevel, operator, index) -> id = rootId + Array(index + 2).join("o") definition = V.Operators[operator.type] if !operator.args? operator.args = definition.getDefaultArgs?(recursionLevel) newOperator = R.mixin(R.pick(['type', 'args'], operator), id: id, recursionType: definition.recursionType) if V.Operators[operator.type].getDefaultObservable observable = operator.observable || definition.getDefaultObservable(recursionLevel) R.mixin newOperator, observable: identifyObservable(id)(observable) else newOperator V.identifyStructure = identifyObservable('')
Fix changing args to ''
Fix changing args to ''
CoffeeScript
mit
urmastalimaa/reactive-visualizer,urmastalimaa/reactive-visualizer,urmastalimaa/reactive-visualizer,urmastalimaa/reactive-visualizer
cc22690a04968db2b0b7cd6d2e2b6c7188f05561
lib/autoprefixer/selector.coffee
lib/autoprefixer/selector.coffee
Prefixer = require('./prefixer') utils = require('./utils') class Selector extends Prefixer # Is rule selectors need to be prefixed check: (rule) -> rule.selector.indexOf(@name) != -1 # Clone and add prefixes for at-rule add: (rule, prefix) -> prefixed = @replace(rule.selector, prefix) return if rule.parent.some (i) -> i.selector == prefixed clone = rule.clone(selector: prefixed) rule.parent.insertBefore(rule, clone) # Return prefixed version of selector prefixed: (prefix) -> @name.replace(/^([^\w]*)/, '$1' + prefix) # Lazy loadRegExp for name regexp: -> @regexpCache ||= new RegExp(utils.escapeRegexp(@name), 'gi') # Replace selectors by prefixed one replace: (selector, prefix) -> selector.replace(@regexp(), @prefixed(prefix)) module.exports = Selector
Prefixer = require('./prefixer') utils = require('./utils') class Selector extends Prefixer # Is rule selectors need to be prefixed check: (rule) -> rule.selector.indexOf(@name) != -1 # Return prefixed version of selector prefixed: (prefix) -> @name.replace(/^([^\w]*)/, '$1' + prefix) # Lazy loadRegExp for name regexp: -> @regexpCache ||= new RegExp(utils.escapeRegexp(@name), 'gi') # Replace selectors by prefixed one replace: (selector, prefix) -> selector.replace(@regexp(), @prefixed(prefix)) # Clone and add prefixes for at-rule add: (rule, prefix) -> prefixed = @replace(rule.selector, prefix) return if rule.parent.some (i) -> i.selector == prefixed clone = rule.clone(selector: prefixed) rule.parent.insertBefore(rule, clone) module.exports = Selector
Clean up methods order in Selector prefixer
Clean up methods order in Selector prefixer
CoffeeScript
mit
danielmorosan/autoprefixer,edisplay/autoprefixer,pskrz/autoprefixer,wangyun122/autoprefixer,zigi74/autoprefixer,ya7lelkom/autoprefixer,iamvdo/autoprefixer-core,aidenzou/autoprefixer,rmondragon/autoprefixer,avanderhoorn/autoprefixer,cnbin/autoprefixer,NateBaldwinDesign/autoprefixer,lydell/autoprefixer,ocean90/autoprefixer,iorikiir/autoprefixer,cgvarela/autoprefixer,jeremykenedy/autoprefixer,evilemon/autoprefixer,rzhw/autoprefixer,evilebottnawi/autoprefixer-core,noikiy/autoprefixer-core,ai/autoprefixer-cli,yisibl/autoprefixer,SecureCloud-biz/autoprefixer,dantman/autoprefixer,cemoulto/autoprefixer,crobays/autoprefixer,postcss/autoprefixer
a3a6dde810283a5642c9e7551620b2664df2223a
app/assets/javascripts/components/todos/app.js.cjsx
app/assets/javascripts/components/todos/app.js.cjsx
TodoStore = require('./stores/todo_store') TodoActions = require('./actions/todo_actions') TodoApp = require('./components/TodoApp') # Invoked in a Rails template with JSON data passed in. React._initTodoApp = (options) -> # Instantiates the stores stores = TodoStore: new TodoStore(options["todos"]) # Actions actions = TodoActions # Instantiates the flux with the stores and actions flux = new Fluxxor.Flux(stores, actions) # Logging for the "dispatch" event flux.on 'dispatch', (type, payload) -> console.log "[Dispatch]", type, payload if console?.log? # Rendering the whole component to the mount node if (mountNode = document.getElementById("react_todolist")) React.render <TodoApp flux={ flux } />, mountNode
TodoStore = require('./stores/todo_store') TodoActions = require('./actions/todo_actions') TodoApp = require('./components/TodoApp') # Invoked in a Rails template with JSON data passed in. React._initTodoApp = (options) -> # Instantiates the stores stores = TodoStore: new TodoStore(options["todos"] if options) # Actions actions = TodoActions # Instantiates the flux with the stores and actions flux = new Fluxxor.Flux(stores, actions) # Logging for the "dispatch" event flux.on 'dispatch', (type, payload) -> console.log "[Dispatch]", type, payload if console?.log? # Rendering the whole component to the mount node if (mountNode = document.getElementById("react_todolist")) React.render <TodoApp flux={ flux } />, mountNode
Add null checking for option argument
Add null checking for option argument
CoffeeScript
mit
mnishiguchi/moving_estimator,mnishiguchi/moving_estimator,mnishiguchi/moving_estimator
d2f2af45f38635ffa4d715c2e594a0a6abd2401e
components/MarqueeBranding.cjsx
components/MarqueeBranding.cjsx
React = require 'react' module.exports = React.createClass displayName: 'MarqueeBranding' getDefaultProps: -> { source : global.config?.PUBLICATION_SHORT_NAME medium : 'MarqueeBranding' campaign : 'sdk_site' logo_only : false } render: -> link = 'http://marquee.by' if @props.source params = ['source','medium','campaign'].map (p) => "utm_#{ p }=#{ @props[p] }" link += "?#{ params.join('&') }" <a className = "MarqueeBranding #{ if @props.logo_only then '-logo_only' else ''}" href = link title = 'Marquee: easier, faster, more beautiful web publishing' > Made with Marquee </a>
React = require 'react' module.exports = React.createClass displayName: 'MarqueeBranding' getDefaultProps: -> { source : global.config?.PUBLICATION_SHORT_NAME medium : 'web' campaign : 'sdk_site' content : 'MarqueeBranding' logo_only : false } render: -> link = 'http://marquee.by' if @props.source params = ['source','medium','campaign','content'].map (p) => "utm_#{ p }=#{ @props[p] }" link += "?#{ params.join('&') }" <a className = "MarqueeBranding #{ if @props.logo_only then '-logo_only' else ''}" href = link title = 'Marquee: easier, faster, more beautiful web publishing' > Made with Marquee </a>
Correct UTM paremeters for branding element.
Correct UTM paremeters for branding element.
CoffeeScript
unlicense
marquee/static-sdk
827bab90bfa3877a8d9324e566c8b2b61a7d6ab6
src/app/null-grammar.coffee
src/app/null-grammar.coffee
Token = require 'token' EventEmitter = require 'event-emitter' _ = require 'underscore' ### Internal ### module.exports = class NullGrammar name: 'Null Grammar' scopeName: 'text.plain.null-grammar' getScore: -> 0 tokenizeLine: (line) -> { tokens: [new Token(value: line, scopes: ['null-grammar.text.plain'])] } grammarUpdated: -> # noop _.extend NullGrammar.prototype, EventEmitter
Token = require 'token' EventEmitter = require 'event-emitter' _ = require 'underscore' ### Internal ### module.exports = class NullGrammar name: 'Null Grammar' scopeName: 'text.plain.null-grammar' getScore: -> 0 tokenizeLine: (line) -> { tokens: [new Token(value: line, scopes: ['null-grammar.text.plain'])] } tokenizeLines: (text) -> lines = text.split('\n') for line, i in lines {tokens} = @tokenizeLine(line) tokens grammarUpdated: -> # noop _.extend NullGrammar.prototype, EventEmitter
Add tokenizeLines to null grammar
Add tokenizeLines to null grammar
CoffeeScript
mit
sekcheong/atom,wiggzz/atom,liuxiong332/atom,seedtigo/atom,john-kelly/atom,anuwat121/atom,sotayamashita/atom,lisonma/atom,NunoEdgarGub1/atom,SlimeQ/atom,sebmck/atom,Austen-G/BlockBuilder,CraZySacX/atom,burodepeper/atom,YunchengLiao/atom,johnrizzo1/atom,oggy/atom,dkfiresky/atom,yamhon/atom,bradgearon/atom,Jonekee/atom,KENJU/atom,amine7536/atom,AlbertoBarrago/atom,sillvan/atom,Jandersolutions/atom,AlexxNica/atom,russlescai/atom,hharchani/atom,splodingsocks/atom,transcranial/atom,alfredxing/atom,devmario/atom,bcoe/atom,Rodjana/atom,russlescai/atom,yomybaby/atom,BogusCurry/atom,dsandstrom/atom,davideg/atom,MjAbuz/atom,ardeshirj/atom,batjko/atom,russlescai/atom,Ju2ender/atom,rmartin/atom,kandros/atom,dannyflax/atom,ilovezy/atom,Jdesk/atom,omarhuanca/atom,targeter21/atom,mertkahyaoglu/atom,CraZySacX/atom,sillvan/atom,Mokolea/atom,Ju2ender/atom,prembasumatary/atom,johnhaley81/atom,batjko/atom,brumm/atom,Austen-G/BlockBuilder,john-kelly/atom,davideg/atom,rjattrill/atom,jtrose2/atom,Austen-G/BlockBuilder,kandros/atom,hpham04/atom,vhutheesing/atom,stuartquin/atom,jlord/atom,hagb4rd/atom,ilovezy/atom,toqz/atom,decaffeinate-examples/atom,rsvip/aTom,qiujuer/atom,devmario/atom,bencolon/atom,vinodpanicker/atom,kdheepak89/atom,avdg/atom,g2p/atom,codex8/atom,abe33/atom,fang-yufeng/atom,chengky/atom,tony612/atom,nucked/atom,rmartin/atom,seedtigo/atom,mnquintana/atom,decaffeinate-examples/atom,fscherwi/atom,AlbertoBarrago/atom,pengshp/atom,isghe/atom,xream/atom,Dennis1978/atom,fredericksilva/atom,scv119/atom,me-benni/atom,jeremyramin/atom,sebmck/atom,sillvan/atom,Jdesk/atom,Hasimir/atom,SlimeQ/atom,splodingsocks/atom,gontadu/atom,kaicataldo/atom,RobinTec/atom,abcP9110/atom,phord/atom,Jandersolutions/atom,daxlab/atom,Abdillah/atom,deoxilix/atom,sillvan/atom,fedorov/atom,execjosh/atom,jordanbtucker/atom,targeter21/atom,sillvan/atom,stinsonga/atom,BogusCurry/atom,rmartin/atom,gontadu/atom,ashneo76/atom,acontreras89/atom,Neron-X5/atom,niklabh/atom,andrewleverette/atom,vinodpanicker/atom,batjko/atom,matthewclendening/atom,mertkahyaoglu/atom,vcarrera/atom,lovesnow/atom,liuxiong332/atom,boomwaiza/atom,woss/atom,0x73/atom,alexandergmann/atom,RobinTec/atom,pengshp/atom,liuderchi/atom,hagb4rd/atom,atom/atom,qskycolor/atom,isghe/atom,tisu2tisu/atom,folpindo/atom,hpham04/atom,toqz/atom,tmunro/atom,ralphtheninja/atom,elkingtonmcb/atom,G-Baby/atom,Rychard/atom,fredericksilva/atom,deepfox/atom,0x73/atom,mrodalgaard/atom,anuwat121/atom,jtrose2/atom,splodingsocks/atom,chengky/atom,prembasumatary/atom,bencolon/atom,Rodjana/atom,charleswhchan/atom,Ingramz/atom,ivoadf/atom,deepfox/atom,constanzaurzua/atom,elkingtonmcb/atom,rsvip/aTom,amine7536/atom,chengky/atom,atom/atom,qskycolor/atom,FoldingText/atom,FIT-CSE2410-A-Bombs/atom,abe33/atom,dsandstrom/atom,harshdattani/atom,Sangaroonaom/atom,gisenberg/atom,jjz/atom,kdheepak89/atom,basarat/atom,paulcbetts/atom,KENJU/atom,hakatashi/atom,brumm/atom,darwin/atom,mnquintana/atom,hagb4rd/atom,abcP9110/atom,ali/atom,fedorov/atom,champagnez/atom,stinsonga/atom,me6iaton/atom,ezeoleaf/atom,Andrey-Pavlov/atom,DiogoXRP/atom,Jandersoft/atom,scv119/atom,basarat/atom,vcarrera/atom,AlisaKiatkongkumthon/atom,h0dgep0dge/atom,codex8/atom,fredericksilva/atom,chfritz/atom,rmartin/atom,gabrielPeart/atom,nucked/atom,Jdesk/atom,yangchenghu/atom,jlord/atom,medovob/atom,pkdevbox/atom,rjattrill/atom,john-kelly/atom,dannyflax/atom,kittens/atom,sebmck/atom,ardeshirj/atom,scippio/atom,bradgearon/atom,Huaraz2/atom,hharchani/atom,basarat/atom,synaptek/atom,amine7536/atom,RobinTec/atom,Huaraz2/atom,001szymon/atom,johnhaley81/atom,GHackAnonymous/atom,SlimeQ/atom,Arcanemagus/atom,amine7536/atom,MjAbuz/atom,g2p/atom,ralphtheninja/atom,liuxiong332/atom,kittens/atom,gisenberg/atom,h0dgep0dge/atom,pombredanne/atom,kjav/atom,pengshp/atom,vjeux/atom,nvoron23/atom,synaptek/atom,bryonwinger/atom,einarmagnus/atom,matthewclendening/atom,rlugojr/atom,hpham04/atom,yalexx/atom,vjeux/atom,palita01/atom,paulcbetts/atom,synaptek/atom,fscherwi/atom,ironbox360/atom,devmario/atom,Andrey-Pavlov/atom,sekcheong/atom,Jandersolutions/atom,ObviouslyGreen/atom,charleswhchan/atom,andrewleverette/atom,Austen-G/BlockBuilder,nvoron23/atom,Jandersoft/atom,GHackAnonymous/atom,targeter21/atom,CraZySacX/atom,jacekkopecky/atom,kjav/atom,GHackAnonymous/atom,AdrianVovk/substance-ide,Jdesk/atom,panuchart/atom,paulcbetts/atom,deoxilix/atom,vjeux/atom,acontreras89/atom,bryonwinger/atom,fang-yufeng/atom,florianb/atom,codex8/atom,florianb/atom,qiujuer/atom,ilovezy/atom,rxkit/atom,hakatashi/atom,mostafaeweda/atom,tony612/atom,liuxiong332/atom,rookie125/atom,liuderchi/atom,daxlab/atom,kevinrenaers/atom,Locke23rus/atom,abcP9110/atom,jeremyramin/atom,erikhakansson/atom,sebmck/atom,xream/atom,dkfiresky/atom,oggy/atom,Shekharrajak/atom,githubteacher/atom,Jandersolutions/atom,jlord/atom,vinodpanicker/atom,kdheepak89/atom,basarat/atom,YunchengLiao/atom,alfredxing/atom,me-benni/atom,dkfiresky/atom,Ingramz/atom,sxgao3001/atom,hagb4rd/atom,bcoe/atom,lovesnow/atom,Jdesk/atom,AlexxNica/atom,Klozz/atom,Hasimir/atom,einarmagnus/atom,matthewclendening/atom,kjav/atom,n-riesco/atom,matthewclendening/atom,lovesnow/atom,liuderchi/atom,rjattrill/atom,rmartin/atom,yalexx/atom,panuchart/atom,anuwat121/atom,yalexx/atom,Arcanemagus/atom,lpommers/atom,Abdillah/atom,AlisaKiatkongkumthon/atom,Neron-X5/atom,bcoe/atom,gisenberg/atom,toqz/atom,chengky/atom,devmario/atom,dsandstrom/atom,qskycolor/atom,niklabh/atom,mostafaeweda/atom,PKRoma/atom,batjko/atom,ReddTea/atom,KENJU/atom,rjattrill/atom,crazyquark/atom,Neron-X5/atom,GHackAnonymous/atom,constanzaurzua/atom,Dennis1978/atom,omarhuanca/atom,crazyquark/atom,vjeux/atom,sxgao3001/atom,svanharmelen/atom,efatsi/atom,DiogoXRP/atom,alexandergmann/atom,MjAbuz/atom,ali/atom,me-benni/atom,stuartquin/atom,scippio/atom,kc8wxm/atom,dijs/atom,ardeshirj/atom,Galactix/atom,Mokolea/atom,ashneo76/atom,oggy/atom,PKRoma/atom,codex8/atom,alfredxing/atom,Austen-G/BlockBuilder,tisu2tisu/atom,alexandergmann/atom,burodepeper/atom,scv119/atom,t9md/atom,hakatashi/atom,yangchenghu/atom,Shekharrajak/atom,dsandstrom/atom,Klozz/atom,devmario/atom,brumm/atom,ivoadf/atom,SlimeQ/atom,tjkr/atom,bolinfest/atom,rlugojr/atom,gzzhanghao/atom,FoldingText/atom,bryonwinger/atom,tanin47/atom,bj7/atom,crazyquark/atom,darwin/atom,jjz/atom,ykeisuke/atom,mnquintana/atom,hellendag/atom,tony612/atom,prembasumatary/atom,Ju2ender/atom,kdheepak89/atom,beni55/atom,ilovezy/atom,toqz/atom,einarmagnus/atom,YunchengLiao/atom,G-Baby/atom,scippio/atom,brettle/atom,ironbox360/atom,SlimeQ/atom,lisonma/atom,bcoe/atom,tony612/atom,constanzaurzua/atom,bj7/atom,Galactix/atom,folpindo/atom,mdumrauf/atom,KENJU/atom,mertkahyaoglu/atom,kc8wxm/atom,tisu2tisu/atom,erikhakansson/atom,Dennis1978/atom,kevinrenaers/atom,ppamorim/atom,execjosh/atom,harshdattani/atom,rxkit/atom,davideg/atom,brettle/atom,hharchani/atom,brettle/atom,oggy/atom,bcoe/atom,rookie125/atom,Jonekee/atom,Arcanemagus/atom,rsvip/aTom,YunchengLiao/atom,Sangaroonaom/atom,mdumrauf/atom,dijs/atom,sotayamashita/atom,kittens/atom,bj7/atom,Rychard/atom,KENJU/atom,basarat/atom,stuartquin/atom,AlbertoBarrago/atom,Galactix/atom,synaptek/atom,DiogoXRP/atom,FIT-CSE2410-A-Bombs/atom,kittens/atom,oggy/atom,Shekharrajak/atom,liuderchi/atom,FoldingText/atom,splodingsocks/atom,davideg/atom,jordanbtucker/atom,ezeoleaf/atom,russlescai/atom,qiujuer/atom,phord/atom,helber/atom,kdheepak89/atom,charleswhchan/atom,lovesnow/atom,charleswhchan/atom,jacekkopecky/atom,gisenberg/atom,bradgearon/atom,jjz/atom,elkingtonmcb/atom,Hasimir/atom,lovesnow/atom,stinsonga/atom,folpindo/atom,deepfox/atom,tjkr/atom,GHackAnonymous/atom,dijs/atom,AdrianVovk/substance-ide,hakatashi/atom,Jandersoft/atom,ykeisuke/atom,devoncarew/atom,ezeoleaf/atom,ezeoleaf/atom,Locke23rus/atom,sotayamashita/atom,vinodpanicker/atom,wiggzz/atom,originye/atom,t9md/atom,deepfox/atom,vcarrera/atom,harshdattani/atom,qskycolor/atom,johnhaley81/atom,NunoEdgarGub1/atom,nucked/atom,Jandersoft/atom,kaicataldo/atom,liuxiong332/atom,panuchart/atom,yomybaby/atom,tmunro/atom,tanin47/atom,yangchenghu/atom,h0dgep0dge/atom,jacekkopecky/atom,lisonma/atom,kevinrenaers/atom,ali/atom,decaffeinate-examples/atom,ppamorim/atom,BogusCurry/atom,Abdillah/atom,svanharmelen/atom,erikhakansson/atom,RuiDGoncalves/atom,FIT-CSE2410-A-Bombs/atom,ironbox360/atom,paulcbetts/atom,jeremyramin/atom,lpommers/atom,champagnez/atom,ppamorim/atom,lisonma/atom,yamhon/atom,G-Baby/atom,fedorov/atom,ali/atom,n-riesco/atom,tmunro/atom,tony612/atom,yalexx/atom,execjosh/atom,palita01/atom,daxlab/atom,hharchani/atom,n-riesco/atom,nrodriguez13/atom,ppamorim/atom,kc8wxm/atom,chengky/atom,phord/atom,Austen-G/BlockBuilder,atom/atom,basarat/atom,omarhuanca/atom,0x73/atom,FoldingText/atom,Klozz/atom,AlisaKiatkongkumthon/atom,abcP9110/atom,tanin47/atom,prembasumatary/atom,jtrose2/atom,boomwaiza/atom,helber/atom,yomybaby/atom,scv119/atom,jjz/atom,t9md/atom,acontreras89/atom,targeter21/atom,omarhuanca/atom,mostafaeweda/atom,charleswhchan/atom,jjz/atom,vcarrera/atom,Shekharrajak/atom,champagnez/atom,cyzn/atom,jtrose2/atom,sekcheong/atom,john-kelly/atom,ObviouslyGreen/atom,NunoEdgarGub1/atom,tjkr/atom,chfritz/atom,fedorov/atom,niklabh/atom,ReddTea/atom,jtrose2/atom,qskycolor/atom,sebmck/atom,matthewclendening/atom,mrodalgaard/atom,fredericksilva/atom,n-riesco/atom,kjav/atom,jacekkopecky/atom,ykeisuke/atom,helber/atom,bencolon/atom,kjav/atom,john-kelly/atom,Ju2ender/atom,devoncarew/atom,Shekharrajak/atom,Galactix/atom,codex8/atom,ppamorim/atom,dannyflax/atom,boomwaiza/atom,florianb/atom,constanzaurzua/atom,dannyflax/atom,nvoron23/atom,hharchani/atom,johnrizzo1/atom,prembasumatary/atom,devoncarew/atom,palita01/atom,acontreras89/atom,omarhuanca/atom,Jonekee/atom,bolinfest/atom,Abdillah/atom,svanharmelen/atom,mertkahyaoglu/atom,Locke23rus/atom,lisonma/atom,amine7536/atom,AdrianVovk/substance-ide,deepfox/atom,Abdillah/atom,sxgao3001/atom,Rodjana/atom,ReddTea/atom,constanzaurzua/atom,Rychard/atom,johnrizzo1/atom,Jandersolutions/atom,hellendag/atom,ReddTea/atom,bsmr-x-script/atom,fang-yufeng/atom,mrodalgaard/atom,hagb4rd/atom,woss/atom,toqz/atom,Galactix/atom,NunoEdgarGub1/atom,qiujuer/atom,sxgao3001/atom,batjko/atom,chfritz/atom,gisenberg/atom,florianb/atom,sekcheong/atom,nrodriguez13/atom,yomybaby/atom,mnquintana/atom,xream/atom,fredericksilva/atom,AlexxNica/atom,wiggzz/atom,kandros/atom,vinodpanicker/atom,Hasimir/atom,Neron-X5/atom,transcranial/atom,g2p/atom,rxkit/atom,gabrielPeart/atom,lpommers/atom,woss/atom,sxgao3001/atom,darwin/atom,me6iaton/atom,Hasimir/atom,bryonwinger/atom,RobinTec/atom,jacekkopecky/atom,NunoEdgarGub1/atom,Huaraz2/atom,russlescai/atom,stinsonga/atom,ashneo76/atom,einarmagnus/atom,rookie125/atom,synaptek/atom,vjeux/atom,yomybaby/atom,kc8wxm/atom,targeter21/atom,isghe/atom,mnquintana/atom,mostafaeweda/atom,RuiDGoncalves/atom,rlugojr/atom,isghe/atom,devoncarew/atom,nvoron23/atom,001szymon/atom,hpham04/atom,vhutheesing/atom,avdg/atom,ObviouslyGreen/atom,Ju2ender/atom,abcP9110/atom,sekcheong/atom,pkdevbox/atom,originye/atom,mostafaeweda/atom,acontreras89/atom,gzzhanghao/atom,hpham04/atom,me6iaton/atom,001szymon/atom,medovob/atom,me6iaton/atom,PKRoma/atom,beni55/atom,kaicataldo/atom,ilovezy/atom,fang-yufeng/atom,RuiDGoncalves/atom,abe33/atom,crazyquark/atom,cyzn/atom,burodepeper/atom,bolinfest/atom,h0dgep0dge/atom,woss/atom,pkdevbox/atom,pombredanne/atom,devoncarew/atom,MjAbuz/atom,isghe/atom,n-riesco/atom,transcranial/atom,deoxilix/atom,avdg/atom,cyzn/atom,RobinTec/atom,yamhon/atom,jlord/atom,Mokolea/atom,FoldingText/atom,fedorov/atom,nrodriguez13/atom,crazyquark/atom,Andrey-Pavlov/atom,florianb/atom,githubteacher/atom,dsandstrom/atom,einarmagnus/atom,gontadu/atom,nvoron23/atom,ivoadf/atom,0x73/atom,jlord/atom,mertkahyaoglu/atom,andrewleverette/atom,decaffeinate-examples/atom,gabrielPeart/atom,jordanbtucker/atom,rsvip/aTom,gzzhanghao/atom,woss/atom,vhutheesing/atom,seedtigo/atom,ali/atom,me6iaton/atom,dannyflax/atom,originye/atom,efatsi/atom,mdumrauf/atom,efatsi/atom,Neron-X5/atom,FoldingText/atom,rsvip/aTom,bsmr-x-script/atom,dkfiresky/atom,jacekkopecky/atom,fang-yufeng/atom,hellendag/atom,Andrey-Pavlov/atom,kittens/atom,MjAbuz/atom,githubteacher/atom,ralphtheninja/atom,medovob/atom,ReddTea/atom,bsmr-x-script/atom,dkfiresky/atom,fscherwi/atom,davideg/atom,Jandersoft/atom,YunchengLiao/atom,Ingramz/atom,pombredanne/atom,kc8wxm/atom,vcarrera/atom,pombredanne/atom,Andrey-Pavlov/atom,qiujuer/atom,dannyflax/atom,beni55/atom,pombredanne/atom,Sangaroonaom/atom,yalexx/atom
9e1b9dc5df058a3f726937970e0c36f5ffd3bf74
keymaps/coffee-compile.cson
keymaps/coffee-compile.cson
# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.platform-darwin .editor': 'cmd-shift-c': 'coffee-compile:compile' '.platform-win32 .editor, .platform-linux .editor': 'ctrl-alt-b': 'coffee-compile:compile'
# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.platform-darwin .editor': 'cmd-shift-c': 'coffee-compile:compile' '.platform-win32 .editor, .platform-linux .editor': 'ctrl-alt-c': 'coffee-compile:compile'
Change win/linux key to ctrl-alt-c
Change win/linux key to ctrl-alt-c
CoffeeScript
mit
adrianlee44/atom-coffee-compile
70b3d39035395eb3120c23262a171b56e9b1dc63
keymaps/git-experiment.cson
keymaps/git-experiment.cson
# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps 'atom-workspace': 'ctrl-alt-d': 'git-experiment:view-history' 'git-experiment-history-view .history': 'down': 'core:move-down' 'j': 'core:move-down' 'up': 'core:move-up' 'k': 'core:move-up' 'git-experiment-history-view .changes': 'down': 'core:move-down' 'j': 'core:move-down' 'up': 'core:move-up' 'k': 'core:move-up'
# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps 'atom-workspace': 'ctrl-alt-d': 'git-experiment:view-history' 'git-experiment-history-view .history': 'down': 'core:move-down' 'up': 'core:move-up' 'git-experiment-changes-view .data': 'down': 'core:move-down' 'up': 'core:move-up' 'git-experiment-changes-view atom-text-editor': 'cmd-enter': 'core:confirm'
Change keymaps and add confirm
Change keymaps and add confirm
CoffeeScript
mit
atom/github,atom/github,atom/github
bbaaa2300b2d0aca3f9831b932750da7f3757d77
test/spec/controllers/main.coffee
test/spec/controllers/main.coffee
'use strict' describe 'Controller: MainCtrl', () -> # load the controller's module beforeEach module 'appApp' MainCtrl = {} scope = {} # Initialize the controller and a mock scope beforeEach inject ($controller, $rootScope) -> scope = $rootScope.$new() MainCtrl = $controller 'MainCtrl', { $scope: scope } it 'should attach a list of awesomeThings to the scope', () -> expect(scope.awesomeThings.length).toBe 3;
'use strict' describe 'Controller: MainCtrl', () -> # load the controller's module beforeEach module 'appApp' MainCtrl = {} scope = {} # Initialize the controller and a mock scope beforeEach inject ($injector, $controller, $rootScope) -> $httpBackend = $injector.get('$httpBackend') $httpBackend.whenGET(/.*/).respond({fake: 'data'}) scope = $rootScope.$new() MainCtrl = $controller 'MainCtrl', { $scope: scope } it 'should attach a list of awesomeThings to the scope', () -> expect(scope.awesomeThings.length).toBe 3;
Test spec handles mock API requests, very general regex used (/.*/).
Test spec handles mock API requests, very general regex used (/.*/).
CoffeeScript
agpl-3.0
IdeaHaven/tilden
c83e9d4e93d699ea69f77a2e6bba21e505b9b094
src/command.coffee
src/command.coffee
numeral = require("numeral") balance = require("./crypto-balance") module.exports.run = -> addr = process.argv[2] unless addr console.log "Usage: balance <address>" process.exit 1 balance addr .then (items) -> for item in items if item.status == 'success' console.log "#{numeral(item.quantity).format("0,0.00000000")} #{item.asset}" else console.error item .catch (error) -> console.error error process.exit 1
numeral = require("numeral") _ = require("lodash") balance = require("./crypto-balance") module.exports.run = -> addr = process.argv[2] unless addr console.log "Usage: balance <address>" process.exit 1 balance addr .then (items) -> for item in items if item.status == 'success' console.log "#{numeral(item.quantity).format("0,0.00000000")} #{item.asset}" else console.error _.merge(item, raw: "[object]") .catch (error) -> console.error error process.exit 1
Clean up error output for cli tool a bit
Clean up error output for cli tool a bit
CoffeeScript
mit
larskluge/crypto-balance
dde77a7e71b66275342c18466cffe67682971cf2
engine/glmatrix_extra.coffee
engine/glmatrix_extra.coffee
glm = require 'gl-matrix' glm.quat.to_euler = (out=[0,0,0], quat, order='YZX') -> if order != 'YZX' throw new Error "Euler order "+order+" not supported yet." # It will return YZX euler. TODO: implement other orders x = quat[0] y = quat[1] z = quat[2] w = quat[3] test = x*y + z*w; if test > 0.499 # singularity at north pole heading = 2 * Math.atan2 x,w attitude = Math.PI/2 bank = 0 else if test < -0.499 # singularity at south pole heading = -2 * Math.atan2 x,w attitude = - Math.PI/2 bank = 0 else if isNaN heading sqx = x*x sqy = y*y sqz = z*z heading = Math.atan2 2*y*w - 2*x*z , 1 - 2*sqy - 2*sqz # Heading attitude = Math.asin 2*test # attitude bank = Math.atan2 2*x*w - 2*y*z , 1 - 2*sqx - 2*sqz # bank out[1] = heading out[2] = attitude out[0] = bank return out module.exports = glm
glm = require 'gl-matrix' glm.quat.to_euler = (out=[0,0,0], quat, order='XZY') -> if order != 'XZY' throw new Error "Euler order "+order+" not supported yet." # It will return XZY euler. TODO: implement other orders x = quat[0] y = quat[1] z = quat[2] w = quat[3] test = x*y + z*w; if test > 0.499 # singularity at north pole heading = 2 * Math.atan2 x,w attitude = Math.PI/2 bank = 0 else if test < -0.499 # singularity at south pole heading = -2 * Math.atan2 x,w attitude = - Math.PI/2 bank = 0 else if isNaN heading sqx = x*x sqy = y*y sqz = z*z heading = Math.atan2 2*y*w - 2*x*z , 1 - 2*sqy - 2*sqz # Heading attitude = Math.asin 2*test # attitude bank = Math.atan2 2*x*w - 2*y*z , 1 - 2*sqx - 2*sqz # bank # Compatibility with turntable camera (bank limited to 0-180) if bank < 0 bank += Math.PI heading += Math.PI attitude = Math.PI - attitude out[1] = heading out[2] = attitude out[0] = bank return out module.exports = glm
Add to_euler compatibility with turntable camera. Specify rotation order by Blender's nomenclature.
Add to_euler compatibility with turntable camera. Specify rotation order by Blender's nomenclature.
CoffeeScript
mit
myou-engine/myou-engine
1840149fa2ee04a6659c4c24233cc0b96119d17e
app/assets/javascripts/routes/application_route.js.coffee
app/assets/javascripts/routes/application_route.js.coffee
ETahi.ApplicationRoute = Ember.Route.extend actions: chooseNewCardTypeOverlay: (phase) -> @controllerFor('chooseNewCardTypeOverlay').set('phase', phase) @render('chooseNewCardTypeOverlay', into: 'application' outlet: 'overlay' controller: 'chooseNewCardTypeOverlay') showTaskCreationOverlay: (phase) -> @send('showNewCardOverlay', 'newAdHocTaskOverlay', 'Task', phase) showMessageCreationOverlay: (phase) -> @send('showNewCardOverlay', 'newMessageTask', 'MessageTask', phase) showNewCardOverlay: (tmplName, taskType, phase) -> paper = @controllerFor('paperManage').get('model') newTaskParams = {phase: phase, type: taskType.replace(/^new/, ''), paper_id: paper.get('id')} newTask = @store.createRecord(taskType, newTaskParams) if taskType == 'MessageTask' newTask.get('participants').pushObject(@controllerFor('application').get('currentUser')) @controllerFor('newCardOverlay').set('model', newTask) @controllerFor('newCardOverlay').set('paper', paper) @render(tmplName, into: 'application' outlet: 'overlay' controller: 'newCardOverlay') closeOverlay: -> ETahi.animateOverlayOut().then => @disconnectOutlet outlet: 'overlay' parentView: 'application'
ETahi.ApplicationRoute = Ember.Route.extend actions: chooseNewCardTypeOverlay: (phase) -> @controllerFor('chooseNewCardTypeOverlay').set('phase', phase) @render('chooseNewCardTypeOverlay', into: 'application' outlet: 'overlay' controller: 'chooseNewCardTypeOverlay') showTaskCreationOverlay: (phase) -> @send('showNewCardOverlay', 'newAdHocTaskOverlay', 'Task', phase) showMessageCreationOverlay: (phase) -> @send('showNewCardOverlay', 'newMessageTask', 'MessageTask', phase) showNewCardOverlay: (tmplName, taskType, phase) -> paper = @controllerFor('paperManage').get('model') newTaskParams = {phase: phase, type: taskType.replace(/^new/, ''), paper_id: paper.get('id')} newTask = @store.createRecord(taskType, newTaskParams) controller = @controllerFor('newCardOverlay') if taskType == 'MessageTask' newTask.get('participants').pushObject(@controllerFor('application').get('currentUser')) controller.setProperties({ model: newTask paper: paper overlayClass: (if taskType == 'MessageTask' then 'message-overlay' else 'new-adhoc-overlay') }) @render(tmplName, into: 'application' outlet: 'overlay' controller: 'newCardOverlay') closeOverlay: -> ETahi.animateOverlayOut().then => @disconnectOutlet outlet: 'overlay' parentView: 'application'
Set class on new card overlays
Set class on new card overlays
CoffeeScript
mit
johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi
41522abad509b798673d2987dfd7a913b69964ea
4-dual-target/brunch-config.coffee
4-dual-target/brunch-config.coffee
module.exports = config: files: javascripts: joinTo: 'libraries.js': /^app\/jquery\.js/ 'app.js': /^(?!app\/jquery\.js)/ stylesheets: joinTo: 'app.css'
module.exports = config: files: javascripts: joinTo: 'libraries.js': /^app[\\\/]jquery\.js/ 'app.js': /^(?!app[\\\/]jquery\.js)/ stylesheets: joinTo: 'app.css'
Use both \ and / in regexes so anymatch OKs Win/POSIX paths
Use both \ and / in regexes so anymatch OKs Win/POSIX paths
CoffeeScript
mit
brunch/brunch-guide-demos,brunch/brunch-guide-demos
cd057e2da8f6e49201d1cd2209c26b1a1ca1b6bb
core/app/backbone/views/users/user_statistics_view.coffee
core/app/backbone/views/users/user_statistics_view.coffee
class window.UserStatisticsView extends Backbone.Marionette.ItemView className: 'statistics' template: 'users/statistics' initialize: -> @listenTo @model, 'change', @render
class window.UserStatisticsView extends Backbone.Marionette.ItemView className: 'statistics' template: 'users/statistics' templateHelpers: => topic: @model.user_topics().first()?.toJSON() initialize: -> @listenTo @model, 'change', @render
Revert "Removed unused template helper"
Revert "Removed unused template helper" This reverts commit 5292657dac5edf95436665e081ee41760a1a77f2.
CoffeeScript
mit
daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core
97b4a7a5bf87e8cc2a8de3e54fd725ae29a35ba5
index.coffee
index.coffee
surveyor = require './lib/surveyor.coffee' websocket = require './lib/websocket.coffee' webserver = require './lib/webserver.coffee' webserver.listen 4001 util = require './lib/util.coffee' model = require './lib/model.coffee' lock = false check = -> return if lock lock = true surveyor.getManifest (err) -> throw new Error err if err? surveyor.buildRequired -> surveyor.spawnMissing (err, procs) -> lock = false return console.error err, procs if err? console.log "spawned", procs if Object.keys(procs).length isnt 0 model.currentRoutingTableHash = "" route = -> surveyor.calculateRoutingTable (err, table) -> return console.error err if err? hash = util.hashObj(table) if hash isnt model.currentRoutingTableHash surveyor.propagateRoutingTable table, (errs) -> model.currentRoutingTableHash = hash unless errs? console.error errs if err? setInterval -> check() , 3000 setTimeout -> setInterval -> route() , 3000 , 1500
surveyor = require './lib/surveyor.coffee' websocket = require './lib/websocket.coffee' webserver = require './lib/webserver.coffee' webserver.listen 4001 util = require './lib/util.coffee' model = require './lib/model.coffee' lock = false lockTimer = null lockTimeout = process.env.LOCKTIMEOUT or 30 * 1000 check = -> return if lock lockTimer = setTimeout -> throw new Error "Checking process was locked for longer than #{lockTimeout}" , lockTimeout lock = true surveyor.getManifest (err) -> throw new Error err if err? surveyor.buildRequired -> surveyor.spawnMissing (err, procs) -> lock = false clearTimeout lockTimer return console.error err, procs if err? console.log "spawned", procs if Object.keys(procs).length isnt 0 model.currentRoutingTableHash = "" route = -> surveyor.calculateRoutingTable (err, table) -> return console.error err if err? hash = util.hashObj(table) if hash isnt model.currentRoutingTableHash surveyor.propagateRoutingTable table, (errs) -> model.currentRoutingTableHash = hash unless errs? console.error errs if err? setInterval -> check() , 3000 setTimeout -> setInterval -> route() , 3000 , 1500
Throw if process stays locked for too long
Throw if process stays locked for too long
CoffeeScript
bsd-3-clause
davidbanham/field-marshal
2b62318b4eae443336cf65c6c549b5bbe15fb1e9
models/mixins/dimensions.coffee
models/mixins/dimensions.coffee
_ = require 'underscore' module.exports = dimensions: (metric = @get('metric')) -> @get('dimensions')[metric] if metric # Wrap only X Y/Z; leave X/Y alone superscriptFractions: (string) -> string?.replace /(\d+)(?:\s+)(\d+\/\d+)/g, '$1 <sup>$2</sup>' fractionToDecimal: (string) -> split = string.split '/' parseInt(split[0], 10) / parseInt(split[1], 10) expressAsMetric: (string) -> string?.replace /((\d+)(?:\s+)(\d+\/\d+)|(\d+\/\d+))/g, (match) => # Replace the fractions with decimal representations match = match.replace /(\d+\/\d+)/g, @fractionToDecimal # Collapse either side of the measurement with addition _.map(match.split(' × '), (x) -> nums = _.map(x.split(' '), (y) -> parseFloat(y)) _.reduce nums, ((memo, num) -> memo + num), 0 ).join ' × '
_ = require 'underscore' module.exports = dimensions: (metric = @get('metric')) -> @get('dimensions')[metric] if metric # Wrap only X Y/Z; leave X/Y alone superscriptFractions: (string) -> string?.replace /(\d+)(?:\s+)(\d+\/\d+)/g, '$1 <sup>$2</sup>' fractionToDecimal: (string) -> split = string.split '/' decimal = parseInt(split[0], 10) / parseInt(split[1], 10) if decimal is Infinity throw new Error('Division by zero') decimal expressAsMetric: (string) -> string?.replace /((\d+)(?:\s+)(\d+\/\d+)|(\d+\/\d+))/g, (match) => try # Replace the fractions with decimal representations match = match.replace /(\d+\/\d+)/g, @fractionToDecimal # Collapse either side of the measurement with addition _.map(match.split(' × '), (x) -> nums = _.map(x.split(' '), (y) -> parseFloat(y)) _.reduce nums, ((memo, num) -> memo + num), 0 ).join ' × ' catch match
Throw division by zero and wrap in try/catch
Throw division by zero and wrap in try/catch
CoffeeScript
mit
kanaabe/force,dblock/force,kanaabe/force,oxaudo/force,artsy/force,damassi/force,xtina-starr/force,artsy/force,kanaabe/force,anandaroop/force,yuki24/force,kanaabe/force,anandaroop/force,damassi/force,TribeMedia/force-public,mzikherman/force,joeyAghion/force,eessex/force,yuki24/force,dblock/force,izakp/force,artsy/force,izakp/force,oxaudo/force,oxaudo/force,erikdstock/force,xtina-starr/force,TribeMedia/force-public,mzikherman/force,anandaroop/force,eessex/force,joeyAghion/force,cavvia/force-1,erikdstock/force,artsy/force,cavvia/force-1,dblock/force,cavvia/force-1,artsy/force-public,eessex/force,izakp/force,erikdstock/force,mzikherman/force,anandaroop/force,erikdstock/force,oxaudo/force,xtina-starr/force,xtina-starr/force,mzikherman/force,damassi/force,eessex/force,yuki24/force,joeyAghion/force,cavvia/force-1,joeyAghion/force,damassi/force,yuki24/force,izakp/force,kanaabe/force,artsy/force-public
64620ee22bd22c9b301bec8c9f76c084e29d9c69
lib/cli.iced
lib/cli.iced
fs = require 'fs' { diff } = require './index' module.exports = (argv) -> options = require('dreamopt') [ "Usage: json-diff [-v] first.json second.json" "Arguments:" " first.json Old file #var(file1) #required" " second.json New file #var(file2) #required" "General options:" " -v, --verbose Output progress info" ], argv console.log "Loading files..." if options.verbose await fs.readFile options.file1, 'utf8', defer(err1, data1) fs.readFile options.file2, 'utf8', defer(err2, data2) throw err1 if err1 throw err2 if err2 console.log "Parsing old file..." if options.verbose json1 = JSON.parse(data1) console.log "Parsing new file..." if options.verbose json2 = JSON.parse(data2) console.log "Running diff..." if options.verbose result = diff(json1, json2) process.stdout.write JSON.stringify(result)
fs = require 'fs' { diff } = require './index' module.exports = (argv) -> options = require('dreamopt') [ "Usage: json-diff [-v] first.json second.json" "Arguments:" " first.json Old file #var(file1) #required" " second.json New file #var(file2) #required" "General options:" " -v, --verbose Output progress info" ], argv process.stderr.write "Loading files...\n" if options.verbose await fs.readFile options.file1, 'utf8', defer(err1, data1) fs.readFile options.file2, 'utf8', defer(err2, data2) throw err1 if err1 throw err2 if err2 process.stderr.write "Parsing old file...\n" if options.verbose json1 = JSON.parse(data1) process.stderr.write "Parsing new file...\n" if options.verbose json2 = JSON.parse(data2) process.stderr.write "Running diff...\n" if options.verbose result = diff(json1, json2) process.stderr.write "Producing output...\n" if options.verbose process.stdout.write JSON.stringify(result, null, 2)
Send verbose output to stderr
Send verbose output to stderr
CoffeeScript
mit
kounoike/json-diff,andreyvit/json-diff,piotr1212/json-diff
c5cd39308d2b1dac51ccf0522292f425544b9226
src/app/general-config-panel.coffee
src/app/general-config-panel.coffee
ConfigPanel = require 'config-panel' {$$} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class GeneralConfigPanel extends ConfigPanel @content: -> @form id: 'general-config-panel', class: 'form-horizontal', => @fieldset => @legend "General Settings" @div class: 'control-group', => @div class: 'checkbox', => @label for: 'editor.hideGitIgnoredFiles', => @input id: 'editor.hideGitIgnoredFiles', type: 'checkbox' @text 'Hide Git-Ignored Files' @div class: 'checkbox', => @label for: 'core.autosave', => @input id: 'core.autosave', type: 'checkbox' @text 'Auto-Save on Focus Change'
ConfigPanel = require 'config-panel' {$$} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class GeneralConfigPanel extends ConfigPanel @content: -> @form id: 'general-config-panel', class: 'form-horizontal', => @fieldset => @legend "General Settings" @div class: 'control-group', => @div class: 'checkbox', => @label for: 'editor.hideGitIgnoredFiles', => @input id: 'editor.hideGitIgnoredFiles', type: 'checkbox' @text 'Hide Git-Ignored Files' @div class: 'checkbox', => @label for: 'core.autosave', => @input id: 'core.autosave', type: 'checkbox' @text 'Auto-Save on Focus Change' @button outlet: 'openDotAtomButton', type: 'button', class: 'btn btn-default', "Open '#{config.configDirPath}'" initialize: -> @openDotAtomButton.on 'click', -> atom.open(config.configDirPath)
Add "open .atom" button to general config view
Add "open .atom" button to general config view
CoffeeScript
mit
florianb/atom,deepfox/atom,dsandstrom/atom,001szymon/atom,liuxiong332/atom,hakatashi/atom,YunchengLiao/atom,ppamorim/atom,kittens/atom,davideg/atom,RobinTec/atom,jacekkopecky/atom,Jonekee/atom,kjav/atom,hharchani/atom,john-kelly/atom,elkingtonmcb/atom,mrodalgaard/atom,dijs/atom,mertkahyaoglu/atom,rjattrill/atom,ezeoleaf/atom,Hasimir/atom,rmartin/atom,palita01/atom,0x73/atom,kittens/atom,kandros/atom,ppamorim/atom,oggy/atom,tjkr/atom,SlimeQ/atom,chengky/atom,jlord/atom,Shekharrajak/atom,KENJU/atom,Klozz/atom,execjosh/atom,acontreras89/atom,mostafaeweda/atom,rookie125/atom,burodepeper/atom,nvoron23/atom,ivoadf/atom,vcarrera/atom,harshdattani/atom,mostafaeweda/atom,nucked/atom,russlescai/atom,cyzn/atom,bradgearon/atom,alexandergmann/atom,bj7/atom,lisonma/atom,acontreras89/atom,sebmck/atom,ralphtheninja/atom,AlexxNica/atom,yamhon/atom,nvoron23/atom,einarmagnus/atom,KENJU/atom,FIT-CSE2410-A-Bombs/atom,synaptek/atom,fang-yufeng/atom,bcoe/atom,ReddTea/atom,tmunro/atom,vinodpanicker/atom,dkfiresky/atom,phord/atom,me6iaton/atom,Galactix/atom,devoncarew/atom,kc8wxm/atom,omarhuanca/atom,Jandersoft/atom,rlugojr/atom,medovob/atom,johnhaley81/atom,tony612/atom,matthewclendening/atom,elkingtonmcb/atom,prembasumatary/atom,RuiDGoncalves/atom,ObviouslyGreen/atom,n-riesco/atom,fedorov/atom,fredericksilva/atom,originye/atom,ppamorim/atom,ezeoleaf/atom,rookie125/atom,qiujuer/atom,beni55/atom,basarat/atom,DiogoXRP/atom,brettle/atom,abe33/atom,devoncarew/atom,Galactix/atom,tony612/atom,batjko/atom,githubteacher/atom,jjz/atom,sekcheong/atom,devmario/atom,0x73/atom,Rychard/atom,scv119/atom,Dennis1978/atom,devoncarew/atom,fscherwi/atom,gabrielPeart/atom,RuiDGoncalves/atom,sebmck/atom,KENJU/atom,alexandergmann/atom,devmario/atom,seedtigo/atom,nucked/atom,mnquintana/atom,pombredanne/atom,sxgao3001/atom,xream/atom,Jandersoft/atom,PKRoma/atom,florianb/atom,gontadu/atom,FoldingText/atom,chengky/atom,execjosh/atom,tjkr/atom,h0dgep0dge/atom,lovesnow/atom,splodingsocks/atom,vjeux/atom,pengshp/atom,FIT-CSE2410-A-Bombs/atom,githubteacher/atom,seedtigo/atom,xream/atom,ali/atom,DiogoXRP/atom,vinodpanicker/atom,NunoEdgarGub1/atom,pengshp/atom,SlimeQ/atom,mnquintana/atom,FIT-CSE2410-A-Bombs/atom,helber/atom,Austen-G/BlockBuilder,florianb/atom,ardeshirj/atom,kevinrenaers/atom,yalexx/atom,001szymon/atom,bryonwinger/atom,Ju2ender/atom,basarat/atom,vcarrera/atom,avdg/atom,me6iaton/atom,gzzhanghao/atom,me-benni/atom,beni55/atom,Arcanemagus/atom,andrewleverette/atom,fang-yufeng/atom,Arcanemagus/atom,decaffeinate-examples/atom,mrodalgaard/atom,Abdillah/atom,liuderchi/atom,yalexx/atom,kittens/atom,ralphtheninja/atom,yangchenghu/atom,vinodpanicker/atom,hagb4rd/atom,tony612/atom,rjattrill/atom,davideg/atom,brettle/atom,jlord/atom,crazyquark/atom,me-benni/atom,AdrianVovk/substance-ide,abe33/atom,lovesnow/atom,Locke23rus/atom,rsvip/aTom,RobinTec/atom,stuartquin/atom,erikhakansson/atom,codex8/atom,cyzn/atom,tanin47/atom,MjAbuz/atom,rxkit/atom,rxkit/atom,Jdesk/atom,synaptek/atom,dkfiresky/atom,Rodjana/atom,kaicataldo/atom,Galactix/atom,Mokolea/atom,chfritz/atom,ppamorim/atom,ykeisuke/atom,ali/atom,h0dgep0dge/atom,SlimeQ/atom,hellendag/atom,qskycolor/atom,mertkahyaoglu/atom,champagnez/atom,alfredxing/atom,RobinTec/atom,vcarrera/atom,Austen-G/BlockBuilder,jlord/atom,yamhon/atom,prembasumatary/atom,scippio/atom,fang-yufeng/atom,Huaraz2/atom,mrodalgaard/atom,deoxilix/atom,Jandersolutions/atom,pombredanne/atom,acontreras89/atom,Jandersoft/atom,splodingsocks/atom,ironbox360/atom,bencolon/atom,efatsi/atom,daxlab/atom,hharchani/atom,tmunro/atom,AlisaKiatkongkumthon/atom,kc8wxm/atom,vinodpanicker/atom,russlescai/atom,jjz/atom,rsvip/aTom,Jdesk/atom,Hasimir/atom,abcP9110/atom,mdumrauf/atom,ppamorim/atom,toqz/atom,me6iaton/atom,bcoe/atom,execjosh/atom,matthewclendening/atom,qskycolor/atom,boomwaiza/atom,florianb/atom,bradgearon/atom,bryonwinger/atom,tisu2tisu/atom,rookie125/atom,helber/atom,PKRoma/atom,decaffeinate-examples/atom,tjkr/atom,001szymon/atom,gabrielPeart/atom,hagb4rd/atom,champagnez/atom,russlescai/atom,gzzhanghao/atom,vcarrera/atom,ashneo76/atom,batjko/atom,sillvan/atom,niklabh/atom,daxlab/atom,Abdillah/atom,scippio/atom,efatsi/atom,Abdillah/atom,ReddTea/atom,Ju2ender/atom,fedorov/atom,jjz/atom,chengky/atom,prembasumatary/atom,sillvan/atom,gisenberg/atom,lovesnow/atom,ilovezy/atom,ivoadf/atom,john-kelly/atom,Austen-G/BlockBuilder,amine7536/atom,me6iaton/atom,n-riesco/atom,harshdattani/atom,hakatashi/atom,johnrizzo1/atom,scv119/atom,ashneo76/atom,paulcbetts/atom,stinsonga/atom,batjko/atom,Andrey-Pavlov/atom,phord/atom,jtrose2/atom,constanzaurzua/atom,sekcheong/atom,niklabh/atom,hellendag/atom,0x73/atom,jacekkopecky/atom,charleswhchan/atom,yangchenghu/atom,G-Baby/atom,lovesnow/atom,fredericksilva/atom,NunoEdgarGub1/atom,lovesnow/atom,jordanbtucker/atom,boomwaiza/atom,dkfiresky/atom,avdg/atom,fredericksilva/atom,avdg/atom,amine7536/atom,brumm/atom,devmario/atom,kjav/atom,sxgao3001/atom,Dennis1978/atom,Hasimir/atom,sxgao3001/atom,bencolon/atom,Huaraz2/atom,basarat/atom,GHackAnonymous/atom,GHackAnonymous/atom,svanharmelen/atom,jtrose2/atom,pengshp/atom,fredericksilva/atom,me6iaton/atom,deepfox/atom,FoldingText/atom,ilovezy/atom,kdheepak89/atom,chengky/atom,fredericksilva/atom,AdrianVovk/substance-ide,kjav/atom,yalexx/atom,rmartin/atom,ardeshirj/atom,brumm/atom,amine7536/atom,xream/atom,ralphtheninja/atom,bradgearon/atom,fang-yufeng/atom,sotayamashita/atom,rxkit/atom,paulcbetts/atom,davideg/atom,hagb4rd/atom,hakatashi/atom,ReddTea/atom,AdrianVovk/substance-ide,targeter21/atom,jjz/atom,gzzhanghao/atom,rmartin/atom,tony612/atom,nrodriguez13/atom,nrodriguez13/atom,alexandergmann/atom,Ingramz/atom,Klozz/atom,palita01/atom,Mokolea/atom,pkdevbox/atom,abcP9110/atom,dannyflax/atom,matthewclendening/atom,jtrose2/atom,mostafaeweda/atom,dannyflax/atom,vhutheesing/atom,CraZySacX/atom,liuxiong332/atom,Rodjana/atom,liuderchi/atom,bolinfest/atom,gontadu/atom,jacekkopecky/atom,rsvip/aTom,liuderchi/atom,h0dgep0dge/atom,champagnez/atom,ObviouslyGreen/atom,johnhaley81/atom,Shekharrajak/atom,GHackAnonymous/atom,bj7/atom,Sangaroonaom/atom,johnrizzo1/atom,bcoe/atom,charleswhchan/atom,ali/atom,yalexx/atom,KENJU/atom,transcranial/atom,mnquintana/atom,NunoEdgarGub1/atom,YunchengLiao/atom,mnquintana/atom,bolinfest/atom,nrodriguez13/atom,jordanbtucker/atom,jacekkopecky/atom,daxlab/atom,darwin/atom,sillvan/atom,Galactix/atom,pombredanne/atom,devmario/atom,AlexxNica/atom,hagb4rd/atom,dijs/atom,dannyflax/atom,abe33/atom,g2p/atom,RuiDGoncalves/atom,kevinrenaers/atom,kaicataldo/atom,kjav/atom,lisonma/atom,RobinTec/atom,AlisaKiatkongkumthon/atom,johnrizzo1/atom,Sangaroonaom/atom,woss/atom,kc8wxm/atom,dannyflax/atom,jjz/atom,sxgao3001/atom,rjattrill/atom,isghe/atom,Andrey-Pavlov/atom,Mokolea/atom,lpommers/atom,john-kelly/atom,qiujuer/atom,einarmagnus/atom,lisonma/atom,mnquintana/atom,hharchani/atom,yomybaby/atom,kdheepak89/atom,toqz/atom,beni55/atom,sxgao3001/atom,woss/atom,Ju2ender/atom,sekcheong/atom,Jandersoft/atom,me-benni/atom,alfredxing/atom,t9md/atom,oggy/atom,gisenberg/atom,florianb/atom,jtrose2/atom,ali/atom,batjko/atom,n-riesco/atom,kjav/atom,Andrey-Pavlov/atom,ilovezy/atom,acontreras89/atom,rsvip/aTom,efatsi/atom,isghe/atom,bryonwinger/atom,amine7536/atom,alfredxing/atom,t9md/atom,yomybaby/atom,ezeoleaf/atom,wiggzz/atom,vjeux/atom,kittens/atom,MjAbuz/atom,toqz/atom,dsandstrom/atom,jtrose2/atom,dannyflax/atom,russlescai/atom,acontreras89/atom,gisenberg/atom,MjAbuz/atom,codex8/atom,yomybaby/atom,synaptek/atom,lisonma/atom,synaptek/atom,Jdesk/atom,oggy/atom,hpham04/atom,nvoron23/atom,bolinfest/atom,hpham04/atom,RobinTec/atom,n-riesco/atom,bsmr-x-script/atom,anuwat121/atom,nvoron23/atom,constanzaurzua/atom,matthewclendening/atom,SlimeQ/atom,vinodpanicker/atom,ykeisuke/atom,brumm/atom,einarmagnus/atom,Abdillah/atom,johnhaley81/atom,FoldingText/atom,rmartin/atom,gabrielPeart/atom,rlugojr/atom,ironbox360/atom,pombredanne/atom,qskycolor/atom,transcranial/atom,isghe/atom,ilovezy/atom,h0dgep0dge/atom,qiujuer/atom,Klozz/atom,svanharmelen/atom,codex8/atom,Jandersolutions/atom,ironbox360/atom,YunchengLiao/atom,woss/atom,kc8wxm/atom,hharchani/atom,devoncarew/atom,sebmck/atom,cyzn/atom,lpommers/atom,burodepeper/atom,woss/atom,oggy/atom,paulcbetts/atom,tanin47/atom,medovob/atom,AlexxNica/atom,bj7/atom,qiujuer/atom,chfritz/atom,mdumrauf/atom,constanzaurzua/atom,Rodjana/atom,kc8wxm/atom,ykeisuke/atom,kaicataldo/atom,targeter21/atom,Huaraz2/atom,kittens/atom,CraZySacX/atom,GHackAnonymous/atom,fscherwi/atom,dsandstrom/atom,Andrey-Pavlov/atom,decaffeinate-examples/atom,folpindo/atom,folpindo/atom,Neron-X5/atom,nvoron23/atom,Jandersolutions/atom,davideg/atom,Locke23rus/atom,deoxilix/atom,svanharmelen/atom,phord/atom,Neron-X5/atom,FoldingText/atom,FoldingText/atom,omarhuanca/atom,rmartin/atom,dsandstrom/atom,dkfiresky/atom,elkingtonmcb/atom,batjko/atom,Jonekee/atom,jordanbtucker/atom,ReddTea/atom,jlord/atom,isghe/atom,jlord/atom,fedorov/atom,hakatashi/atom,tisu2tisu/atom,vcarrera/atom,targeter21/atom,decaffeinate-examples/atom,vhutheesing/atom,darwin/atom,Jonekee/atom,devoncarew/atom,deepfox/atom,Locke23rus/atom,toqz/atom,vjeux/atom,russlescai/atom,gisenberg/atom,crazyquark/atom,jacekkopecky/atom,splodingsocks/atom,YunchengLiao/atom,AlbertoBarrago/atom,niklabh/atom,Arcanemagus/atom,Shekharrajak/atom,ReddTea/atom,palita01/atom,lpommers/atom,jacekkopecky/atom,SlimeQ/atom,erikhakansson/atom,mostafaeweda/atom,vjeux/atom,targeter21/atom,omarhuanca/atom,stinsonga/atom,CraZySacX/atom,hpham04/atom,mertkahyaoglu/atom,vjeux/atom,omarhuanca/atom,erikhakansson/atom,mertkahyaoglu/atom,pombredanne/atom,yamhon/atom,chengky/atom,darwin/atom,0x73/atom,atom/atom,stuartquin/atom,hagb4rd/atom,basarat/atom,transcranial/atom,sotayamashita/atom,FoldingText/atom,liuxiong332/atom,crazyquark/atom,Jandersolutions/atom,hellendag/atom,yangchenghu/atom,MjAbuz/atom,kandros/atom,githubteacher/atom,oggy/atom,kevinrenaers/atom,ashneo76/atom,kdheepak89/atom,kandros/atom,crazyquark/atom,Shekharrajak/atom,anuwat121/atom,vhutheesing/atom,yomybaby/atom,sillvan/atom,medovob/atom,amine7536/atom,matthewclendening/atom,atom/atom,omarhuanca/atom,liuderchi/atom,isghe/atom,tmunro/atom,qiujuer/atom,AlbertoBarrago/atom,DiogoXRP/atom,seedtigo/atom,Abdillah/atom,wiggzz/atom,stuartquin/atom,sebmck/atom,atom/atom,Ingramz/atom,burodepeper/atom,qskycolor/atom,Jdesk/atom,ardeshirj/atom,boomwaiza/atom,kdheepak89/atom,bencolon/atom,stinsonga/atom,lisonma/atom,Galactix/atom,n-riesco/atom,yalexx/atom,deepfox/atom,MjAbuz/atom,liuxiong332/atom,folpindo/atom,Andrey-Pavlov/atom,mertkahyaoglu/atom,NunoEdgarGub1/atom,sekcheong/atom,ezeoleaf/atom,abcP9110/atom,deoxilix/atom,Dennis1978/atom,Ingramz/atom,Austen-G/BlockBuilder,ObviouslyGreen/atom,john-kelly/atom,scv119/atom,AlisaKiatkongkumthon/atom,paulcbetts/atom,Austen-G/BlockBuilder,Austen-G/BlockBuilder,pkdevbox/atom,gisenberg/atom,john-kelly/atom,panuchart/atom,hpham04/atom,fscherwi/atom,andrewleverette/atom,Jandersoft/atom,kdheepak89/atom,KENJU/atom,rjattrill/atom,dkfiresky/atom,jeremyramin/atom,sotayamashita/atom,tisu2tisu/atom,andrewleverette/atom,pkdevbox/atom,brettle/atom,chfritz/atom,abcP9110/atom,basarat/atom,Jdesk/atom,toqz/atom,GHackAnonymous/atom,harshdattani/atom,panuchart/atom,t9md/atom,devmario/atom,tanin47/atom,nucked/atom,prembasumatary/atom,basarat/atom,dijs/atom,gontadu/atom,rlugojr/atom,fang-yufeng/atom,scv119/atom,BogusCurry/atom,BogusCurry/atom,Shekharrajak/atom,yomybaby/atom,g2p/atom,G-Baby/atom,splodingsocks/atom,wiggzz/atom,dannyflax/atom,G-Baby/atom,jeremyramin/atom,g2p/atom,mostafaeweda/atom,constanzaurzua/atom,fedorov/atom,mdumrauf/atom,bcoe/atom,targeter21/atom,stinsonga/atom,BogusCurry/atom,codex8/atom,ali/atom,PKRoma/atom,hharchani/atom,Jandersolutions/atom,scippio/atom,liuxiong332/atom,bcoe/atom,charleswhchan/atom,tony612/atom,originye/atom,jeremyramin/atom,bsmr-x-script/atom,Hasimir/atom,Rychard/atom,sebmck/atom,synaptek/atom,helber/atom,davideg/atom,Ju2ender/atom,hpham04/atom,crazyquark/atom,qskycolor/atom,Sangaroonaom/atom,deepfox/atom,Neron-X5/atom,charleswhchan/atom,einarmagnus/atom,einarmagnus/atom,sillvan/atom,Rychard/atom,bryonwinger/atom,abcP9110/atom,bsmr-x-script/atom,Neron-X5/atom,codex8/atom,Hasimir/atom,YunchengLiao/atom,Ju2ender/atom,fedorov/atom,panuchart/atom,AlbertoBarrago/atom,anuwat121/atom,constanzaurzua/atom,sekcheong/atom,Neron-X5/atom,originye/atom,ivoadf/atom,woss/atom,charleswhchan/atom,rsvip/aTom,prembasumatary/atom,dsandstrom/atom,NunoEdgarGub1/atom,ilovezy/atom
93543c3b2cb2319eb9357e74e0a0b468e3f51524
scripts/test-instance/instance-ami.coffee
scripts/test-instance/instance-ami.coffee
module.exports = current: 'ami-cc7842a4' # Ordered by creation date list: [ 'ami-f464e69c' 'ami-66bbca0e' 'ami-e06c2488' 'ami-c4c397ac' 'ami-cc7842a4' ]
module.exports = current: 'ami-10465678' # Ordered by creation date list: [ 'ami-f464e69c' 'ami-66bbca0e' 'ami-e06c2488' 'ami-c4c397ac' 'ami-cc7842a4' 'ami-10465678' ]
Update test instance to AMI v6
Update test instance to AMI v6
CoffeeScript
agpl-3.0
rjeczalik/koding,szkl/koding,drewsetski/koding,cihangir/koding,drewsetski/koding,alex-ionochkin/koding,gokmen/koding,drewsetski/koding,alex-ionochkin/koding,jack89129/koding,koding/koding,drewsetski/koding,rjeczalik/koding,sinan/koding,cihangir/koding,gokmen/koding,cihangir/koding,acbodine/koding,andrewjcasal/koding,gokmen/koding,kwagdy/koding-1,jack89129/koding,gokmen/koding,andrewjcasal/koding,usirin/koding,drewsetski/koding,rjeczalik/koding,andrewjcasal/koding,koding/koding,cihangir/koding,alex-ionochkin/koding,gokmen/koding,gokmen/koding,rjeczalik/koding,koding/koding,szkl/koding,cihangir/koding,andrewjcasal/koding,mertaytore/koding,sinan/koding,jack89129/koding,koding/koding,acbodine/koding,sinan/koding,koding/koding,sinan/koding,acbodine/koding,mertaytore/koding,jack89129/koding,kwagdy/koding-1,acbodine/koding,usirin/koding,mertaytore/koding,andrewjcasal/koding,mertaytore/koding,alex-ionochkin/koding,szkl/koding,alex-ionochkin/koding,acbodine/koding,drewsetski/koding,rjeczalik/koding,gokmen/koding,usirin/koding,alex-ionochkin/koding,kwagdy/koding-1,koding/koding,szkl/koding,andrewjcasal/koding,rjeczalik/koding,alex-ionochkin/koding,drewsetski/koding,sinan/koding,alex-ionochkin/koding,andrewjcasal/koding,szkl/koding,koding/koding,acbodine/koding,usirin/koding,sinan/koding,usirin/koding,sinan/koding,jack89129/koding,acbodine/koding,andrewjcasal/koding,drewsetski/koding,kwagdy/koding-1,cihangir/koding,gokmen/koding,kwagdy/koding-1,jack89129/koding,rjeczalik/koding,kwagdy/koding-1,sinan/koding,szkl/koding,usirin/koding,cihangir/koding,mertaytore/koding,cihangir/koding,jack89129/koding,koding/koding,mertaytore/koding,mertaytore/koding,jack89129/koding,usirin/koding,mertaytore/koding,acbodine/koding,szkl/koding,kwagdy/koding-1,szkl/koding,kwagdy/koding-1,rjeczalik/koding,usirin/koding
dcd0853c4ef90d8dfec71c9a6f348ef06d60ae3f
server/configuration/accounts_meld.coffee
server/configuration/accounts_meld.coffee
orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService Accounts.updateOrCreateUserFromExternalService = (serviceName, serviceData, options) -> if serviceName not in ['facebook', 'github', 'gitlab', 'google', 'meteor-developer', 'linkedin', 'twitter'] return if serviceName is 'meteor-developer' if _.isArray serviceData?.emails serviceData.emails.sort (a, b) -> return a.primary isnt true for email in serviceData.emails if email.verified is true serviceData.email = email.address break if serviceName is 'linkedin' serviceData.email = serviceData.emailAddress if serviceData.email # Remove not verified users that have same email notVerifiedUser = Meteor.users.remove({emails: {$elemMatch: {address: serviceData.email, verified: false}}}) # Try to get existent user with same email verified user = Meteor.users.findOne({emails: {$elemMatch: {address: serviceData.email, verified: true}}}) if user? serviceIdKey = "services." + serviceName + ".id" update = {} update[serviceIdKey] = serviceData.id Meteor.users.update({ _id: user._id }, { $set: update }) return orig_updateOrCreateUserFromExternalService.apply(this, arguments)
orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService Accounts.updateOrCreateUserFromExternalService = (serviceName, serviceData, options) -> if serviceName not in ['facebook', 'github', 'google', 'meteor-developer', 'linkedin', 'twitter'] and serviceData._oAuthCustom isnt true return if serviceName is 'meteor-developer' if _.isArray serviceData?.emails serviceData.emails.sort (a, b) -> return a.primary isnt true for email in serviceData.emails if email.verified is true serviceData.email = email.address break if serviceName is 'linkedin' serviceData.email = serviceData.emailAddress if serviceData.email # Remove not verified users that have same email notVerifiedUser = Meteor.users.remove({emails: {$elemMatch: {address: serviceData.email, verified: false}}}) # Try to get existent user with same email verified user = Meteor.users.findOne({emails: {$elemMatch: {address: serviceData.email, verified: true}}}) if user? serviceIdKey = "services." + serviceName + ".id" update = {} update[serviceIdKey] = serviceData.id Meteor.users.update({ _id: user._id }, { $set: update }) return orig_updateOrCreateUserFromExternalService.apply(this, arguments)
Allow login from custom oAuth in accounts meld
Allow login from custom oAuth in accounts meld
CoffeeScript
mit
cnash/Rocket.Chat,Codebrahma/Rocket.Chat,lonbaker/Rocket.Chat,snaiperskaya96/Rocket.Chat,HeapCity/Heap.City,LearnersGuild/echo-chat,wtsarchive/Rocket.Chat,mccambridge/Rocket.Chat,lonbaker/Rocket.Chat,ndarilek/Rocket.Chat,Kiran-Rao/Rocket.Chat,atyenoria/Rocket.Chat,haoyixin/Rocket.Chat,pitamar/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,JamesHGreen/Rocket.Chat,capensisma/Rocket.Chat,matthewshirley/Rocket.Chat,mccambridge/Rocket.Chat,erikmaarten/Rocket.Chat,AimenJoe/Rocket.Chat,Dianoga/Rocket.Chat,rasata/Rocket.Chat,org100h1/Rocket.Panda,alenodari/Rocket.Chat,jeann2013/Rocket.Chat,karlprieb/Rocket.Chat,k0nsl/Rocket.Chat,xasx/Rocket.Chat,sunhaolin/Rocket.Chat,OtkurBiz/Rocket.Chat,steedos/chat,alenodari/Rocket.Chat,umeshrs/rocket-chat,tradetiger/Rocket.Chat,cdwv/Rocket.Chat,ndarilek/Rocket.Chat,haoyixin/Rocket.Chat,Sing-Li/Rocket.Chat,umeshrs/rocket-chat,NMandapaty/Rocket.Chat,sikofitt/Rocket.Chat,abduljanjua/TheHub,danielbressan/Rocket.Chat,Gudii/Rocket.Chat,bopjesvla/chatmafia,acaronmd/Rocket.Chat,tzellman/Rocket.Chat,psadaic/Rocket.Chat,Flitterkill/Rocket.Chat,fduraibi/Rocket.Chat,timkinnane/Rocket.Chat,matthewshirley/Rocket.Chat,florinnichifiriuc/Rocket.Chat,subesokun/Rocket.Chat,ziedmahdi/Rocket.Chat,pachox/Rocket.Chat,BHWD/noouchat,jonathanhartman/Rocket.Chat,williamfortunademoraes/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,JamesHGreen/Rocket_API,karlprieb/Rocket.Chat,NMandapaty/Rocket.Chat,NMandapaty/Rocket.Chat,OtkurBiz/Rocket.Chat,mitar/Rocket.Chat,ealbers/Rocket.Chat,KyawNaingTun/Rocket.Chat,nathantreid/Rocket.Chat,BorntraegerMarc/Rocket.Chat,webcoding/Rocket.Chat,abhishekshukla0302/trico,LeonardOliveros/Rocket.Chat,florinnichifiriuc/Rocket.Chat,mhurwi/Rocket.Chat,LeonardOliveros/Rocket.Chat,nathantreid/Rocket.Chat,nishimaki10/Rocket.Chat,umeshrs/rocket-chat-integration,webcoding/Rocket.Chat,bopjesvla/chatmafia,jadeqwang/Rocket.Chat,Maysora/Rocket.Chat,christmo/Rocket.Chat,Jandersoft/Rocket.Chat,4thParty/Rocket.Chat,4thParty/Rocket.Chat,klatys/Rocket.Chat,mrsimpson/Rocket.Chat,linnovate/hi,AlecTroemel/Rocket.Chat,I-am-Gabi/Rocket.Chat,coreyaus/Rocket.Chat,ndarilek/Rocket.Chat,Codebrahma/Rocket.Chat,ut7/Rocket.Chat,celloudiallo/Rocket.Chat,Dianoga/Rocket.Chat,abhishekshukla0302/trico,k0nsl/Rocket.Chat,TribeMedia/Rocket.Chat,steedos/chat,jbsavoy18/rocketchat-1,berndsi/Rocket.Chat,qnib/Rocket.Chat,Achaikos/Rocket.Chat,NMandapaty/Rocket.Chat,snaiperskaya96/Rocket.Chat,tlongren/Rocket.Chat,JamesHGreen/Rocket_API,cnash/Rocket.Chat,bt/Rocket.Chat,abduljanjua/TheHub,Achaikos/Rocket.Chat,timkinnane/Rocket.Chat,Jandersoft/Rocket.Chat,mwharrison/Rocket.Chat,VoiSmart/Rocket.Chat,arvi/Rocket.Chat,yuyixg/Rocket.Chat,jeann2013/Rocket.Chat,mwharrison/Rocket.Chat,pitamar/Rocket.Chat,acidsound/Rocket.Chat,timkinnane/Rocket.Chat,parkmap/Rocket.Chat,acidicX/Rocket.Chat,mwharrison/Rocket.Chat,klatys/Rocket.Chat,nrhubbar/Rocket.Chat,intelradoux/Rocket.Chat,klatys/Rocket.Chat,galrotem1993/Rocket.Chat,Gudii/Rocket.Chat,marzieh312/Rocket.Chat,xasx/Rocket.Chat,ut7/Rocket.Chat,wtsarchive/Rocket.Chat,liuliming2008/Rocket.Chat,apnero/tactixteam,florinnichifiriuc/Rocket.Chat,tntobias/Rocket.Chat,jeanmatheussouto/Rocket.Chat,Maysora/Rocket.Chat,org100h1/Rocket.Panda,ggazzo/Rocket.Chat,wicked539/Rocket.Chat,Maysora/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,steedos/chat,PavelVanecek/Rocket.Chat,ut7/Rocket.Chat,nrhubbar/Rocket.Chat,warcode/Rocket.Chat,nabiltntn/Rocket.Chat,celloudiallo/Rocket.Chat,PavelVanecek/Rocket.Chat,Deepakkothandan/Rocket.Chat,ggazzo/Rocket.Chat,lukaroski/traden,jbsavoy18/rocketchat-1,mrsimpson/Rocket.Chat,pkgodara/Rocket.Chat,matthewshirley/Rocket.Chat,cdwv/Rocket.Chat,ndarilek/Rocket.Chat,wangleihd/Rocket.Chat,nabiltntn/Rocket.Chat,acidsound/Rocket.Chat,capensisma/Rocket.Chat,steedos/chat,christmo/Rocket.Chat,acaronmd/Rocket.Chat,snaiperskaya96/Rocket.Chat,bt/Rocket.Chat,apnero/tactixteam,lukaroski/traden,icaromh/Rocket.Chat,Kiran-Rao/Rocket.Chat,lukaroski/traden,mrinaldhar/Rocket.Chat,mwharrison/Rocket.Chat,Deepakkothandan/Rocket.Chat,flaviogrossi/Rocket.Chat,inoxth/Rocket.Chat,alenodari/Rocket.Chat,inoxth/Rocket.Chat,yuyixg/Rocket.Chat,jadeqwang/Rocket.Chat,Jandersolutions/Rocket.Chat,inoxth/Rocket.Chat,celloudiallo/Rocket.Chat,biomassives/Rocket.Chat,ziedmahdi/Rocket.Chat,liuliming2008/Rocket.Chat,pitamar/Rocket.Chat,fatihwk/Rocket.Chat,Sing-Li/Rocket.Chat,BorntraegerMarc/Rocket.Chat,haoyixin/Rocket.Chat,Kiran-Rao/Rocket.Chat,warcode/Rocket.Chat,TribeMedia/Rocket.Chat,liuliming2008/Rocket.Chat,mrinaldhar/Rocket.Chat,yuyixg/Rocket.Chat,jessedhillon/Rocket.Chat,BHWD/noouchat,himeshp/Rocket.Chat,capensisma/Rocket.Chat,LearnersGuild/echo-chat,igorstajic/Rocket.Chat,soonahn/Rocket.Chat,AimenJoe/Rocket.Chat,xasx/Rocket.Chat,KyawNaingTun/Rocket.Chat,intelradoux/Rocket.Chat,bopjesvla/chatmafia,icaromh/Rocket.Chat,HeapCity/Heap.City,Achaikos/Rocket.Chat,Flitterkill/Rocket.Chat,xboston/Rocket.Chat,ZBoxApp/Rocket.Chat,abhishekshukla0302/trico,fduraibi/Rocket.Chat,Deepakkothandan/Rocket.Chat,wicked539/Rocket.Chat,JisuPark/Rocket.Chat,acaronmd/Rocket.Chat,amaapp/ama,flaviogrossi/Rocket.Chat,revspringjake/Rocket.Chat,soonahn/Rocket.Chat,yuyixg/Rocket.Chat,mohamedhagag/Rocket.Chat,arvi/Rocket.Chat,PavelVanecek/Rocket.Chat,fatihwk/Rocket.Chat,matthewshirley/Rocket.Chat,arvi/Rocket.Chat,igorstajic/Rocket.Chat,bt/Rocket.Chat,abhishekshukla0302/trico,Dianoga/Rocket.Chat,amaapp/ama,jadeqwang/Rocket.Chat,jeann2013/Rocket.Chat,uniteddiversity/Rocket.Chat,LearnersGuild/Rocket.Chat,xboston/Rocket.Chat,jeanmatheussouto/Rocket.Chat,subesokun/Rocket.Chat,mhurwi/Rocket.Chat,jbsavoy18/rocketchat-1,Flitterkill/Rocket.Chat,galrotem1993/Rocket.Chat,LearnersGuild/Rocket.Chat,lucasgolino/Rocket.Chat,inoxth/Rocket.Chat,Sing-Li/Rocket.Chat,AlecTroemel/Rocket.Chat,ealbers/Rocket.Chat,lucasgolino/Rocket.Chat,anhld/Rocket.Chat,acidicX/Rocket.Chat,abduljanjua/TheHub,danielbressan/Rocket.Chat,Gudii/Rocket.Chat,nishimaki10/Rocket.Chat,ealbers/Rocket.Chat,ziedmahdi/Rocket.Chat,JamesHGreen/Rocket_API,OtkurBiz/Rocket.Chat,mrinaldhar/Rocket.Chat,thunderrabbit/Rocket.Chat,Sing-Li/Rocket.Chat,sunhaolin/Rocket.Chat,qnib/Rocket.Chat,BHWD/noouchat,Achaikos/Rocket.Chat,lucasgolino/Rocket.Chat,revspringjake/Rocket.Chat,HeapCity/Heap.City,I-am-Gabi/Rocket.Chat,lukaroski/traden,wtsarchive/Rocket.Chat,tlongren/Rocket.Chat,nishimaki10/Rocket.Chat,adamteece/Rocket.Chat,pachox/Rocket.Chat,Codebrahma/Rocket.Chat,apnero/tactixteam,karlprieb/Rocket.Chat,pitamar/Rocket.Chat,LearnersGuild/Rocket.Chat,anhld/Rocket.Chat,rasata/Rocket.Chat,AlecTroemel/Rocket.Chat,JamesHGreen/Rocket.Chat,BorntraegerMarc/Rocket.Chat,ziedmahdi/Rocket.Chat,fduraibi/Rocket.Chat,jonathanhartman/Rocket.Chat,Gyubin/Rocket.Chat,wtsarchive/Rocket.Chat,linnovate/hi,xboston/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,alexbrazier/Rocket.Chat,cnash/Rocket.Chat,pachox/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,JamesHGreen/Rocket.Chat,mrsimpson/Rocket.Chat,kkochubey1/Rocket.Chat,rasata/Rocket.Chat,4thParty/Rocket.Chat,gitaboard/Rocket.Chat,gitaboard/Rocket.Chat,Jandersoft/Rocket.Chat,TribeMedia/Rocket.Chat,Gudii/Rocket.Chat,intelradoux/Rocket.Chat,psadaic/Rocket.Chat,galrotem1993/Rocket.Chat,Gyubin/Rocket.Chat,tzellman/Rocket.Chat,mrsimpson/Rocket.Chat,coreyaus/Rocket.Chat,org100h1/Rocket.Panda,AlecTroemel/Rocket.Chat,tntobias/Rocket.Chat,coreyaus/Rocket.Chat,Movile/Rocket.Chat,BorntraegerMarc/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,acidicX/Rocket.Chat,TribeMedia/Rocket.Chat,ut7/Rocket.Chat,atyenoria/Rocket.Chat,igorstajic/Rocket.Chat,xboston/Rocket.Chat,alexbrazier/Rocket.Chat,tntobias/Rocket.Chat,himeshp/Rocket.Chat,AimenJoe/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,Deepakkothandan/Rocket.Chat,christmo/Rocket.Chat,berndsi/Rocket.Chat,nabiltntn/Rocket.Chat,liuliming2008/Rocket.Chat,LearnersGuild/Rocket.Chat,pkgodara/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,k0nsl/Rocket.Chat,himeshp/Rocket.Chat,biomassives/Rocket.Chat,pkgodara/Rocket.Chat,ealbers/Rocket.Chat,revspringjake/Rocket.Chat,jeanmatheussouto/Rocket.Chat,cdwv/Rocket.Chat,LeonardOliveros/Rocket.Chat,jessedhillon/Rocket.Chat,marzieh312/Rocket.Chat,Kiran-Rao/Rocket.Chat,jbsavoy18/rocketchat-1,litewhatever/Rocket.Chat,umeshrs/rocket-chat-integration,thunderrabbit/Rocket.Chat,VoiSmart/Rocket.Chat,mrinaldhar/Rocket.Chat,wicked539/Rocket.Chat,LeonardOliveros/Rocket.Chat,timkinnane/Rocket.Chat,Dianoga/Rocket.Chat,williamfortunademoraes/Rocket.Chat,erikmaarten/Rocket.Chat,wicked539/Rocket.Chat,JisuPark/Rocket.Chat,ahmadassaf/Rocket.Chat,AimenJoe/Rocket.Chat,inoio/Rocket.Chat,org100h1/Rocket.Panda,flaviogrossi/Rocket.Chat,mohamedhagag/Rocket.Chat,biomassives/Rocket.Chat,soonahn/Rocket.Chat,Movile/Rocket.Chat,litewhatever/Rocket.Chat,alexbrazier/Rocket.Chat,4thParty/Rocket.Chat,JisuPark/Rocket.Chat,galrotem1993/Rocket.Chat,I-am-Gabi/Rocket.Chat,sikofitt/Rocket.Chat,ggazzo/Rocket.Chat,marzieh312/Rocket.Chat,thunderrabbit/Rocket.Chat,webcoding/Rocket.Chat,cdwv/Rocket.Chat,igorstajic/Rocket.Chat,klatys/Rocket.Chat,k0nsl/Rocket.Chat,ahmadassaf/Rocket.Chat,ZBoxApp/Rocket.Chat,haoyixin/Rocket.Chat,Flitterkill/Rocket.Chat,mitar/Rocket.Chat,pachox/Rocket.Chat,danielbressan/Rocket.Chat,litewhatever/Rocket.Chat,ggazzo/Rocket.Chat,mohamedhagag/Rocket.Chat,mccambridge/Rocket.Chat,danielbressan/Rocket.Chat,JamesHGreen/Rocket.Chat,Gyubin/Rocket.Chat,tlongren/Rocket.Chat,fatihwk/Rocket.Chat,bt/Rocket.Chat,Movile/Rocket.Chat,inoio/Rocket.Chat,Gyubin/Rocket.Chat,litewhatever/Rocket.Chat,tntobias/Rocket.Chat,tradetiger/Rocket.Chat,fatihwk/Rocket.Chat,jonathanhartman/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,soonahn/Rocket.Chat,mitar/Rocket.Chat,psadaic/Rocket.Chat,mhurwi/Rocket.Chat,KyawNaingTun/Rocket.Chat,icaromh/Rocket.Chat,mccambridge/Rocket.Chat,nathantreid/Rocket.Chat,flaviogrossi/Rocket.Chat,fduraibi/Rocket.Chat,uniteddiversity/Rocket.Chat,kkochubey1/Rocket.Chat,intelradoux/Rocket.Chat,snaiperskaya96/Rocket.Chat,nishimaki10/Rocket.Chat,kkochubey1/Rocket.Chat,sikofitt/Rocket.Chat,ZBoxApp/Rocket.Chat,alexbrazier/Rocket.Chat,tzellman/Rocket.Chat,umeshrs/rocket-chat-integration,OtkurBiz/Rocket.Chat,amaapp/ama,xasx/Rocket.Chat,karlprieb/Rocket.Chat,JamesHGreen/Rocket_API,Jandersolutions/Rocket.Chat,gitaboard/Rocket.Chat,PavelVanecek/Rocket.Chat,adamteece/Rocket.Chat,mitar/Rocket.Chat,ahmadassaf/Rocket.Chat,amaapp/ama,qnib/Rocket.Chat,tradetiger/Rocket.Chat,subesokun/Rocket.Chat,jessedhillon/Rocket.Chat,nrhubbar/Rocket.Chat,sunhaolin/Rocket.Chat,marzieh312/Rocket.Chat,Jandersolutions/Rocket.Chat,lonbaker/Rocket.Chat,tlongren/Rocket.Chat,wangleihd/Rocket.Chat,LearnersGuild/echo-chat,subesokun/Rocket.Chat,abduljanjua/TheHub,parkmap/Rocket.Chat,qnib/Rocket.Chat,wangleihd/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,adamteece/Rocket.Chat,erikmaarten/Rocket.Chat,berndsi/Rocket.Chat,Movile/Rocket.Chat,anhld/Rocket.Chat,pkgodara/Rocket.Chat,warcode/Rocket.Chat,LearnersGuild/echo-chat,ahmadassaf/Rocket.Chat,umeshrs/rocket-chat,cnash/Rocket.Chat,parkmap/Rocket.Chat,acaronmd/Rocket.Chat,uniteddiversity/Rocket.Chat,atyenoria/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,jonathanhartman/Rocket.Chat,mhurwi/Rocket.Chat,VoiSmart/Rocket.Chat,williamfortunademoraes/Rocket.Chat,inoio/Rocket.Chat,acidsound/Rocket.Chat
12c28fe32dbc1b9b86bed51c581350f76a738279
app/assets/javascripts/prevent_double_submission.js.coffee
app/assets/javascripts/prevent_double_submission.js.coffee
App.PreventDoubleSubmission = disable_buttons: (buttons) -> setTimeout -> buttons.each -> button = $(this) unless button.hasClass('disabled') loading = button.data('loading') ? '...' button.addClass('disabled').attr('disabled', 'disabled') button.data('text', button.val()) button.val(loading) , 1 reset_buttons: (buttons) -> buttons.each -> button = $(this) if button.hasClass('disabled') button_text = button.data('text') button.removeClass('disabled').attr('disabled', null) if button_text button.val(button_text) button.data('text', null) initialize: -> $('form').on('submit', event, -> buttons = $(this).find(':button, :submit') App.PreventDoubleSubmission.disable_buttons(buttons) ).on('ajax:success', -> buttons = $(this).find(':button, :submit') App.PreventDoubleSubmission.reset_buttons(buttons) ) false
App.PreventDoubleSubmission = disable_buttons: (buttons) -> setTimeout -> buttons.each -> button = $(this) unless button.hasClass('disabled') loading = button.data('loading') ? '...' button.addClass('disabled').attr('disabled', 'disabled') button.data('text', button.val()) button.val(loading) , 1 reset_buttons: (buttons) -> buttons.each -> button = $(this) if button.hasClass('disabled') button_text = button.data('text') button.removeClass('disabled').attr('disabled', null) if button_text button.val(button_text) button.data('text', null) initialize: -> $('form').on('submit', (event) -> buttons = $(this).find(':button, :submit') App.PreventDoubleSubmission.disable_buttons(buttons) ).on('ajax:success', -> buttons = $(this).find(':button, :submit') App.PreventDoubleSubmission.reset_buttons(buttons) ) false
Fix double-submission prevention not working.
Fix double-submission prevention not working.
CoffeeScript
agpl-3.0
consul/consul,Terciar/consul,AjuntamentdeBarcelona/barcelona-participa,AyuntamientoPuertoReal/decidePuertoReal,xJakub/consul,amiedes/consul,Terciar/consul,deivid-rodriguez/participacion,AjuntamentdeBarcelona/decidimbcn,AjuntamentdeBarcelona/decidim.barcelona,AjuntamentdeBarcelona/decidim.barcelona-legacy,PeoplesMomentum/consul,AjuntamentdeCastello/consul,AjuntamentdeBarcelona/decidim.barcelona,Terciar/consul,AyuntamientoMadrid/consul,Ana06/consul,lalibertad/consul,AyuntamientoPuertoReal/decidePuertoReal,AjuntamentdeCastello/consul,alejanderl/participacion,AyuntamientoMadrid/participacion,AjuntamentdeBarcelona/decidim.barcelona-legacy,jjballano/participacion,hugobarthelemy/consul,amiedes/consul,xJakub/consul,jjballano/participacion,consul/consul,PeoplesMomentum/consul,Endika/participacion,artofhuman/consul,artofhuman/consul,hugobarthelemy/consul,AjuntamentdeCastello/consul,usabi/consul_san_borondon,AjuntamentdeBarcelona/decidimbcn,AjuntamentdeBarcelona/decidim.barcelona-legacy,consul/consul,deivid-rodriguez/participacion,hugobarthelemy/consul,amiedes/consul,CDJ11/CDJ,votedevin/consul,Endika/participacion,lalibertad/consul,votedevin/consul,consul/consul,hugobarthelemy/consul,deivid-rodriguez/participacion,AyuntamientoMadrid/participacion,PeoplesMomentum/consul,CDJ11/CDJ,AjuntamentdeBarcelona/decidimbcn,AyuntamientoMadrid/participacion,Ana06/consul,PeoplesMomentum/consul,CDJ11/CDJ,artofhuman/consul,AjuntamentdeBarcelona/decidim.barcelona-legacy,Ana06/consul,AjuntamentdeBarcelona/barcelona-participa,jjballano/participacion,AyuntamientoMadrid/consul,usabi/consul_san_borondon,lalibertad/consul,CDJ11/CDJ,Endika/participacion,AjuntamentdeCastello/consul,AyuntamientoMadrid/consul,alejanderl/participacion,AjuntamentdeBarcelona/barcelona-participa,usabi/consul_san_borondon,xJakub/consul,alejanderl/participacion,deivid-rodriguez/participacion,AjuntamentdeBarcelona/decidim.barcelona,Terciar/consul,xJakub/consul,AyuntamientoPuertoReal/decidePuertoReal,consul/consul,AyuntamientoMadrid/participacion,lalibertad/consul,Endika/participacion,usabi/consul_san_borondon,alejanderl/participacion,AjuntamentdeBarcelona/decidim.barcelona,votedevin/consul,Ana06/consul,jjballano/participacion,AyuntamientoMadrid/consul
6afc3c4e1f84c06a2c4f7e779678b6ec79e727ec
app/assets/javascripts/controllers/message_task_controller.js.coffee
app/assets/javascripts/controllers/message_task_controller.js.coffee
ETahi.MessageTaskController = ETahi.TaskController.extend newCommentBody: "" actions: clearMessageContent: -> null postComment: -> commentFields = body: @get('newCommentBody') newComment = @store.createRecord('comment', commentFields)
ETahi.MessageTaskController = ETahi.TaskController.extend newCommentBody: "" actions: clearMessageContent: -> null postComment: -> userId = Tahi.currentUser.id.toString() commenter = @store.all('user').findBy('id', userId) commentFields = commenter: commenter messageTask: @get('model') body: @get('newCommentBody') newComment = @store.createRecord('comment', commentFields)
Add comments in memory on click.
Add comments in memory on click.
CoffeeScript
mit
johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi
6775a62e781054d767a8b1fd07add30b3dc478b4
src/null-grammar.coffee
src/null-grammar.coffee
Grammar = require './grammar' # A grammar with no patterns that is always available module.exports = class NullGrammar extends Grammar constructor: (registry) -> name = 'Null Grammar' scopeName = 'text.plain.null-grammar' super(registry, {name, scopeName}) getScore: -> 0
Grammar = require './grammar' # A grammar with no patterns that is always available from a {GrammarRegistry} module.exports = class NullGrammar extends Grammar constructor: (registry) -> name = 'Null Grammar' scopeName = 'text.plain.null-grammar' super(registry, {name, scopeName}) getScore: -> 0
Clarify where this is available
Clarify where this is available
CoffeeScript
mit
soldair/first-mate,Talon1024/first-mate,klorenz/first-mate-manual-fork,burodepeper/first-mate,wiggzz/first-mate,hansonw/first-mate,atom/first-mate,rameshvarun/first-mate
9199b7ffa99d442c8b0729f0dc1724fdc26ddfea
src/crash-reporter-start.coffee
src/crash-reporter-start.coffee
module.exports = (extra) -> {crashReporter} = require 'electron' crashReporter.start({ productName: 'Atom', companyName: 'GitHub', submitURL: 'http://54.249.141.255:1127/post' extra: extra })
module.exports = (extra) -> {crashReporter} = require 'electron' crashReporter.start({ productName: 'Atom', companyName: 'GitHub', autoSubmit: false, extra: extra })
Disable autosubmit of crash reporter
Disable autosubmit of crash reporter
CoffeeScript
mit
liuderchi/atom,stinsonga/atom,CraZySacX/atom,t9md/atom,andrewleverette/atom,Mokolea/atom,FIT-CSE2410-A-Bombs/atom,helber/atom,ardeshirj/atom,atom/atom,helber/atom,AdrianVovk/substance-ide,kevinrenaers/atom,decaffeinate-examples/atom,rlugojr/atom,liuderchi/atom,kevinrenaers/atom,PKRoma/atom,Ingramz/atom,xream/atom,Arcanemagus/atom,gontadu/atom,sotayamashita/atom,xream/atom,PKRoma/atom,me-benni/atom,ardeshirj/atom,CraZySacX/atom,stinsonga/atom,PKRoma/atom,Ingramz/atom,kevinrenaers/atom,atom/atom,bolinfest/atom,gontadu/atom,liuderchi/atom,xream/atom,FIT-CSE2410-A-Bombs/atom,AdrianVovk/substance-ide,decaffeinate-examples/atom,sotayamashita/atom,andrewleverette/atom,brettle/atom,t9md/atom,Mokolea/atom,liuderchi/atom,ardeshirj/atom,tjkr/atom,bsmr-x-script/atom,brettle/atom,andrewleverette/atom,CraZySacX/atom,me-benni/atom,rlugojr/atom,Arcanemagus/atom,Arcanemagus/atom,Mokolea/atom,brettle/atom,brumm/atom,t9md/atom,decaffeinate-examples/atom,sotayamashita/atom,bolinfest/atom,atom/atom,AdrianVovk/substance-ide,AlexxNica/atom,decaffeinate-examples/atom,bolinfest/atom,bsmr-x-script/atom,bsmr-x-script/atom,tjkr/atom,AlexxNica/atom,brumm/atom,FIT-CSE2410-A-Bombs/atom,AlexxNica/atom,gontadu/atom,Ingramz/atom,stinsonga/atom,me-benni/atom,brumm/atom,helber/atom,stinsonga/atom,tjkr/atom,rlugojr/atom
983e8c2788c64fbb9779dc58090bb563c2c01dae
src/coffee/storylet.coffee
src/coffee/storylet.coffee
class Storylet constructor: (@id, @title, @text, @choices, @frontFacingChoice) -> Object.freeze @ isVisibleWith: (qualityLibrary) -> frontFacingChoice?.isVisibleWith qualityLibrary class Choice constructor: (@title, @text, @visibleReqs, @activeReqs, @next) -> reqsAreMet = (reqs, qualityLibrary) -> for qualityName, predicate of reqs quality = qualityLibrary.resolve qualityName return false unless predicate quality return true isVisibleWith: (qualityLibrary) -> reqsAreMet @visibleReqs, qualityLibrary isActiveWith: (qualityLibrary) -> reqsAreMet @activeReqs, qualityLibrary angular.module 'qbn.storylet', ['qbn.quality'] .factory 'storyletLibrary', (qualityLibrary) -> library = {} api = register: (args...) -> storylet = new Storylet args... library[storylet.id] = storylet # Storylets are stored in immutable form return this # Allow Chaining resolve: (q) -> if q instanceof Storylet q else library[q.toString()] getAllFrontFacing: () -> storylet for _, storylet of library when storylet.isVisibleWith qualityLibrary return Object.freeze api .factory 'choiceFactory', () -> (args...) -> new Choice args...
class Storylet constructor: (@id, @title, @text, @choices, @frontFacingChoice) -> Object.freeze @ isVisibleWith: (qualityLibrary) -> frontFacingChoice?.isVisibleWith qualityLibrary class Choice constructor: (@title, @text, @visibleReqs, @activeReqs, @next) -> reqsAreMet = (reqs, qualityLibrary) -> for qualityName, predicate of reqs quality = qualityLibrary.resolve qualityName return false unless predicate quality return true isVisibleWith: (qualityLibrary) -> reqsAreMet @visibleReqs, qualityLibrary isActiveWith: (qualityLibrary) -> reqsAreMet @activeReqs, qualityLibrary angular.module 'qbn.storylet', ['qbn.state', 'qbn.quality'] .factory 'storyletLibrary', (makeGameState, qualityLibrary) -> library = {} api = register: (args...) -> storylet = new Storylet args... library[storylet.id] = storylet # Storylets are stored in immutable form return this # Allow Chaining resolve: (q) -> if q instanceof Storylet q else library[q.toString()] getAllFrontFacing: () -> for _, storylet of library when storylet.isVisibleWith qualityLibrary stateStorylet = makeGameState storylet stateStorylet.canRetreat = true stateStorylet return Object.freeze api .factory 'choiceFactory', () -> (args...) -> new Choice args...
Make Front-Facing Storylets Retreatable By Default
Make Front-Facing Storylets Retreatable By Default
CoffeeScript
unlicense
arashikou/exper3-2015
0bca69f34de1ea0512e64a5bd479a0c2be777d00
src/columns.coffee
src/columns.coffee
Bacon = require('baconjs') moment = require('moment') module.exports = [ { title: 'Name' width: 60 cellContent: (item) -> item.relPath },{ title: 'Date created' width: 20 cellContent: (item) -> moment(item.stats.birthtime).fromNow() },{ title: 'Date modified' width: 20 cellContent: (item) -> moment(item.stats.mtime).fromNow() } ]
Bacon = require('baconjs') moment = require('moment') h = require('virtual-dom/h') Path = require('path') module.exports = [ { title: 'Name' width: 60 cellContent: (item) -> pieces = item.relPath.split(Path.sep) [ h 'span.text-subtle', [ pieces.slice(0, -1).join(Path.sep) Path.sep ] if pieces.length > 1 pieces.slice(-1) ] },{ title: 'Date created' width: 20 cellContent: (item) -> moment(item.stats.birthtime).fromNow() },{ title: 'Date modified' width: 20 cellContent: (item) -> moment(item.stats.mtime).fromNow() } ]
Make file's paths more subtle in listing
:art: Make file's paths more subtle in listing
CoffeeScript
mit
viddo/atom-textual-velocity,viddo/atom-textual-velocity,onezoomin/atom-textual-velocity
80bc717f2c9775dde435d5ee347b229533c81507
lib/assets/javascripts/marbles/middleware/hawk.js.coffee
lib/assets/javascripts/marbles/middleware/hawk.js.coffee
#= require hawk Marbles.HTTP.Middleware.Hawk = class HawkMiddleware constructor: (options = {}) -> options = _.clone(options) unless options.credentials throw new Error("HawkMiddleware: credentials member of options is required!") @credentials = { id: options.credentials.id, key: options.credentials.hawk_key, algorithm: options.credentials.hawk_algorithm } delete options.credentials @options = options processRequest: (http) -> header = hawk.client.header(http.method, http.url, _.extend({ credentials: @credentials payload: http.body }, @options) ).field return unless header http.setHeader('Authorization', header) processResponse: (http, xhr) ->
#= require hawk Marbles.HTTP.Middleware.Hawk = class HawkMiddleware constructor: (options = {}) -> options = _.clone(options) unless options.credentials throw new Error("HawkMiddleware: credentials member of options is required!") @credentials = { id: options.credentials.id, key: options.credentials.hawk_key, algorithm: options.credentials.hawk_algorithm } delete options.credentials @options = options processRequest: (http) -> options = { credentials: @credentials } if http.body options.payload = http.body options.contentType = http.request.request_headers['Content-Type'] header = hawk.client.header(http.url, http.method, _.extend(options, @options) ).field return unless header http.setHeader('Authorization', header) processResponse: (http, xhr) ->
Fix hawk middleware to only add payload hash when there is a request body
Fix hawk middleware to only add payload hash when there is a request body
CoffeeScript
bsd-3-clause
tent/tent-admin
22b67f269c48916107f846c5a65ef59715d43bd8
web/src/views/main-menu.cjsx
web/src/views/main-menu.cjsx
require 'semantic-ui-css/components/icon.css' require 'semantic-ui-css/components/menu.css' require 'semantic-ui-css/components/sidebar.css' require '../../css/menu.css' React = require 'react' module.exports = React.createClass displayName: 'MainMenu' render: -> active = (id) => if @props.page is id 'active item' else 'item' <div className="ui left thin vertical inverted icon labeled sidebar menu"> <div className="header item"> <i className="green home icon"></i> Cache Cache </div> <a className={active 'poi'} onClick={=> @props.setPage 'poi'}> <i className="marker icon"></i> POI Generator </a> <a className={active 'map'} onClick={=> @props.setPage 'map' }> <i className="world icon"></i> Geocache Map </a> </div>
require 'semantic-ui-css/components/icon.css' require 'semantic-ui-css/components/menu.css' require 'semantic-ui-css/components/sidebar.css' require '../../css/menu.css' api = require '../backend.coffee' React = require 'react' module.exports = React.createClass displayName: 'MainMenu' render: -> active = (id) => if @props.page is id 'active item' else 'item' <div className="ui left thin vertical inverted icon labeled sidebar menu"> <div className="header item"> <i className="green home icon"></i> Cache Cache </div> <a className={active 'poi'} onClick={=> @props.setPage 'poi'}> <i className="marker icon"></i> POI Generator </a> <a className={active 'map'} onClick={=> @props.setPage 'map' }> <i className="world icon"></i> Geocache Map </a> <a className="item" href={api.url '/feed'}> <i className="feed icon"></i> Atom feed </a> </div>
Add feed link to menu
Add feed link to menu
CoffeeScript
mit
foobert/gc,foobert/gc,foobert/gc,foobert/gc
78b8bfaa0a56a9bf14f460f51b57bb4d9bb5c38a
test/handmade.coffee
test/handmade.coffee
fs = require 'fs' path = require 'path' assert = require 'assert' valid8 = require '..' random = require './random' buffers = [] test = (buffer)-> buffer = new Buffer buffer unless buffer instanceof Buffer buffers.push buffer = buffer assert valid8 buffer describe 'Empty buffer', -> it 'is valid', -> test 0 describe 'ASCII', -> it 'is valid', -> for i in [0..0x7F] test Buffer [i] test [0x7F..0] describe 'Cyrillic', -> it 'is valid', -> test 'Однажды в студёную зимнюю пору' describe 'Glass', -> it 'is eatable', -> test fs.readFileSync path.join __dirname, 'glass.html' describe 'Coffee', -> it 'is drinkable', -> test fs.readFileSync __filename describe "Buffer", -> it "is inspected entirely", -> for b in buffers assert not valid8 Buffer.concat [ b, new Buffer [random 128, 255] ] assert not valid8 Buffer.concat [ b, new Buffer [random 128, 255], random.pick buffers ]
fs = require 'fs' path = require 'path' assert = require 'assert' valid8 = require '..' random = require './random' buffers = [] test = (buffer)-> buffer = new Buffer buffer unless buffer instanceof Buffer buffers.push buffer = buffer assert valid8 buffer describe 'Empty buffer', -> it 'is valid', -> test 0 describe 'ASCII', -> it 'is valid', -> for i in [0..0x7F] test Buffer [i] test [0x7F..0] describe 'Cyrillic', -> it 'is valid', -> test 'Однажды в студёную зимнюю пору' describe 'Glass', -> it 'is eatable', -> test fs.readFileSync path.join __dirname, 'glass.html' describe 'Coffee', -> it 'is drinkable', -> test fs.readFileSync __filename describe "Pile of poo", -> it "is valid either", -> test "💩" # "\u{1F4A9}" # https://mathiasbynens.be/notes/javascript-unicode describe "Buffer", -> it "is inspected entirely", -> for b in buffers assert not valid8 Buffer.concat [ b, new Buffer [random 128, 255] ] assert not valid8 Buffer.concat [ b, new Buffer [random 128, 255], random.pick buffers ]
Test for pile of poo
Test for pile of poo
CoffeeScript
mit
ukoloff/valid-8
4c23bfe382c8013ac6cc91d8a4f07a7b598c148a
assets/game_state.coffee
assets/game_state.coffee
class GameState customers: [] agents: [] requestQueues: {} chanceOfRequest: 0.005 tickables: [] tick: 0 money: 1000000 reputation: 0.5 agentSpawner: new AgentSpawner() addAgent: (agent) -> @agents.push(agent) @tickables.push(agent) fireAgent: (agent) -> @agents.filter((item) -> item != agent ) removeCustomer: (customer) -> customers.pop(customer) calculateReputation: -> totalWorth = 0 totalRep = 0 for customer in @customers totalRep += customer.mood * customer.worth totalWorth += customer.worth if totalWorth != 0 @reputation = totalRep / totalWorth constructor: -> @level = new Level numberOfRequests: -> requests = 0 for queue of @requestQueues requests += @requestQueues[queue].length() requests toString: -> "Customers: " + @customers.length + "\nRequest queue: " + @numberOfRequests() + "\nReputation: " + (@reputation * 100) + "%" + "\nAgents: " + @agents.join(", ")
class GameState customers: [] agents: [] requestQueues: {} chanceOfRequest: 0.005 tickables: [] tick: 0 money: 1000000 reputation: 0.5 agentSpawner: new AgentSpawner() addAgent: (agent) -> @agents.push(agent) @tickables.push(agent) fireAgent: (agent) -> @agents.filter((item) -> item != agent ) removeCustomer: (customer) -> @customers.filter((item) -> item != customer ) calculateReputation: -> totalWorth = 0 totalRep = 0 for customer in @customers totalRep += customer.mood * customer.worth totalWorth += customer.worth if totalWorth != 0 @reputation = totalRep / totalWorth calculateBudgetChange: -> budget = 0 for agent in @agents budget -= agent.salary for customer in @customers budget += customer.worth budget constructor: -> @level = new Level numberOfRequests: -> requests = 0 for queue of @requestQueues requests += @requestQueues[queue].length() requests toString: -> "Customers: " + @customers.length + "\nMoney: " + @money + " (" + @calculateBudgetChange() + ")" + "\nRequest queue: " + @numberOfRequests() + "\nReputation: " + (@reputation * 100) + "%" + "\nAgents: " + @agents.join(", ")
Add budget and change to left menu
Add budget and change to left menu
CoffeeScript
mit
guts2014/TEAM-NAME-PHP,guts2014/TEAM-NAME-PHP
835b58ad7cae919303b1ad74515a5d3cefe5947b
server/components/indicatorator/indicatorators/ede_indicatorator.coffee
server/components/indicatorator/indicatorators/ede_indicatorator.coffee
fs = require('fs') _ = require('underscore') class EdeIndicatorator constructor: (indicatorType, indicatorCode) -> indicatorType = indicatorType.toLowerCase() @indicatorDefinition = JSON.parse( fs.readFileSync("./definitions/#{indicatorType}_indicator_definitions.json", 'UTF8') )[indicatorCode] indicatorate: (data) -> unless data? throw new Error("No data to indicatorate") valueField = @indicatorDefinition.valueField outputRows = [] for row in data value = row[valueField] continue unless value? text = @calculateIndicatorText(value) outputRows.push(_.extend(row, text: text)) return outputRows calculateIndicatorText: (value) -> value = parseFloat(value) ranges = @indicatorDefinition.ranges for range in ranges return range.message if value > range.minValue return "Error: Value #{value} outside expected range" module.exports = EdeIndicatorator
fs = require('fs') _ = require('underscore') class EdeIndicatorator constructor: (indicatorType, indicatorCode) -> indicatorType = indicatorType.toLowerCase() @indicatorDefinition = JSON.parse( fs.readFileSync( "#{__dirname}/../definitions/#{indicatorType}_indicator_definitions.json", 'UTF8' ) )[indicatorCode] indicatorate: (data) -> unless data? throw new Error("No data to indicatorate") valueField = @indicatorDefinition.valueField outputRows = [] for row in data value = row[valueField] continue unless value? text = @calculateIndicatorText(value) outputRows.push(_.extend(row, text: text)) return outputRows calculateIndicatorText: (value) -> value = parseFloat(value) ranges = @indicatorDefinition.ranges for range in ranges return range.message if value > range.minValue return "Error: Value #{value} outside expected range" module.exports = EdeIndicatorator
Fix relative path broken by module move
Fix relative path broken by module move
CoffeeScript
bsd-3-clause
unepwcmc/NRT,unepwcmc/NRT
b74da697bcaafb0f649e504e0263cb3fddd9e856
src/commentList.coffee
src/commentList.coffee
templateName = 'commentList' TemplateClass = Template[templateName] TemplateClass.created = -> series = @data?.series unless series then throw new Error('No series ID provided for comment list.') @isEditing = new ReactiveVar(false) # Old subscriptions are retained if we need to view the same series later. Meteor.subscribe 'comments', series: series TemplateClass.rendered = -> Collections.observe getCursor(), delayedScrollToBottom.bind(@, @) delayedScrollToBottom(@) TemplateClass.helpers items: -> getCursor() hasItems: -> getCursor().count() > 0 isEditing: -> getTemplate().isEditing.get() TemplateClass.events 'click a.login': -> Router.go('login') 'focus .comment.form': (e, template) -> delayedScrollToBottom(template) scrollToBottom = (template) -> template = getTemplate(template) $commentList = @$('.comment-list') $items = $('.items', $commentList) $innerItems = $('.inner-items', $items) $items.scrollTop $innerItems.height() delayedScrollToBottom = _.debounce scrollToBottom, 300 getCursor = -> Comments.find series: getTemplate().data.series getTemplate = (template) -> Templates.getNamedInstance(templateName, template)
templateName = 'commentList' TemplateClass = Template[templateName] TemplateClass.created = -> series = @data?.series unless series then throw new Error('No series ID provided for comment list.') @isEditing = new ReactiveVar(false) # Old subscriptions are retained if we need to view the same series later. Meteor.subscribe 'comments', series: series TemplateClass.rendered = -> Collections.observe getCursor(), delayedScrollToBottom.bind(@, @) delayedScrollToBottom(@) TemplateClass.helpers items: -> getCursor() hasItems: -> getCursor().count() > 0 isEditing: -> getTemplate().isEditing.get() TemplateClass.events 'click a.login': -> Router.go('login') 'focus .comment.form': (e, template) -> delayedScrollToBottom(template) scrollToBottom = (template) -> template = getTemplate(template) $commentList = @$('.comment-list') $items = $('.items', $commentList) $innerItems = $('.inner-items', $items) $items.scrollTop $innerItems.height() delayedScrollToBottom = _.debounce scrollToBottom, 200 getCursor = -> Comments.find series: getTemplate().data.series getTemplate = (template) -> Templates.getNamedInstance(templateName, template)
Reduce wait time for scroll to bottom
Reduce wait time for scroll to bottom
CoffeeScript
mit
aramk/meteor-comments,aramk/meteor-comments
e23ae4793a16221e71e7b7da3cb414439bdc9e7f
src/defines.coffee
src/defines.coffee
# Defines # ======= define [], () -> 'use strict' defines = # Turn off here to disable entirely (@release). # Off by default for performance. debugging: off # Turn off here to disable entirely (@release). developing: on gameW: 416 gameH: 600 artH: 2912 mapH: 3152 # +240 buttonW: 80 buttonH: 30 deadzoneH: 100 shakeFallH: 300 fontLarge: 32 fontSmall: 16 playerH: 72 playerW: 72 playerYOffset: 16 progressW: 360 progressH: 8
# Defines # ======= define [], () -> 'use strict' defines = # Turn off here to disable entirely (@release). # Off by default for performance. debugging: off # Turn off here to disable entirely (@release). developing: on gameW: 416 gameH: 600 artH: 2912 mapH: 3136 # +224 buttonW: 80 buttonH: 30 deadzoneH: 100 shakeFallH: 300 fontLarge: 32 fontSmall: 16 playerH: 72 playerW: 72 playerYOffset: 16 progressW: 360 progressH: 8
Fix background mismatch between MenuState, PlayState.
Fix background mismatch between MenuState, PlayState.
CoffeeScript
artistic-2.0
hlfcoding/morning-stroll
676b7d1f53a76d5bc1da9f41eed22ba60326e41c
lib/skeleton/option_parser.coffee
lib/skeleton/option_parser.coffee
class OptionParser ### * Parse command-line options * @param {Array} @args * @param {Object} opts ### constructor: (@args, opts) -> options = {} for opt in opts short = opt[0] long = opt[1] choices = if opt[3]? then opt[3] else null optName = long.replace('--', '') options[optName] = this.getOption [short, long], choices options.appName = @args.last() return options ### * Return given flags value if the option has choices * else return a boolean whether the flag if found or not * @param {Array} flags * @param {Array} choices ### getOption: (flags, choices) -> for flag in flags index = @args.indexOf(flag) if index > -1 if choices? value = @args[index + 1] if choices.indexOf(value) == -1 && choices[0] != '' console.warn "Invalid value “#{value}” for #{flag} option" process.exit() else value = true this.spliceArgs index, choices? return value if choices? then choices[0] else false ### * When a flag if parsed, it is removed from the @args array * Last option remaining is the appName * @param {Int} index * @param {Boolean} hasValue (default: false) ### spliceArgs: (index, hasValue=false) -> nbr = if hasValue then 2 else 1 @args.splice(index, nbr) # Export the class module.exports = OptionParser
class OptionParser ### * Parse command-line options * @param {Array} @args * @param {Object} opts ### constructor: (@args, opts) -> options = {} for opt in opts short = opt[0] long = opt[1] choices = if opt[3]? then opt[3] else null optName = long.replace('--', '') options[optName] = this.getOption [short, long], choices options.appName = @args.last() return options ### * Return given flags value if the option has choices * else return a boolean whether the flag if found or not * @param {Array} flags * @param {Array} choices ### getOption: (flags, choices) -> for flag in flags index = @args.indexOf(flag) if index > -1 if choices? value = @args[index + 1] if choices.indexOf(value) == -1 && choices[0] != '' throw new Error "Invalid value “#{value}” for #{flag} option" else value = true this.spliceArgs index, choices? return value if choices? then choices[0] else false ### * When a flag if parsed, it is removed from the @args array * Last option remaining is the appName * @param {Int} index * @param {Boolean} hasValue (default: false) ### spliceArgs: (index, hasValue=false) -> nbr = if hasValue then 2 else 1 @args.splice(index, nbr) # Export the class module.exports = OptionParser
Throw error when option value is not valid
Throw error when option value is not valid
CoffeeScript
mit
EtienneLem/skeleton
627f0e66536479fcae37fda40f90e939b93aa961
lib/go-to-line-element.coffee
lib/go-to-line-element.coffee
{CompositeDisposable} = require 'event-kit' {SpacePenDSL} = require 'atom-utils' module.exports = class GoToLineElement extends HTMLElement SpacePenDSL.includeInto(this) @content: -> @tag 'atom-text-editor', mini: true, outlet: 'miniEditor' @div class: 'message', outlet: 'message', """ Enter a cell row:column to go to. The column can be either specified with its name or its position. """ createdCallback: -> attachedCallback: -> attach: -> @panel = atom.workspace.addModalPanel(item: this, visible: true) confirm: -> text = @miniEditor.getModel().getText().trim() if text.length > 0 result = text.split(':').map (s) -> if /^\d+$/.test(s) then Number(s) else s @tableElement.goToLine(result) @destroy() destroy: -> @panel?.destroy() setModel: (@tableElement) -> module.exports = GoToLineElement = document.registerElement 'atom-table-go-to-line', prototype: GoToLineElement.prototype GoToLineElement.registerCommands = -> atom.commands.add 'atom-table-go-to-line', 'core:cancel': -> @destroy() 'core:confirm': -> @confirm() GoToLineElement.registerCommands()
{SpacePenDSL} = require 'atom-utils' module.exports = class GoToLineElement extends HTMLElement SpacePenDSL.includeInto(this) @content: -> @tag 'atom-text-editor', mini: true, outlet: 'miniEditor' @div class: 'message', outlet: 'message', """ Enter a cell row:column to go to. The column can be either specified with its name or its position. """ createdCallback: -> attachedCallback: -> @miniEditor.focus() attach: -> @panel = atom.workspace.addModalPanel(item: this, visible: true) confirm: -> text = @miniEditor.getModel().getText().trim() if text.length > 0 result = text.split(':').map (s) -> if /^\d+$/.test(s) then Number(s) else s @tableElement.goToLine(result) @destroy() destroy: -> @panel?.destroy() @tableElement.focus() setModel: (@tableElement) -> module.exports = GoToLineElement = document.registerElement 'atom-table-go-to-line', prototype: GoToLineElement.prototype GoToLineElement.registerCommands = -> atom.commands.add 'atom-table-go-to-line', 'core:cancel': -> @destroy() 'core:confirm': -> @confirm() GoToLineElement.registerCommands()
Handle focus when opening go to line modal
Handle focus when opening go to line modal
CoffeeScript
mit
abe33/atom-tablr
3a4db27848b73a9eda6195289b6125027fe61e3e
src/trigger.coffee
src/trigger.coffee
# A generic class representing a node that activates a callback # when intersecting with a designated `collector entity` # # Note that the word 'trigger' here is not connected with # triggering as defined in the `Kona.Event` interface # # TODO: trigger examples # class Kona.Trigger extends Kona.Entity constructor: (opts={}) -> super(opts) @solid = false @gravity = false @pickupSound = '' # Test if a collector is intersecting # If so, activate pickup callback and destroy # # TODO: trigger dir sensitivities (e.g., only top and left) # update: -> for entity in Kona.Collectors.for(@group) if @intersecting(entity) @activate(entity) # Callback invoked when picked up by the player # If `@pickupSound` is a string, play as a sound # else if `@pickupSound` is an array, choose one at random activate: -> if _.isString(@pickupSound) Kona.Sounds.play(@pickupSound) if @pickupSound != '' else if _.isArray(@pickupSound) sound = Kona.Utils.sample(@pickupSound) Kona.Sounds.play(sound) # Internal tracking of who can collect a given collectable. # For example, a player could pick up entities the `coins` group, # and both players and enemies could pick up entities in the `food` group. # Kona.Collectors = new Kona.Store
# A generic class representing a node that activates a callback # when intersecting with a designated `collector entity` # # Note that the word 'trigger' here is not connected with # triggering as defined in the `Kona.Event` interface # # TODO: trigger examples # class Kona.Trigger extends Kona.Entity constructor: (opts={}) -> super(opts) @solid = false @gravity = false @pickupSound = '' # Boolean function to check if an entity is within a given activation tolerance range # True by default - override in derived classes for specific behavior withinTolerance: (ent) -> true # Test if a collector is intersecting # If so, activate pickup callback and destroy # # TODO: trigger dir sensitivities (e.g., only top and left) # update: -> for entity in Kona.Collectors.for(@group) if @intersecting(entity) && @withinTolerance(entity) @activate(entity) # Callback invoked when picked up by the player # If `@pickupSound` is a string, play as a sound # else if `@pickupSound` is an array, choose one at random activate: -> if _.isString(@pickupSound) Kona.Sounds.play(@pickupSound) if @pickupSound != '' else if _.isArray(@pickupSound) sound = Kona.Utils.sample(@pickupSound) Kona.Sounds.play(sound) # Internal tracking of who can collect a given collectable. # For example, a player could pick up entities the `coins` group, # and both players and enemies could pick up entities in the `food` group. # Kona.Collectors = new Kona.Store
Move withinTolerance() into Kona.Trigger to be overriden in derived classes for checking activation conditions
Move withinTolerance() into Kona.Trigger to be overriden in derived classes for checking activation conditions
CoffeeScript
mit
andrewberls/kona,andrewberls/kona
e1d3f24b7df0a4fd080eac87cc8e01cc6269085c
app/templates/spec/name-spec.coffee
app/templates/spec/name-spec.coffee
<%= safeSlugname %> = require '../lib/<%= slugname %>' <% if (testFramework === 'mocha') { %> assert = require 'should' <% } %> describe '<%= safeSlugname %>', -> it 'should be awesome', -> <% if (testFramework === 'jasmine') { %> expect(<%= safeSlugname %>()).toEqual('awesome')<% } %><% if (testFramework === 'mocha') { %> <%= safeSlugname %>().should.equal('awesome')<% } %>
<%= safeSlugname %> = require '../lib/<%= slugname %>' <% if (testFramework === 'mocha') { %> should = require('chai').should() <% } %> describe '<%= safeSlugname %>', -> it 'should be awesome', -> <% if (testFramework === 'jasmine') { %> expect(<%= safeSlugname %>()).toEqual('awesome')<% } %><% if (testFramework === 'mocha') { %> <%= safeSlugname %>().should.equal('awesome')<% } %>
Change should.js require to chai.js in spec
Change should.js require to chai.js in spec
CoffeeScript
mit
liuxiong332/generator-node-gulp-coffee
ddb99ba74e5fc43f48ef65402e0cc9d4c840fcc4
app/routes.coffee
app/routes.coffee
module.exports = (match) -> match '', 'home#index' match 'u/6045251/shiny-wight/index.html', 'home#index' match 'shiny-wight/index.html', 'home#index'
module.exports = (match) -> match '', 'home#index' match 'index.html', 'home#index' match 'u/6045251/shiny-wight/index.html', 'home#index' match 'shiny-wight/index.html', 'home#index'
Add neccessary route for debugging
Add neccessary route for debugging
CoffeeScript
apache-2.0
despairblue/shiny-wight
b5c5c9dbb7ff1b80caec1d554818778b92a48112
assets/javascripts/routes/users_new_route.js.coffee
assets/javascripts/routes/users_new_route.js.coffee
App.UsersNewRoute = App.AuthenticatedRoute.extend setupController: (controller, model)-> controller.set "domains", @store.find("domain")
App.UsersNewRoute = App.AuthenticatedRoute.extend setupController: (controller)-> controller.setProperties "firstName": null "lastName": null "email": null "password": null "role": null
Set properties to null before they are used to create new user
Set properties to null before they are used to create new user
CoffeeScript
mit
sashafklein/bloc-mogo,HashNuke/mogo-chat,sashafklein/bloc-mogo,louishawkins/mogo-chat,HashNuke/mogo-chat,di-stars/mogo-chat,di-stars/mogo-chat,HashNuke/mogo-chat,louishawkins/mogo-chat,sashafklein/bloc-mogo,louishawkins/mogo-chat,di-stars/mogo-chat
2b822746d28b19b59b30a11f8b2218e052789f26
src/components/SplitStr.coffee
src/components/SplitStr.coffee
# The SplitStr component receives a string in the in port, splits it by # string specified in the delimiter port, and send each part as a separate # packet to the out port noflo = require "noflo" class SplitStr extends noflo.Component constructor: -> @delimiterString = "\n" @string = "" @inPorts = in: new noflo.Port() delimiter: new noflo.Port() @outPorts = out: new noflo.Port() @inPorts.delimiter.on "data", (data) => @delimiterString = data @inPorts.in.on "data", (data) => @string += data @inPorts.in.on "disconnect", (data) => @string.split(@delimiterString).forEach (line) => @outPorts.out.send line @outPorts.out.disconnect() @string = "" exports.getComponent = -> new SplitStr()
# The SplitStr component receives a string in the in port, splits it by # string specified in the delimiter port, and send each part as a separate # packet to the out port noflo = require "noflo" class SplitStr extends noflo.Component constructor: -> @delimiterString = "\n" @strings = [] @inPorts = in: new noflo.Port() delimiter: new noflo.Port() @outPorts = out: new noflo.Port() @inPorts.delimiter.on "data", (data) => @delimiterString = data @inPorts.in.on "data", (data) => @strings.push data @inPorts.in.on "disconnect", (data) => @strings.join(@delimiterString).split(@delimiterString).forEach (line) => @outPorts.out.send line @outPorts.out.disconnect() @strings = [] exports.getComponent = -> new SplitStr()
Use array to avoid beginning of subsequent IPs be merged with the end of preceding IPs
Use array to avoid beginning of subsequent IPs be merged with the end of preceding IPs
CoffeeScript
mit
trustmaster/noflo,trustmaster/noflo,lxfschr/noflo,jonnor/noflo,npmcomponent/noflo-noflo,jonnor/noflo,noflo/noflo,saurabhsood91/noflo,lxfschr/noflo,saurabhsood91/noflo
25f53e972ca8feb5234d29c581927d5d63b6887d
app/assets/javascripts/uploadcare/utils/image-loader.coffee
app/assets/javascripts/uploadcare/utils/image-loader.coffee
{ jQuery: $ } = uploadcare uploadcare.namespace 'utils', (ns) -> trackLoading = (image, src) -> def = $.Deferred() if src image.src = src if image.complete def.resolve(image) else $(image).one 'load', => def.resolve(image) $(image).one 'error', => def.reject(image) def.promise() ns.imageLoader = (image) -> # if argument is an array, treat as # load(['1.jpg', '2.jpg']) if $.isArray(image) return $.when.apply(null, $.map(image, ns.imageLoader)) if image.src return trackLoading(image) else return trackLoading(new Image(), image) ns.videoLoader = (src) -> def = $.Deferred() $('<video/>') .on('loadeddata', def.resolve) .on('error', def.reject) .attr('src', src) .load() def.promise()
{ jQuery: $ } = uploadcare uploadcare.namespace 'utils', (ns) -> trackLoading = (image, src) -> def = $.Deferred() if src image.src = src if image.complete def.resolve(image) else $(image).one 'load', => def.resolve(image) $(image).one 'error', => def.reject(image) def.promise() ns.imageLoader = (image) -> # if argument is an array, treat as # load(['1.jpg', '2.jpg']) if $.isArray(image) return $.when.apply(null, $.map(image, ns.imageLoader)) if image.src return trackLoading(image) else return trackLoading(new Image(), image) ns.videoLoader = (src) -> def = $.Deferred() $('<video/>') .on('loadeddata', def.resolve) .on('error', def.reject) .attr('src', src) .get(0) .load() def.promise()
Fix videoLoader. Run `load` for HTMLElement instead jQuery el.
Fix videoLoader. Run `load` for HTMLElement instead jQuery el.
CoffeeScript
bsd-2-clause
uploadcare/uploadcare-widget,uploadcare/uploadcare-widget
cda45820d8b9ab8326ab223be0b11e6be4a5313a
spec/integrations/command.coffee
spec/integrations/command.coffee
childProcess = require 'child_process' path = require 'path' command = "node #{path.resolve __dirname, '../../bin/iced.js'}" module.exports = (args...) -> args[0] = "#{command} #{args[0]}" childProcess.exec.apply childProcess, args
childProcess = require 'child_process' path = require 'path' command = "node #{path.resolve __dirname, '../../bin/iced.js'}" module.exports = (args...) -> args[0] = "#{command} #{args[0]}" if typeof args[1] is 'object' and args[1].env? newEnv = process.env newEnv[key] = value for key, value of args[1].env args[1].env = newEnv childProcess.exec.apply childProcess, args
Add current env to child env, if child env is specified
Add current env to child env, if child env is specified
CoffeeScript
mit
demands/node-iced
0b0d374cfa5f845a5fd53399623883372983ccb7
client/lib/cordova/keyboard-fix.coffee
client/lib/cordova/keyboard-fix.coffee
if Meteor.isCordova document.addEventListener 'deviceready', -> cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); window.addEventListener 'native.keyboardshow', -> $('.main-content').css 'height', window.innerHeight window.addEventListener 'native.keyboardhide', -> $('.main-content').css 'height', window.innerHeight
if Meteor.isCordova if device.platform.toLowerCase() isnt 'android' document.addEventListener 'deviceready', -> cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); window.addEventListener 'native.keyboardshow', -> $('.main-content').css 'height', window.innerHeight window.addEventListener 'native.keyboardhide', -> $('.main-content').css 'height', window.innerHeight
Fix keyboard resize for android devices
Fix keyboard resize for android devices
CoffeeScript
mit
jeann2013/Rocket.Chat,jessedhillon/Rocket.Chat,4thParty/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,ealbers/Rocket.Chat,Jandersolutions/Rocket.Chat,litewhatever/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,igorstajic/Rocket.Chat,j-ew-s/Rocket.Chat,subesokun/Rocket.Chat,mrsimpson/Rocket.Chat,VoiSmart/Rocket.Chat,atyenoria/Rocket.Chat,cdwv/Rocket.Chat,parkmap/Rocket.Chat,jbsavoy18/rocketchat-1,xasx/Rocket.Chat,ederribeiro/Rocket.Chat,psadaic/Rocket.Chat,karlprieb/Rocket.Chat,jeanmatheussouto/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,pitamar/Rocket.Chat,abhishekshukla0302/trico,JamesHGreen/Rocket_API,Sing-Li/Rocket.Chat,KyawNaingTun/Rocket.Chat,uniteddiversity/Rocket.Chat,nathantreid/Rocket.Chat,williamfortunademoraes/Rocket.Chat,litewhatever/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,alexbrazier/Rocket.Chat,inoxth/Rocket.Chat,glnarayanan/Rocket.Chat,tntobias/Rocket.Chat,mwharrison/Rocket.Chat,cnash/Rocket.Chat,flaviogrossi/Rocket.Chat,Maysora/Rocket.Chat,soonahn/Rocket.Chat,lucasgolino/Rocket.Chat,christmo/Rocket.Chat,biomassives/Rocket.Chat,kkochubey1/Rocket.Chat,Kiran-Rao/Rocket.Chat,haoyixin/Rocket.Chat,pachox/Rocket.Chat,4thParty/Rocket.Chat,inoio/Rocket.Chat,marzieh312/Rocket.Chat,acaronmd/Rocket.Chat,alenodari/Rocket.Chat,Gyubin/Rocket.Chat,snaiperskaya96/Rocket.Chat,nabiltntn/Rocket.Chat,jeann2013/Rocket.Chat,LeonardOliveros/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,timkinnane/Rocket.Chat,jbsavoy18/rocketchat-1,galrotem1993/Rocket.Chat,JamesHGreen/Rocket.Chat,intelradoux/Rocket.Chat,tlongren/Rocket.Chat,karlprieb/Rocket.Chat,TribeMedia/Rocket.Chat,intelradoux/Rocket.Chat,KyawNaingTun/Rocket.Chat,qnib/Rocket.Chat,thunderrabbit/Rocket.Chat,Jandersolutions/Rocket.Chat,wangleihd/Rocket.Chat,klatys/Rocket.Chat,org100h1/Rocket.Panda,haoyixin/Rocket.Chat,marzieh312/Rocket.Chat,parkmap/Rocket.Chat,soonahn/Rocket.Chat,Codebrahma/Rocket.Chat,mrsimpson/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,LeonardOliveros/Rocket.Chat,JisuPark/Rocket.Chat,xboston/Rocket.Chat,k0nsl/Rocket.Chat,berndsi/Rocket.Chat,rasata/Rocket.Chat,acidsound/Rocket.Chat,LearnersGuild/echo-chat,Flitterkill/Rocket.Chat,jadeqwang/Rocket.Chat,biomassives/Rocket.Chat,linnovate/hi,nathantreid/Rocket.Chat,bt/Rocket.Chat,jessedhillon/Rocket.Chat,nabiltntn/Rocket.Chat,NMandapaty/Rocket.Chat,NMandapaty/Rocket.Chat,acaronmd/Rocket.Chat,liuliming2008/Rocket.Chat,uniteddiversity/Rocket.Chat,sunhaolin/Rocket.Chat,tzellman/Rocket.Chat,ziedmahdi/Rocket.Chat,matthewshirley/Rocket.Chat,webcoding/Rocket.Chat,j-ew-s/Rocket.Chat,ahmadassaf/Rocket.Chat,uniteddiversity/Rocket.Chat,tlongren/Rocket.Chat,Achaikos/Rocket.Chat,fatihwk/Rocket.Chat,Ninotna/Rocket.Chat,LearnersGuild/Rocket.Chat,mccambridge/Rocket.Chat,ndarilek/Rocket.Chat,nrhubbar/Rocket.Chat,JamesHGreen/Rocket_API,ggazzo/Rocket.Chat,wicked539/Rocket.Chat,ggazzo/Rocket.Chat,umeshrs/rocket-chat-integration,AlecTroemel/Rocket.Chat,Dianoga/Rocket.Chat,matthewshirley/Rocket.Chat,jyx140521/Rocket.Chat,sikofitt/Rocket.Chat,JamesHGreen/Rocket_API,liuliming2008/Rocket.Chat,ggazzo/Rocket.Chat,LearnersGuild/Rocket.Chat,snaiperskaya96/Rocket.Chat,ederribeiro/Rocket.Chat,AimenJoe/Rocket.Chat,VoiSmart/Rocket.Chat,igorstajic/Rocket.Chat,freakynit/Rocket.Chat,Gudii/Rocket.Chat,acaronmd/Rocket.Chat,bopjesvla/chatmafia,rasata/Rocket.Chat,adamteece/Rocket.Chat,adamteece/Rocket.Chat,snaiperskaya96/Rocket.Chat,TribeMedia/Rocket.Chat,karlprieb/Rocket.Chat,sscpac/chat-locker,LearnersGuild/Rocket.Chat,qnib/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,danielbressan/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,Deepakkothandan/Rocket.Chat,anhld/Rocket.Chat,mrinaldhar/Rocket.Chat,LeonardOliveros/Rocket.Chat,cdwv/Rocket.Chat,lukaroski/traden,abduljanjua/TheHub,tradetiger/Rocket.Chat,sikofitt/Rocket.Chat,pkgodara/Rocket.Chat,mitar/Rocket.Chat,BHWD/noouchat,ZBoxApp/Rocket.Chat,klatys/Rocket.Chat,4thParty/Rocket.Chat,AimenJoe/Rocket.Chat,danielbressan/Rocket.Chat,adamteece/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,Ninotna/Rocket.Chat,BorntraegerMarc/Rocket.Chat,yuyixg/Rocket.Chat,OtkurBiz/Rocket.Chat,anhld/Rocket.Chat,abduljanjua/TheHub,k0nsl/Rocket.Chat,Gudii/Rocket.Chat,umeshrs/rocket-chat,cdwv/Rocket.Chat,LearnersGuild/Rocket.Chat,fduraibi/Rocket.Chat,Achaikos/Rocket.Chat,atyenoria/Rocket.Chat,thunderrabbit/Rocket.Chat,callmekatootie/Rocket.Chat,mwharrison/Rocket.Chat,cdwv/Rocket.Chat,mohamedhagag/Rocket.Chat,Sing-Li/Rocket.Chat,revspringjake/Rocket.Chat,flaviogrossi/Rocket.Chat,steedos/chat,cnash/Rocket.Chat,ndarilek/Rocket.Chat,florinnichifiriuc/Rocket.Chat,celloudiallo/Rocket.Chat,rasata/Rocket.Chat,danielbressan/Rocket.Chat,flaviogrossi/Rocket.Chat,kkochubey1/Rocket.Chat,jbsavoy18/rocketchat-1,k0nsl/Rocket.Chat,ziedmahdi/Rocket.Chat,mohamedhagag/Rocket.Chat,inoxth/Rocket.Chat,ziedmahdi/Rocket.Chat,tntobias/Rocket.Chat,revspringjake/Rocket.Chat,Flitterkill/Rocket.Chat,icaromh/Rocket.Chat,bt/Rocket.Chat,JamesHGreen/Rocket.Chat,ahmadassaf/Rocket.Chat,freakynit/Rocket.Chat,nishimaki10/Rocket.Chat,anhld/Rocket.Chat,wtsarchive/Rocket.Chat,lonbaker/Rocket.Chat,Deepakkothandan/Rocket.Chat,BorntraegerMarc/Rocket.Chat,freakynit/Rocket.Chat,Codebrahma/Rocket.Chat,celloudiallo/Rocket.Chat,sikofitt/Rocket.Chat,nishimaki10/Rocket.Chat,ggazzo/Rocket.Chat,xasx/Rocket.Chat,ut7/Rocket.Chat,amaapp/ama,umeshrs/rocket-chat,slava-sh/Rocket.Chat,HeapCity/Heap.City,icaromh/Rocket.Chat,Codebrahma/Rocket.Chat,wicked539/Rocket.Chat,AimenJoe/Rocket.Chat,alexbrazier/Rocket.Chat,acidicX/Rocket.Chat,qnib/Rocket.Chat,fatihwk/Rocket.Chat,liuliming2008/Rocket.Chat,sunhaolin/Rocket.Chat,intelradoux/Rocket.Chat,wtsarchive/Rocket.Chat,arvi/Rocket.Chat,acaronmd/Rocket.Chat,florinnichifiriuc/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,ZBoxApp/Rocket.Chat,yuyixg/Rocket.Chat,subesokun/Rocket.Chat,Movile/Rocket.Chat,wicked539/Rocket.Chat,slava-sh/Rocket.Chat,bt/Rocket.Chat,jonathanhartman/Rocket.Chat,Jandersoft/Rocket.Chat,parkmap/Rocket.Chat,glnarayanan/Rocket.Chat,galrotem1993/Rocket.Chat,mrinaldhar/Rocket.Chat,inoio/Rocket.Chat,ederribeiro/Rocket.Chat,capensisma/Rocket.Chat,glnarayanan/Rocket.Chat,erikmaarten/Rocket.Chat,Sing-Li/Rocket.Chat,Gudii/Rocket.Chat,nathantreid/Rocket.Chat,HeapCity/Heap.City,org100h1/Rocket.Panda,TribeMedia/Rocket.Chat,fatihwk/Rocket.Chat,sscpac/chat-locker,liemqv/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,klatys/Rocket.Chat,litewhatever/Rocket.Chat,linnovate/hi,jeanmatheussouto/Rocket.Chat,coreyaus/Rocket.Chat,ealbers/Rocket.Chat,Kiran-Rao/Rocket.Chat,litewhatever/Rocket.Chat,apnero/tactixteam,madmanteam/Rocket.Chat,mitar/Rocket.Chat,apnero/tactixteam,sargentsurg/Rocket.Chat,wicked539/Rocket.Chat,nrhubbar/Rocket.Chat,cnash/Rocket.Chat,ndarilek/Rocket.Chat,mhurwi/Rocket.Chat,madmanteam/Rocket.Chat,tntobias/Rocket.Chat,JamesHGreen/Rocket_API,pkgodara/Rocket.Chat,katopz/Rocket.Chat,florinnichifiriuc/Rocket.Chat,xasx/Rocket.Chat,Movile/Rocket.Chat,snaiperskaya96/Rocket.Chat,Maysora/Rocket.Chat,mccambridge/Rocket.Chat,leohmoraes/Rocket.Chat,mrinaldhar/Rocket.Chat,atyenoria/Rocket.Chat,katopz/Rocket.Chat,callmekatootie/Rocket.Chat,biomassives/Rocket.Chat,I-am-Gabi/Rocket.Chat,warcode/Rocket.Chat,marzieh312/Rocket.Chat,mccambridge/Rocket.Chat,abduljanjua/TheHub,wtsarchive/Rocket.Chat,gitaboard/Rocket.Chat,berndsi/Rocket.Chat,apnero/tactixteam,alexbrazier/Rocket.Chat,jonathanhartman/Rocket.Chat,kkochubey1/Rocket.Chat,amaapp/ama,jessedhillon/Rocket.Chat,Ninotna/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,I-am-Gabi/Rocket.Chat,klatys/Rocket.Chat,himeshp/Rocket.Chat,sargentsurg/Rocket.Chat,himeshp/Rocket.Chat,Gyubin/Rocket.Chat,phlkchan/Rocket.Chat,umeshrs/rocket-chat,acidsound/Rocket.Chat,marzieh312/Rocket.Chat,psadaic/Rocket.Chat,HeapCity/Heap.City,liemqv/Rocket.Chat,JamesHGreen/Rocket.Chat,inoxth/Rocket.Chat,j-ew-s/Rocket.Chat,tradetiger/Rocket.Chat,katopz/Rocket.Chat,BHWD/noouchat,lucasgolino/Rocket.Chat,capensisma/Rocket.Chat,acidicX/Rocket.Chat,capensisma/Rocket.Chat,warcode/Rocket.Chat,pachox/Rocket.Chat,leohmoraes/Rocket.Chat,gitaboard/Rocket.Chat,jbsavoy18/rocketchat-1,intelradoux/Rocket.Chat,amaapp/ama,sunhaolin/Rocket.Chat,yuyixg/Rocket.Chat,pitamar/Rocket.Chat,ealbers/Rocket.Chat,OtkurBiz/Rocket.Chat,Flitterkill/Rocket.Chat,Deepakkothandan/Rocket.Chat,wtsarchive/Rocket.Chat,steedos/chat,christmo/Rocket.Chat,gitaboard/Rocket.Chat,PavelVanecek/Rocket.Chat,igorstajic/Rocket.Chat,Sing-Li/Rocket.Chat,mrsimpson/Rocket.Chat,Flitterkill/Rocket.Chat,liuliming2008/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,I-am-Gabi/Rocket.Chat,pitamar/Rocket.Chat,mwharrison/Rocket.Chat,Kiran-Rao/Rocket.Chat,TribeMedia/Rocket.Chat,psadaic/Rocket.Chat,Jandersolutions/Rocket.Chat,acidsound/Rocket.Chat,BHWD/noouchat,karlprieb/Rocket.Chat,fduraibi/Rocket.Chat,galrotem1993/Rocket.Chat,cnash/Rocket.Chat,nabiltntn/Rocket.Chat,danielbressan/Rocket.Chat,jeann2013/Rocket.Chat,Deepakkothandan/Rocket.Chat,arvi/Rocket.Chat,OtkurBiz/Rocket.Chat,abhishekshukla0302/trico,ZBoxApp/Rocket.Chat,tzellman/Rocket.Chat,inoio/Rocket.Chat,mhurwi/Rocket.Chat,Achaikos/Rocket.Chat,fduraibi/Rocket.Chat,JamesHGreen/Rocket.Chat,nishimaki10/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,arvi/Rocket.Chat,wangleihd/Rocket.Chat,subesokun/Rocket.Chat,fatihwk/Rocket.Chat,KyawNaingTun/Rocket.Chat,erikmaarten/Rocket.Chat,ealbers/Rocket.Chat,haoyixin/Rocket.Chat,PavelVanecek/Rocket.Chat,xboston/Rocket.Chat,soonahn/Rocket.Chat,mitar/Rocket.Chat,NMandapaty/Rocket.Chat,jonathanhartman/Rocket.Chat,org100h1/Rocket.Panda,lukaroski/traden,ut7/Rocket.Chat,galrotem1993/Rocket.Chat,phlkchan/Rocket.Chat,mhurwi/Rocket.Chat,liemqv/Rocket.Chat,Gudii/Rocket.Chat,sargentsurg/Rocket.Chat,tlongren/Rocket.Chat,ahmadassaf/Rocket.Chat,ut7/Rocket.Chat,wangleihd/Rocket.Chat,ziedmahdi/Rocket.Chat,OtkurBiz/Rocket.Chat,flaviogrossi/Rocket.Chat,lukaroski/traden,LearnersGuild/echo-chat,lukaroski/traden,ut7/Rocket.Chat,AimenJoe/Rocket.Chat,nrhubbar/Rocket.Chat,Achaikos/Rocket.Chat,umeshrs/rocket-chat-integration,Movile/Rocket.Chat,bt/Rocket.Chat,Kiran-Rao/Rocket.Chat,pachox/Rocket.Chat,timkinnane/Rocket.Chat,alexbrazier/Rocket.Chat,igorstajic/Rocket.Chat,abhishekshukla0302/trico,webcoding/Rocket.Chat,alenodari/Rocket.Chat,lonbaker/Rocket.Chat,mitar/Rocket.Chat,celloudiallo/Rocket.Chat,icaromh/Rocket.Chat,jyx140521/Rocket.Chat,subesokun/Rocket.Chat,abduljanjua/TheHub,soonahn/Rocket.Chat,PavelVanecek/Rocket.Chat,Gyubin/Rocket.Chat,himeshp/Rocket.Chat,pkgodara/Rocket.Chat,revspringjake/Rocket.Chat,umeshrs/rocket-chat-integration,acidicX/Rocket.Chat,tradetiger/Rocket.Chat,Movile/Rocket.Chat,xboston/Rocket.Chat,slava-sh/Rocket.Chat,Dianoga/Rocket.Chat,mohamedhagag/Rocket.Chat,nishimaki10/Rocket.Chat,erikmaarten/Rocket.Chat,LearnersGuild/echo-chat,williamfortunademoraes/Rocket.Chat,Jandersoft/Rocket.Chat,madmanteam/Rocket.Chat,mrinaldhar/Rocket.Chat,steedos/chat,mwharrison/Rocket.Chat,4thParty/Rocket.Chat,steedos/chat,VoiSmart/Rocket.Chat,pkgodara/Rocket.Chat,tlongren/Rocket.Chat,abhishekshukla0302/trico,JisuPark/Rocket.Chat,xasx/Rocket.Chat,AlecTroemel/Rocket.Chat,pitamar/Rocket.Chat,jadeqwang/Rocket.Chat,fduraibi/Rocket.Chat,webcoding/Rocket.Chat,NMandapaty/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,ahmadassaf/Rocket.Chat,amaapp/ama,timkinnane/Rocket.Chat,k0nsl/Rocket.Chat,jonathanhartman/Rocket.Chat,PavelVanecek/Rocket.Chat,yuyixg/Rocket.Chat,BorntraegerMarc/Rocket.Chat,inoxth/Rocket.Chat,christmo/Rocket.Chat,haoyixin/Rocket.Chat,JisuPark/Rocket.Chat,Dianoga/Rocket.Chat,warcode/Rocket.Chat,Dianoga/Rocket.Chat,lucasgolino/Rocket.Chat,Jandersoft/Rocket.Chat,sscpac/chat-locker,BorntraegerMarc/Rocket.Chat,qnib/Rocket.Chat,jadeqwang/Rocket.Chat,jyx140521/Rocket.Chat,lonbaker/Rocket.Chat,LearnersGuild/echo-chat,Maysora/Rocket.Chat,leohmoraes/Rocket.Chat,tntobias/Rocket.Chat,bopjesvla/chatmafia,callmekatootie/Rocket.Chat,berndsi/Rocket.Chat,ndarilek/Rocket.Chat,AlecTroemel/Rocket.Chat,tzellman/Rocket.Chat,thunderrabbit/Rocket.Chat,coreyaus/Rocket.Chat,matthewshirley/Rocket.Chat,Gyubin/Rocket.Chat,AlecTroemel/Rocket.Chat,timkinnane/Rocket.Chat,phlkchan/Rocket.Chat,matthewshirley/Rocket.Chat,xboston/Rocket.Chat,pachox/Rocket.Chat,mccambridge/Rocket.Chat,org100h1/Rocket.Panda,philosowaffle/rpi-Rocket.Chat,mrsimpson/Rocket.Chat,alenodari/Rocket.Chat,mhurwi/Rocket.Chat,LeonardOliveros/Rocket.Chat,bopjesvla/chatmafia,coreyaus/Rocket.Chat,williamfortunademoraes/Rocket.Chat,jeanmatheussouto/Rocket.Chat
70b8dfd2ed53909e9e618884697ec3d9416b3bc9
lib/Strategy/DBStrategy/Save/CollisionCheckTemporaryTable.coffee
lib/Strategy/DBStrategy/Save/CollisionCheckTemporaryTable.coffee
_ = require "underscore" Promise = require "bluebird" TemporaryTable = require "./TemporaryTable" class CollisionCheckTemporaryTable extends TemporaryTable insert: (externalObject) -> @checkIfExists externalObject .then (exists) -> if not exists super else console.warn "Primary key collision detected!", externalObject checkIfExists: (externalObject) -> Promise.bind(@) .then -> @transaction.raw(""" SELECT COUNT(*) as "counter" FROM "#{@bufferTableName}" WHERE "#{@idFieldName}" = '#{externalObject[@idFieldName]}' AND "_avatarId" = '#{@avatarId}' """) .then (result) -> result.rows[0].counter isnt '0' module.exports = CollisionCheckTemporaryTable
_ = require "underscore" Promise = require "bluebird" TemporaryTable = require "./TemporaryTable" class CollisionCheckTemporaryTable extends TemporaryTable insert: (externalObject) -> @checkIfExists externalObject .then (exists) -> if not exists super(externalObject) else console.warn "Primary key collision detected!", externalObject checkIfExists: (externalObject) -> Promise.bind(@) .then -> @transaction.raw(""" SELECT COUNT(*) as "counter" FROM "#{@bufferTableName}" WHERE "#{@idFieldName}" = '#{externalObject[@idFieldName]}' AND "_avatarId" = '#{@avatarId}' """) .then (result) -> result.rows[0].counter isnt '0' module.exports = CollisionCheckTemporaryTable
Implement Collision Check Temporary Table.
Implement Collision Check Temporary Table.
CoffeeScript
agpl-3.0
fixin-platform/backend-core,spirehq/backend-core,spirehq/backend-core,fixin-platform/backend-core
7ed2b046927e8bb63f055e1dcfafe1413e54e622
topics/atom.symlink/config.cson
topics/atom.symlink/config.cson
"*": "autocomplete-plus": confirmCompletion: "enter" fileBlacklist: [ "*.md" "*.txt" ] core: telemetryConsent: "limited" editor: softTabs: false tabLength: 4 "exception-reporting": userId: "2c613f71-39b8-42c5-bef0-f61d264be689" "git-diff": showIconsInEditorGutter: true "line-ending-selector": defaultLineEnding: "LF" "markdown-preview": useGitHubStyle: true tabs: enableVcsColoring: true "tree-view": alwaysOpenExisting: true whitespace: {} ".plain.text": editor: tabLength: 8
"*": "autocomplete-plus": confirmCompletion: "enter" fileBlacklist: [ "*.md" "*.txt" ] core: telemetryConsent: "limited" editor: softTabs: false tabLength: 4 "exception-reporting": userId: "2c613f71-39b8-42c5-bef0-f61d264be689" "git-diff": showIconsInEditorGutter: true "line-ending-selector": defaultLineEnding: "LF" "markdown-preview": useGitHubStyle: true tabs: enableVcsColoring: true "tree-view": alwaysOpenExisting: true whitespace: {} ".gfm.source": editor: tabLength: 8 ".plain.text": editor: tabLength: 8
Change tab length in GFM.
Change tab length in GFM. Signed-off-by: Jason Lynch <68c46a606457643eab92053c1c05574abb26f861@calindora.com>
CoffeeScript
mit
aexoden/dotfiles,aexoden/dotfiles
31435ae9e07bc072dfa84d0330897c1214ff9a4c
server/index.coffee
server/index.coffee
util = require 'util' module.exports = (app, mongoose, options) -> models = require('./models')(mongoose) controllers = require('./controllers')(models) auth = require('./authentication')(app, models, options) require('./routes')(app, auth, controllers) app.configure 'test', -> console.log 'injecting test account' dummyAccount = name: 'Acme' host: 'localhost' models.accounts.create dummyAccount, (err, result) -> {} console.log 'injecting test dummy admin user' dummyAdmin = email: 'dummyadmin@test.com' firstName: 'Dummy' lastName: 'Admin' password: 'password' models.users.create dummyAdmin, (err, result) -> {} auth
util = require 'util' module.exports = (app, mongoose, options) -> models = require('./models')(mongoose) controllers = require('./controllers')(models) auth = require('./authentication')(app, models, options) require('./routes')(app, auth, controllers) resetTestDb = -> app.configure 'test', -> resetTestDb = (callback) -> console.log 'dropping test accounts' mongoose.connection.collections['accounts']?.drop () -> console.log 'injecting test account' dummyAccount = name: 'Acme' host: 'localhost' models.accounts.create dummyAccount, (err, result) -> {} console.log 'dropping test users' mongoose.connection.collections['users']?.drop () -> console.log 'injecting test dummy admin user' dummyAdmin = email: 'dummyadmin@test.com' firstName: 'Dummy' lastName: 'Admin' password: 'password' alice = email: 'alice@test.com' firstName: 'Alice' lastName: 'Alison' password: 'password' models.users.create alice, (err, result) -> {} models.users.create dummyAdmin, (err, result) -> callback(models) auth: auth resetTestDb: resetTestDb
Improve how we inject test data for e2e testing purposes
Improve how we inject test data for e2e testing purposes
CoffeeScript
apache-2.0
GoIncremental/gi-security,GoIncremental/gi-security
5362591f3436cbdbdc615ed25db4ddec0e1450ff
app/components/markdown-editor.cjsx
app/components/markdown-editor.cjsx
# @cjsx React.DOM React = require 'react' Markdown = require './markdown' module.exports = React.createClass displayName: 'MarkdownEditor' getInitialState: -> previewing: false value: @props.defaultValue ? '' render: -> previewing = @props.previewing ? @state.previewing <div className={['markdown-editor', @props.className].join ' '} data-previewing={@state.previewing or null}> {@transferPropsTo <textarea className="markdown-editor-input" value={@props.value ? @state.value} onChange={@handleChange} />} <Markdown className="markdown-editor-preview">{@state.value}</Markdown> <div className="markdown-editor-controls"> <button onClick={@handlePreviewToggle}> {if previewing <i className="fa fa-pencil"></i> else <i className="fa fa-eye"></i>} </button> <br /> <button onClick={@handleHelpRequest}> <i className="fa fa-question"></i> </button> </div> </div> handleChange: (e) -> unless @props.value? @setState value: e.target.value @props.onChange? e handlePreviewToggle: (e) -> @setState previewing: not @state.previewing handleHelpRequest: -> console?.log 'TODO: Show a dialog with Markdown help.'
# @cjsx React.DOM React = require 'react' Markdown = require './markdown' alert = require '../lib/alert' NOOP = Function.prototype module.exports = React.createClass displayName: 'MarkdownEditor' getDefaultProps: -> placeholder: '' value: '' onChange: NOOP getInitialState: -> previewing: false render: -> previewing = @props.previewing ? @state.previewing <div className={['markdown-editor', @props.className].join ' '} data-previewing={@state.previewing or null}> {@transferPropsTo <textarea className="markdown-editor-input" placeholder={@props.placeholder} value={@props.value} onChange={@props.onChange} />} <Markdown className="markdown-editor-preview">{@props.value}</Markdown> <div className="markdown-editor-controls"> <button type="button" onClick={@handlePreviewToggle}> {if previewing <i className="fa fa-pencil fa-fw"></i> else <i className="fa fa-eye fa-fw"></i>} </button> <br /> <button type="button" onClick={@handleHelpRequest}> <i className="fa fa-question fa-fw"></i> </button> </div> </div> handlePreviewToggle: (e) -> @setState previewing: not @state.previewing handleHelpRequest: -> alert <p>TODO: Show a dialog with Markdown help.</p>
Make the markdown editor behave more like a normal input
Make the markdown editor behave more like a normal input
CoffeeScript
apache-2.0
tfmorris/Panoptes-Front-End,alexbfree/Panoptes-Front-End,camallen/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,CKrawczyk/Panoptes-Front-End,fmnhExhibits/Panoptes-Front-End,mrniaboc/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,edpaget/Panoptes-Front-End,marten/Panoptes-Front-End,parrish/Panoptes-Front-End,camallen/Panoptes-Front-End,alexbfree/Panoptes-Front-End,tfmorris/Panoptes-Front-End,parrish/Panoptes-Front-End,fmnhExhibits/Panoptes-Front-End,edpaget/Panoptes-Front-End,jelliotartz/Panoptes-Front-End,aliburchard/Panoptes-Front-End,CKrawczyk/Panoptes-Front-End,parrish/Panoptes-Front-End,mrniaboc/Panoptes-Front-End,jelliotartz/Panoptes-Front-End,camallen/Panoptes-Front-End,CKrawczyk/Panoptes-Front-End,alexbfree/Panoptes-Front-End,fmnhExhibits/Panoptes-Front-End,jelliotartz/Panoptes-Front-End,marten/Panoptes-Front-End,mrniaboc/Panoptes-Front-End,zooniverse/Panoptes-Front-End,aliburchard/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,edpaget/Panoptes-Front-End
06200a9d41ef2bd01c6d60d02973da36de6943b4
lib/main.coffee
lib/main.coffee
PackageGeneratorView = require './package-generator-view' module.exports = config: createInDevMode: default: false type: 'boolean' activate: -> @view = new PackageGeneratorView() deactivate: -> @view?.destroy()
PackageGeneratorView = require './package-generator-view' module.exports = config: createInDevMode: default: false type: 'boolean' description: 'When disabled, generated packages are linked into Atom in both normal mode and dev mode. When enabled, generated packages are linked into Atom only in dev mode.' activate: -> @view = new PackageGeneratorView() deactivate: -> @view?.destroy()
Add description for config setting
Add description for config setting
CoffeeScript
mit
atom/package-generator
1b7dbea42a79bfa21176e85428f5120de8c699b9
lib/project-manager-add-view.coffee
lib/project-manager-add-view.coffee
{View} = require 'atom-space-pen-views' path = require 'path' module.exports = class ProjectManagerAddView extends View projectManager: null @content: -> @div class: 'project-manager', => @div class: 'editor-container', outlet: 'editorContainer', => @div => @input outlet:'editor', class:'native-key-bindings', placeholderText: 'Project title' @div => @span 'Path: ' @span class: 'text-highlight', atom.project?.getPath() initialize: -> @editor.on 'core:confirm', @confirm @editor.on 'core:cancel', @hide @editor.on 'blur', @hide cancelled: => @hide() confirm: => project = title: @editor.val() paths: [atom.project?.getPath()] @projectManager.addProject(project) if project.title @hide() if project.title hide: => atom.commands.dispatch(atom.views.getView(atom.workspace), 'focus') @panel.hide() show: => @panel ?= atom.workspace.addModalPanel(item: this) @panel.show() basename = path.basename(atom.project.getPath()) @editor.val(basename) @editor.focus() @editor.select() toggle: (projectManager) -> @projectManager = projectManager if @panel?.isVisible() @hide() else @show()
{View} = require 'atom-space-pen-views' path = require 'path' module.exports = class ProjectManagerAddView extends View projectManager: null @content: -> @div class: 'project-manager', => @div class: 'editor-container', outlet: 'editorContainer', => @div => @input outlet:'editor', class:'native-key-bindings', placeholderText: 'Project title' @div => for projectPath in atom.project?.getPaths() @span class: 'text-highlight', projectPath initialize: -> @editor.on 'core:confirm', @confirm @editor.on 'core:cancel', @hide @editor.on 'blur', @hide cancelled: => @hide() confirm: => project = title: @editor.val() paths: atom.project.getPaths() @projectManager.addProject(project) if project.title @hide() if project.title hide: => atom.commands.dispatch(atom.views.getView(atom.workspace), 'focus') @panel.hide() show: => @panel ?= atom.workspace.addModalPanel(item: this) @panel.show() firstPath = atom.project.getPaths()[0] basename = path.basename(firstPath) @editor.val(basename) @editor.focus() @editor.select() toggle: (projectManager) -> @projectManager = projectManager if @panel?.isVisible() @hide() else @show()
Update to use getPaths() instead of getPath()
Update to use getPaths() instead of getPath()
CoffeeScript
mit
danielbrodin/atom-project-manager,UltCombo/atom-project-manager,douggr/atom-project-manager
40d6c45f05772c21abbbec4a750c88c8cdeb005f
app/static/coffee/models.coffee
app/static/coffee/models.coffee
window.coviolations ?= views: {} models: {} plotting: {} push: {} $ -> app = window.coviolations class app.models.UserProject extends Backbone.Model ### User project model ### urlRoot: '/api/v1/userprojects/' class app.models.UserProjectCollection extends Backbone.Collection ### User project collection ### url: '/api/v1/userprojects/' model: app.models.UserProject class app.models.Task extends Backbone.Model ### Task model ### urlRoot: '/api/v1/tasks/' class app.models.TaskCollection extends Backbone.Collection ### Task collection ### url: '/api/v1/tasks/' model: app.models.Task
window.coviolations ?= views: {} models: {} plotting: {} push: {} $ -> app = window.coviolations class app.models.UserProject extends Backbone.Model ### User project model ### urlRoot: '/api/v1/projects/project/' class app.models.UserProjectCollection extends Backbone.Collection ### User project collection ### url: '/api/v1/projects/project/' model: app.models.UserProject class app.models.Task extends Backbone.Model ### Task model ### urlRoot: '/api/v1/tasks/task/' class app.models.TaskCollection extends Backbone.Collection ### Task collection ### url: '/api/v1/tasks/task/' model: app.models.Task
Change api urls in client side
Change api urls in client side
CoffeeScript
mit
nvbn/coviolations_web,nvbn/coviolations_web
7df1a080063ca5d35933341adbc0efed2741a407
app/routes/application.coffee
app/routes/application.coffee
Route = Ember.Route.extend model: -> # return the current user as the model if authenticated, otherwise a blank object new Promise (resolve, reject) => promise = $.ajax url: '/api/me' dataType: 'json' promise.done (result) => user = Ember.Object.create(result) if result.isAnon @set 'session.isAnon', true @set 'session.currentUser', null else @set 'session.isAnon', false @set 'session.currentUser', user resolve(user) promise.fail (result) -> reject() clearSession: -> @set 'session.currentUser', undefined @set 'session.isAnon', true @set 'settings.editMode', false actions: toggleEditMode: -> @toggleProperty 'settings.editMode' @send 'flushUpdateQueue' flushUpdateQueue: -> return unless @get('session.currentUser.isAdmin') updateQueue = @get('updateQueue') while updateQueue.get('length') section = updateQueue.popObject() section.save() error: (result, transition) -> if result.status is 403 @clearSession() @transitionTo 'signout' `export default Route`
Route = Ember.Route.extend model: -> # return the current user as the model if authenticated, otherwise a blank object new Ember.RSVP.Promise (resolve, reject) => promise = $.ajax url: '/api/me' dataType: 'json' promise.done (result) => user = Ember.Object.create(result) if result.isAnon @set 'session.isAnon', true @set 'session.currentUser', null else @set 'session.isAnon', false @set 'session.currentUser', user resolve(user) promise.fail (result) -> reject() clearSession: -> @set 'session.currentUser', undefined @set 'session.isAnon', true @set 'settings.editMode', false actions: toggleEditMode: -> @toggleProperty 'settings.editMode' @send 'flushUpdateQueue' flushUpdateQueue: -> return unless @get('session.currentUser.isAdmin') updateQueue = @get('updateQueue') while updateQueue.get('length') section = updateQueue.popObject() section.save() error: (result, transition) -> if result.status is 403 @clearSession() @transitionTo 'signout' `export default Route`
Return proper Ember.RSVP.Promise to avoid troubles on browsers
Return proper Ember.RSVP.Promise to avoid troubles on browsers
CoffeeScript
mit
artzte/fightbook-app
a0424fbb33a44822064867aff9b7bce6cd5faeda
lib/tag-reader.coffee
lib/tag-reader.coffee
{Task} = require 'atom' ctags = require 'ctags' fs = require 'fs-plus' handlerPath = require.resolve('./load-tags-handler') module.exports = getTagsFile: -> tagsFile = atom.project.resolve("tags") return tagsFile if fs.isFileSync(tagsFile) tagsFile = atom.project.resolve(".tags") return tagsFile if fs.isFileSync(tagsFile) tagsFile = atom.project.resolve("TAGS") return tagsFile if fs.isFileSync(tagsFile) find: (editor, callback) -> word = editor.getTextInRange(editor.getCursor().getCurrentWordBufferRange()) tagsFile = @getTagsFile() if word?.length > 0 and tagsFile ctags.findTags(tagsFile, word, callback) else process.nextTick -> callback(null, []) getAllTags: (callback) -> projectTags = [] task = Task.once handlerPath, atom.project.getPath(), -> callback(projectTags) task.on 'tags', (paths) -> projectTags.push(paths...) task
{Task} = require 'atom' ctags = require 'ctags' fs = require 'fs-plus' handlerPath = require.resolve('./load-tags-handler') module.exports = getTagsFile: -> tagsFile = atom.project.resolve("tags") return tagsFile if fs.isFileSync(tagsFile) tagsFile = atom.project.resolve(".tags") return tagsFile if fs.isFileSync(tagsFile) tagsFile = atom.project.resolve("TAGS") return tagsFile if fs.isFileSync(tagsFile) find: (editor, callback) -> range = editor.getCursor().getCurrentWordBufferRange() symbol = getSymbolFromRange(editor, range) tagsFile = @getTagsFile() if symbol?.length > 0 and tagsFile ctags.findTags(tagsFile, symbol, callback) else process.nextTick -> callback(null, []) getAllTags: (callback) -> projectTags = [] task = Task.once handlerPath, atom.project.getPath(), -> callback(projectTags) task.on 'tags', (paths) -> projectTags.push(paths...) task getSymbolFromRange = (editor, range) -> word = editor.getTextInRange(range) charAfterWord = getCharAfterWord(editor, range) if charAfterWord == "?" or charAfterWord == "!" return word + charAfterWord else return word getCharAfterWord = (editor, range) -> return editor.getTextInRange([[range.end.row, range.end.column], [range.end.row, range.end.column + 1]])
Add support for Ruby bang and question methods
Add support for Ruby bang and question methods * The ::find method of tag-reader.coffee uses getCurrentWordBufferRange() to pull in the current word to pull in the current tag. Passing in a custom regexp to getCurrentWordBufferRange() determines what constitutes a word. * Obtain the charAfterWord by incrementing the row by one. If the character is a question mark or exclamation point, append charAfterWord to word and search the whole thing.
CoffeeScript
mit
rodumani/symbols-view,changjej/symbols-view,spencerlyon2/symbols-view,harai/atom-gnu-global,atom/symbols-view,changjej/symbols-view,kainwinterheart/symbols-view,spencerlyon2/symbols-view,rodumani/symbols-view,harai/atom-gnu-global
592af2c9acd0adb6d6bb260ee8439da67d2052bb
app/src/restclients/restclient.coffee
app/src/restclients/restclient.coffee
ledger.api ?= {} class ledger.api.HttpClient extends @HttpClient constructor: () -> super authenticated: -> ledger.api.authenticated(@_baseUrl) class ledger.api.RestClient @API_BASE_URL: ledger.config.restClient.baseUrl @singleton: () -> @instance ||= new @() http: () -> @_client ||= @_httpClientFactory() @_client.setHttpHeader 'X-Ledger-Locale', chrome.i18n.getUILanguage() @_client.setHttpHeader 'X-Ledger-Platform', 'chrome' @_client networkErrorCallback: (callback) -> errorCallback = (xhr, status, message) -> callback(null, {xhr, status, message, code: ledger.errors.NetworkError}) errorCallback _httpClientFactory: -> new ledger.api.HttpClient(ledger.config.restClient.baseUrl) class ledger.api.AuthRestClient extends ledger.api.RestClient _httpClientFactory: -> super().authenticated(@baseUrl) @testRestClientAuthenticate = -> f = -> ledger.app.wallet.getBitIdAddress (address) -> r = new ledger.api.AuthRestClient() r.http().get url: "accountsettings/#{address}" onSuccess: () -> l arguments onError: () -> e arguments ledger.app.wallet.getState (state) -> if state is ledger.wallet.States.LOCKED ledger.app.wallet.unlockWithPinCode '0000', f else do f
ledger.api ?= {} class ledger.api.HttpClient extends @HttpClient constructor: () -> super authenticated: -> ledger.api.authenticated(@_baseUrl) class ledger.api.RestClient @API_BASE_URL: ledger.config.restClient.baseUrl @singleton: () -> @instance ||= new @() http: () -> @_client ||= @_httpClientFactory() @_client.setHttpHeader 'X-Ledger-Locale', chrome.i18n.getUILanguage() @_client.setHttpHeader 'X-Ledger-Platform', 'chrome' @_client.setHttpHeader 'X-Ledger-Environment', ledger.env @_client networkErrorCallback: (callback) -> errorCallback = (xhr, status, message) -> callback(null, {xhr, status, message, code: ledger.errors.NetworkError}) errorCallback _httpClientFactory: -> new ledger.api.HttpClient(ledger.config.restClient.baseUrl) class ledger.api.AuthRestClient extends ledger.api.RestClient _httpClientFactory: -> super().authenticated(@baseUrl) @testRestClientAuthenticate = -> f = -> ledger.app.wallet.getBitIdAddress (address) -> r = new ledger.api.AuthRestClient() r.http().get url: "accountsettings/#{address}" onSuccess: () -> l arguments onError: () -> e arguments ledger.app.wallet.getState (state) -> if state is ledger.wallet.States.LOCKED ledger.app.wallet.unlockWithPinCode '0000', f else do f
Add 'X-Ledger-Environment' in HTTP requests header
Add 'X-Ledger-Environment' in HTTP requests header
CoffeeScript
mit
LedgerHQ/ledger-wallet-chrome,LedgerHQ/ledger-wallet-chrome,Morveus/ledger-wallet-doge-chrome,Morveus/ledger-wallet-doge-chrome
65d176f533746d463d125573e66d170f78516111
app/assets/javascripts/darkswarm/filters/localize_currency.js.coffee
app/assets/javascripts/darkswarm/filters/localize_currency.js.coffee
Darkswarm.filter "localizeCurrency", (currencyConfig)-> # Convert number to string currency using injected currency configuration. (amount) -> # Set country code (eg. "US"). currency_code = if currencyConfig.display_currency then " " + currencyConfig.currency else "" # Set decimal points, 2 or 0 if hide_cents. decimals = if currencyConfig.hide_cents == "true" then 0 else 2 # Set wether the currency symbol appears first sign_first = currencyConfig.symbol_position == 'before' # We need to use parseFloat as the amount should come in as a string. amount = parseFloat(amount) # Build the final price string. I18n.toCurrency(amount, {precision: decimals, unit: currencyConfig.symbol, sign_first: sign_first}) + currency_code
Darkswarm.filter "localizeCurrency", (currencyConfig)-> # Convert number to string currency using injected currency configuration. (amount) -> # Set country code (eg. "US"). currency_code = if currencyConfig.display_currency then " " + currencyConfig.currency else "" # Set decimal points, 2 or 0 if hide_cents. decimals = if currencyConfig.hide_cents == "true" then 0 else 2 # Set format if the currency symbol should come after the number, otherwise (default) use the locale setting. format = if currencyConfig.symbol_position == "after" then "%n %u" else undefined # We need to use parseFloat as the amount should come in as a string. amount = parseFloat(amount) # Build the final price string. I18n.toCurrency(amount, {precision: decimals, unit: currencyConfig.symbol, format: format}) + currency_code
Fix wrong way to force currency symbol after the amount
Fix wrong way to force currency symbol after the amount
CoffeeScript
agpl-3.0
mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,oeoeaio/openfoodnetwork,Matt-Yorkley/openfoodnetwork,oeoeaio/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,oeoeaio/openfoodnetwork,mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,oeoeaio/openfoodnetwork,lin-d-hop/openfoodnetwork
9437d7868e7ef6afe611eb1c9f7a1a5813a6f89a
index.coffee
index.coffee
'use strict'; util = require 'util' {EventEmitter} = require 'events' elasticsearch = require 'elasticsearch' _ = require 'lodash' debug = require('debug')('meshblu-elasticsearch') request = require 'request' MESSAGE_SCHEMA = type: 'object' properties: exampleBoolean: type: 'boolean' required: true exampleString: type: 'string' required: true OPTIONS_SCHEMA = type: 'object' properties: firstExampleOption: type: 'string' required: true class Plugin extends EventEmitter constructor: -> @options = {} @messageSchema = MESSAGE_SCHEMA @optionsSchema = OPTIONS_SCHEMA @elasticsearch = new elasticsearch.Client host: 'localhost:9200' onMessage: (message) => debug 'onMessage', message return if message.topic == 'device-status' topic = _.snakeCase message.topic @elasticsearch.create index: "event_#{topic}" type: 'event' body: message.payload onConfig: (device) => @setOptions device.options setOptions: (options={}) => @options = options module.exports = messageSchema: MESSAGE_SCHEMA optionsSchema: OPTIONS_SCHEMA Plugin: Plugin
'use strict'; util = require 'util' {EventEmitter} = require 'events' elasticsearch = require 'elasticsearch' _ = require 'lodash' debug = require('debug')('meshblu-elasticsearch') request = require 'request' MESSAGE_SCHEMA = type: 'object' properties: exampleBoolean: type: 'boolean' required: true exampleString: type: 'string' required: true OPTIONS_SCHEMA = type: 'object' properties: firstExampleOption: type: 'string' required: true class Plugin extends EventEmitter constructor: -> @options = {} @messageSchema = MESSAGE_SCHEMA @optionsSchema = OPTIONS_SCHEMA @elasticsearch = new elasticsearch.Client host: process.env.ELASTICSEARCH_HOST hostname: process.env.ELASTICSEARCH_HOSTNAME ? 'localhost' port: process.env.ELASTICSEARCH_PORT ? '9200' onMessage: (message) => debug 'onMessage', message return if message.topic == 'device-status' topic = _.snakeCase message.topic @elasticsearch.create index: "event_#{topic}" type: 'event' body: message.payload onConfig: (device) => @setOptions device.options setOptions: (options={}) => @options = options module.exports = messageSchema: MESSAGE_SCHEMA optionsSchema: OPTIONS_SCHEMA Plugin: Plugin
Allow overriding of elasticsearch config via environment
Allow overriding of elasticsearch config via environment
CoffeeScript
mit
octoblu/meshblu-elasticsearch
97821d54f98f1c04020c7574c07d8ec4f205d6fc
index.coffee
index.coffee
module.exports = (Impromptu, register, system) -> register 'pwd', update: -> process.env.PWD register 'prettyPwd', update: -> cwd = process.env.PWD if cwd.indexOf process.env.HOME == 0 cwd = '~' + cwd.slice process.env.HOME.length cwd register 'user', update: (done) -> Impromptu.exec 'whoami', done register 'host', update: (done) -> Impromptu.exec 'hostname', done register 'shortHost', update: (done) -> system.host (err, host) -> done err, host.split('.', 1)[0]
module.exports = (Impromptu, register, system) -> register 'pwd', update: -> process.env.PWD register 'prettyPwd', update: -> cwd = process.env.PWD if cwd.indexOf(process.env.HOME) == 0 cwd = '~' + cwd.slice process.env.HOME.length cwd register 'user', update: (done) -> Impromptu.exec 'whoami', done register 'host', update: (done) -> Impromptu.exec 'hostname', done register 'shortHost', update: (done) -> system.host (err, host) -> done err, host.split('.', 1)[0]
Fix logic/syntax error checking for child paths of home directory
Fix logic/syntax error checking for child paths of home directory Fixes #5
CoffeeScript
mit
impromptu/impromptu-system
a4f1049b6dc240714d276eeae8ded19e20df8e3c
lib/autosave.coffee
lib/autosave.coffee
{$} = require 'atom' module.exports = configDefaults: enabled: false activate: -> atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) => editor = event.targetView()?.getModel() @autosave(editor) atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) => @autosave(paneItem) $(window).preempt 'beforeunload', => for pane in atom.workspaceView.getPanes() @autosave(paneItem) for paneItem in pane.getItems() autosave: (paneItem) -> return unless atom.config.get('autosave.enabled') return unless paneItem?.getUri?()? return unless paneItem?.isModified?() paneItem?.save?()
{$} = require 'atom' module.exports = configDefaults: enabled: false activate: -> atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) => editor = $(event.target).closest('.editor').view()?.getModel() @autosave(editor) atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) => @autosave(paneItem) $(window).preempt 'beforeunload', => for pane in atom.workspaceView.getPanes() @autosave(paneItem) for paneItem in pane.getItems() autosave: (paneItem) -> return unless atom.config.get('autosave.enabled') return unless paneItem?.getUri?()? return unless paneItem?.isModified?() paneItem?.save?()
Make focusout handling compatible with React editor
Make focusout handling compatible with React editor Because the input element isn't handled by jQuery, it's not possible to retrieve the containing view with Event::targetView. This approach is wordier but can retrieve the view correctly.
CoffeeScript
mit
atom/autosave,akonwi/autosave
f1478cec9ac1e08b053f5a01dcc5df2ba17fc042
lib/package-list-custom-list-view.coffee
lib/package-list-custom-list-view.coffee
{$, EditorView, View} = require 'atom' utils = require './Utils' module.exports= class PackageListCustomListView extends View @content: -> @div class: 'overlay from-top', => @subview 'gistUrl', new EditorView(mini: true, placeholderText: 'ID of Gist with packages list.') @div class: 'block', => @span class: 'pull-left', => @button class: 'btn btn-success inline-block-tight gp-confirm-button', click: 'confirmList', 'Confirm' @span class: 'pull-right', => @button class: 'btn btn-error inline-block-tight gp-cancel-button', click: 'abort', 'Cancel' confirmList: -> wasListLoaded = utils.loadPackageListFromGIst @gistUrl.text() @detach() if wasListLoaded initialize: -> @on 'core:cancel', => @detach() @on 'core:confirm', => @confirmList() atom.workspaceView.append this abort: -> @detach()
{$, EditorView, View} = require 'atom' utils = require './Utils' module.exports= class PackageListCustomListView extends View @content: -> @div class: 'overlay from-top', => @subview 'gistUrl', new EditorView(mini: true, placeholderText: 'ID of Gist with packages list.') @div class: 'block', => @span class: 'pull-left', => @button class: 'btn btn-success inline-block-tight gp-confirm-button', click: 'confirmList', 'Confirm' @span class: 'pull-right', => @button class: 'btn btn-error inline-block-tight gp-cancel-button', click: 'abort', 'Cancel' confirmList: -> utils.loadPackageListFromGIst @gistUrl.text() @detach() initialize: -> @on 'core:cancel', => @detach() @on 'core:confirm', => @confirmList() atom.workspaceView.append this abort: -> @detach()
Detach custom list window even if downloading fails
Detach custom list window even if downloading fails
CoffeeScript
mit
Trudko/package-list-downloader
32062613c6a9de47447f0208eaaaf937e3cbbf44
app/assets/javascripts/components/users/base.js.coffee
app/assets/javascripts/components/users/base.js.coffee
window.UsersComponent = class UsersComponent @initialize: -> @addEventListeners() @addEventListeners: -> @userDetailsTooltip() @userDetailsTooltip: -> tooltipClass = '.information-tooltip' $(document).on('click', "#{tooltipClass}-trigger", (ev) -> ev.preventDefault() $this = $(@) if ($this.find('.fa-align-left').length) $("#{tooltipClass}-trigger").not(@).siblings(tooltipClass).hide() $("#{tooltipClass}-trigger").not(@).html('<i class="fa fa-align-left"></i> details') $this.html('<i class="fa fa-close"></i> close') $this.siblings(tooltipClass).show() else $this.html('<i class="fa fa-align-left"></i> details') $this.siblings(tooltipClass).hide() ) $(document).ready -> UsersComponent.initialize()
window.UsersComponent = class UsersComponent @initialize: -> @addEventListeners() @addEventListeners: -> @userDetailsTooltip() #Enables search through users table enableSearch() @userDetailsTooltip: -> tooltipClass = '.information-tooltip' $(document).on('click', "#{tooltipClass}-trigger", (ev) -> ev.preventDefault() $this = $(@) if ($this.find('.fa-align-left').length) $("#{tooltipClass}-trigger").not(@).siblings(tooltipClass).hide() $("#{tooltipClass}-trigger").not(@).html('<i class="fa fa-align-left"></i> details') $this.html('<i class="fa fa-close"></i> close') $this.siblings(tooltipClass).show() else $this.html('<i class="fa fa-align-left"></i> details') $this.siblings(tooltipClass).hide() ) $(document).ready -> UsersComponent.initialize()
Enable search in users table
Enable search in users table
CoffeeScript
bsd-3-clause
unepwcmc/ORS,unepwcmc/ORS,unepwcmc/ORS,unepwcmc/ORS,unepwcmc/ORS
95c910f30c3c1f9a477730a01064e87b2238ba2e
spec/parser_spec.coffee
spec/parser_spec.coffee
Walrus = require '../lib/walrus' describe 'Walrus.Parser', -> it 'should be defined', -> expect( Walrus.Parser ).toBeDefined( ) describe '#parse', -> it 'should be defined', -> expect( Walrus.Parser.parse ).toBeDefined( ) it 'should parse all examples correctly', -> fs = require 'fs' path = require 'path' test = ( basename ) -> text = fs.readFileSync "#{basename}.wal", 'utf8' json = fs.readFileSync "#{basename}.js", 'utf8' html = fs.readFileSync "#{basename}.html", 'utf8' Walrus.Parser.parser.yy = Walrus.AST tmpl = Walrus.Parser.parse text console.log tmpl console.log eval( "(#{json})" ) console.log tmpl.compile( eval( "(#{json})" ) ) expect( tmpl.compile eval( "(#{json})" ) ).toEqual html for file in fs.readdirSync './spec/examples' test "./spec/examples/#{path.basename file, '.wal'}" if path.extname( file ) is '.wal'
Walrus = require '../lib/walrus' describe 'Walrus.Parser', -> it 'should be defined', -> expect( Walrus.Parser ).toBeDefined( ) describe '#parse', -> it 'should be defined', -> expect( Walrus.Parser.parse ).toBeDefined( ) fs = require 'fs' path = require 'path' specs = './spec/examples' Walrus.Parser.parser.yy = Walrus.AST for file in fs.readdirSync specs when path.extname( file ) is '.wal' do ( file ) -> base = path.basename file, '.wal' text = fs.readFileSync "#{specs}/#{base}.wal", 'utf8' json = fs.readFileSync "#{specs}/#{base}.js", 'utf8' html = fs.readFileSync "#{specs}/#{base}.html", 'utf8' tmpl = Walrus.Parser.parse text console.log '*****' console.log file console.log tmpl console.log eval( "(#{json})" ) console.log tmpl.compile( eval( "(#{json})" ) ) it "should pass the #{base} example", -> expect( tmpl.compile eval( "(#{json})" ) ).toEqual html
Refactor parser specs to gain one expectation per spec
Refactor parser specs to gain one expectation per spec
CoffeeScript
mit
jeremyruppel/walrus
f8714c7acf0ea10576bfb408a01ac0fddd9c2ff9
specs/smoke.spec.coffee
specs/smoke.spec.coffee
require('./spec_helper') spy = require('through2-spy') describe 'smoke test', -> createFS = require('../index') coffee = require('gulp-coffee') it 'should mock gulp', (done) -> fs = createFS src: coffee: 'sample.coffee': """ console.log 'Hello world' """ 'another.coffee': """ fib = (n) -> switch n when 0, 1 1 else fib(n) + fib(n-1) """ fs.createReadStream 'src/coffee' .pipe coffee bare: true .pipe fs.createWriteStream('dest/js', true) .onFinished done, (folder) -> console.log fs.directory # Display whole tree of files folder.should.equal fs.openFolder('dest/js') folder['sample.js'].should.not.be.null folder['another.js'].should.not.be.null
require('./spec_helper') spy = require('through2-spy') describe 'smoke test', -> createFS = require('../index') coffee = require('gulp-coffee') it 'should mock gulp', (done) -> fs = createFS src: coffee: 'sample.coffee': """ console.log 'Hello world' """ 'another.coffee': """ fib = (n) -> switch n when 0, 1 1 else fib(n) + fib(n-1) """ fs.src 'src/coffee/*.coffee' .pipe coffee bare: true .pipe fs.dest 'dest/js' .onFinished done, (folder) -> # console.log fs.directory # Display whole tree of files folder.should.equal fs.openFolder('dest/js') folder['sample.js'].should.not.be.null folder['another.js'].should.not.be.null
Update smoke test with latest API
Update smoke test with latest API
CoffeeScript
mit
gonzoRay/vinyl-fs-mock,timnew/vinyl-fs-mock
416295fa0620840c7685e1e2bc1417eea3e18b6c
spec/welcome-spec.coffee
spec/welcome-spec.coffee
describe "Welcome", -> editor = null beforeEach -> waitsForPromise -> atom.packages.activatePackage("welcome") waitsFor -> editor = atom.workspace.getActiveTextEditor() describe "when activated for the first time", -> it "shows the welcome buffer", -> expect(editor.getText()).toMatch(/Welcome to Atom/) describe "when activated again", -> beforeEach -> atom.workspace.getActivePane().destroy() atom.packages.deactivatePackage("welcome") waitsForPromise -> atom.packages.activatePackage("welcome") waits(200) it "doesn't show the welcome buffer", -> expect(atom.workspace.getPaneItems().length).toBe(0) describe "the welcome:show-welcome-buffer command", -> workspaceElement = null beforeEach -> workspaceElement = atom.views.getView(atom.workspace) it "shows the welcome buffer", -> atom.workspace.getActivePane().destroy() atom.commands.dispatch(workspaceElement, 'welcome:show-welcome-buffer') waitsFor -> editor = atom.workspace.getActiveTextEditor() runs -> expect(editor.getText()).toMatch(/Welcome to Atom/)
describe "Welcome", -> editor = null beforeEach -> spyOn(atom.workspace, 'open').andCallThrough() waitsForPromise -> atom.packages.activatePackage("welcome") waitsFor -> editor = atom.workspace.getActiveTextEditor() describe "when activated for the first time", -> it "shows the welcome buffer", -> expect(atom.workspace.open).toHaveBeenCalled() expect(editor.getText()).toMatch(/Welcome to Atom/) describe "when activated again", -> beforeEach -> atom.workspace.getActivePane().destroy() atom.packages.deactivatePackage("welcome") atom.workspace.open.reset() waitsForPromise -> atom.packages.activatePackage("welcome") it "doesn't show the welcome buffer", -> expect(atom.workspace.open).not.toHaveBeenCalled() describe "the welcome:show-welcome-buffer command", -> workspaceElement = null beforeEach -> workspaceElement = atom.views.getView(atom.workspace) it "shows the welcome buffer", -> atom.workspace.getActivePane().destroy() atom.commands.dispatch(workspaceElement, 'welcome:show-welcome-buffer') waitsFor -> editor = atom.workspace.getActiveTextEditor() runs -> expect(editor.getText()).toMatch(/Welcome to Atom/)
Speed up test suite more
Speed up test suite more
CoffeeScript
mit
atom/welcome
9abec4880679864e6ed8c5b7657ecf51c7a423d9
server/services/twilioService.coffee
server/services/twilioService.coffee
twilio = require("twilio") bot = require("../bot") config = require("../config") TWILIO_PHONE = config.twilio.phone TWILIO_ACCOUNT_SID = config.twilio.accountSid TWILIO_AUTH_TOKEN = config.twilio.authToken if not (TWILIO_PHONE and TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN) throw new Error "Please configure Twilio" client = twilio(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) module.exports = receive: (req, res) -> # console.log(req, res); # Respond empty to SMS. # Empty responses are not sent as SMS to sender. twiml = new twilio.TwimlResponse() res.send(twiml) from = req.body.From message = req.body.Body bot.generateResponse conversation: from message: message meta: req.body , (error, result) -> # console.log(error, result); if error body = error.message else body = result.response.plain client.sendMessage({ to: from from: TWILIO_PHONE body: body }, (err, responseData) -> # console.log(err, responseData) )
twilio = require("twilio") bot = require("../bot") config = require("../config") TWILIO_PHONE = config.twilio.phone TWILIO_ACCOUNT_SID = config.twilio.accountSid TWILIO_AUTH_TOKEN = config.twilio.authToken if not (TWILIO_PHONE and TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN) throw new Error "Please configure Twilio" client = twilio(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) module.exports = receive: (req, res) -> # console.log(req, res); # Respond empty to SMS. # Empty responses are not sent as SMS to sender. twiml = new twilio.TwimlResponse() res.send(twiml) from = req.body.From message = req.body.Body bot.generateResponse conversation: from message: message meta: req.body , (error, result) -> # console.log(error, result); if error body = "An error occurred: #{error.message}" else body = result.response.plain client.sendMessage({ to: from from: TWILIO_PHONE body: body }, (err, responseData) -> # console.log(err, responseData) )
Add prefix to error messages
Add prefix to error messages "An error occurred: #{ERROR}"
CoffeeScript
mit
Glavin001/TorrentAutomator,Glavin001/TorrentAutomator,Glavin001/TorrentAutomator
f75f784a1a2c0e99d5e05c482c05ee52ccd8cbad
app/scripts/components/ViewportRelativeMotion.coffee
app/scripts/components/ViewportRelativeMotion.coffee
Crafty.c 'ViewportRelativeMotion', init: -> remove: -> viewportRelativeMotion: ({ x, y, speed }) -> @_startLocation = { x, y } @_speed = speed @_initialViewport = x: (Crafty.viewport.width / 4) @_location = sx: x + ((x - @_initialViewport.x) * (@_speed - 1)) sy: y dx: @dx ? 0 dy: @dy ? 0 shifted = (@_initialViewport.x - Crafty.viewport._x) * (@_speed - 1) newX = @_location.sx - shifted + @dx newY = @_location.sy - (Crafty.viewport._y * (1 - @_speed)) + @dy @_location.x = newX @_location.y = newY @attr @_location @motion = Crafty.bind 'ViewportScroll', => shifted = (@_initialViewport.x - Crafty.viewport._x) * (@_speed - 1) newX = @_location.sx - shifted + @dx newY = @_location.sy - (Crafty.viewport._y * (1 - @_speed)) + @dy @attr x: newX, y: newY this remove: -> Crafty.unbind 'CameraScroll', @motion
Crafty.c 'ViewportRelativeMotion', init: -> remove: -> viewportRelativeMotion: ({ x, y, speed }) -> @_startLocation = { x, y } @_speed = speed @_initialViewport = x: (Crafty.viewport.width / 4) @_location = sx: x + ((x - @_initialViewport.x) * (@_speed - 1)) sy: y dx: @dx ? 0 dy: @dy ? 0 shifted = (@_initialViewport.x - Crafty.viewport._x) * (@_speed - 1) newX = @_location.sx - shifted + @_location.dx newY = @_location.sy - (Crafty.viewport._y * (1 - @_speed)) + @_location.dy @_location.x = newX @_location.y = newY @attr @_location @motion = Crafty.bind 'ViewportScroll', => shifted = (@_initialViewport.x - Crafty.viewport._x) * (@_speed - 1) newX = @_location.sx - shifted + @dx newY = @_location.sy - (Crafty.viewport._y * (1 - @_speed)) + @dy @attr x: newX, y: newY this remove: -> Crafty.unbind 'CameraScroll', @motion
Fix issue of initial placement of items
Fix issue of initial placement of items
CoffeeScript
mit
matthijsgroen/game-play,matthijsgroen/game-play,matthijsgroen/game-play
7c836132adededdee2b1bc175251d1c470c25124
lib/actions/info.coffee
lib/actions/info.coffee
packageJSON = require('../../package.json') exports.version = signature: 'version' description: 'output the version number' action: -> console.log(packageJSON.version)
packageJSON = require('../../package.json') exports.version = signature: 'version' description: 'output the version number' action: -> console.log("#{packageJSON.name}: #{packageJSON.version}") console.log("node: #{process.version}")
Add node version to version command output
Add node version to version command output
CoffeeScript
apache-2.0
resin-io/resin-cli,resin-io/resin-cli,resin-io/resin-cli,resin-io/resin-cli
eb1522e8539a82a6b6f34052310b159069622bc1
brunch-config.coffee
brunch-config.coffee
exports.config = # See http://brunch.readthedocs.org/en/latest/config.html for documentation. paths: public: 'public' files: javascripts: joinTo: 'js/app.js': /^app/ stylesheets: joinTo: 'ss/app.css': /^app\/styles/
exports.config = # See http://brunch.readthedocs.org/en/latest/config.html for documentation. paths: public: 'public' files: javascripts: joinTo: 'js/app.js': /^app/ stylesheets: joinTo: 'ss/app.css': /^app\/styles/ plugins: sass: mode: 'native'
Configure sass to use libsass
Configure sass to use libsass
CoffeeScript
mit
mgarbacz/existential.io
c291b057515ba991cb89ba4799ff1115d59e0b30
src/storyboard.coffee
src/storyboard.coffee
### | Storyboard | (c) Guillermo Grau Panea 2016 | License: MIT ### k = require './constants' # Enable chalk colors in the browser (we'll handle the conversion) if k.IS_BROWSER process.env.COLORTERM = true hub = require './hub' stories = require './stories' consoleListener = require './listeners/console' mainStory = stories.createStory [] hub.init {mainStory} hub.addListener consoleListener # Make sure a record is created mainStory.changeTitle 'ROOT STORY' module.exports = { mainStory, addListener: hub.addListener, getListeners: hub.getListeners, }
### | Storyboard | (c) Guillermo Grau Panea 2016 | License: MIT ### k = require './constants' # Chalk is disabled by default in the browser. Override # this default (we'll handle ANSI code conversion ourselves # when needed) chalk = require 'chalk' chalk.enabled = true mainStory = require './stories' hub = require './hub' hub.init {mainStory} hub.addListener require './listeners/console' if k.IS_BROWSER hub.addListener require './listeners/wsClient' # Make sure a record is created for the root story mainStory.logStory 'CREATED' module.exports = { mainStory, addListener: hub.addListener, getListeners: hub.getListeners, }
Add wsClient listener by default in browser. More robust way to enable chalk in browser
Add wsClient listener by default in browser. More robust way to enable chalk in browser
CoffeeScript
mit
guigrpa/storyboard,guigrpa/storyboard
ab6ebf61b931123b0e2a244a4efd51dd06153f62
Gruntfile.coffee
Gruntfile.coffee
module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-concat' grunt.loadNpmTasks 'grunt-chmod' grunt.initConfig meta: shebang: '#!/usr/bin/env node' coffee: default: options: bare: true files: 'summon': 'summon.coffee' # Prepend the node shebang line concat: options: banner: '<%= meta.shebang %>\n' dist: src: 'summon' dest: 'summon' # Make sure the file is executable chmod: options: mode: '755' target: src: 'summon' grunt.registerTask 'default', ['coffee', 'concat', 'chmod']
module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-concat' grunt.loadNpmTasks 'grunt-chmod' grunt.initConfig meta: shebang: '#!/usr/bin/env node' hacking: """ // Please don't edit this file directly. It is compiled from the CoffeeScript // in summon.coffee. If you edit the CoffeeScript source and compile its changes, // please keep the commits to this file separate. See the README for instructions // on setting up a pre-commit hook to help with that. """ coffee: default: options: bare: true files: 'summon': 'summon.coffee' # Prepend the node shebang line concat: options: banner: '<%= meta.shebang %>\n\n<%= meta.hacking %>\n\n' dist: src: 'summon' dest: 'summon' # Make sure the file is executable chmod: options: mode: '755' target: src: 'summon' grunt.registerTask 'default', ['coffee', 'concat', 'chmod']
Add info to compiled summon file about editing/commiting it.
Add info to compiled summon file about editing/commiting it.
CoffeeScript
mit
impromptu/summon,impromptu/summon,impromptu/summon
0a7ad0e126d5b0cf9350f9eaf6d9100a99e248a0
Gruntfile.coffee
Gruntfile.coffee
module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') meta: banner: '/*! <%= pkg.name %> <%= pkg.version %> | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n' coffee: compile: expand: true cwd: 'coffee/' src: ['**/*.coffee'] dest: 'js/' ext: '.js' uglify: options: banner: '<%= meta.banner %>' dist: files: 'js/uTip.min.js': ['js/uTip.js'] watch: files: 'coffee/**/*.coffee' tasks: ['compile'] grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.registerTask 'compile', ['coffee', 'uglify'] grunt.registerTask 'default', ['compile', 'watch']
module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') meta: banner: '/*! <%= pkg.name %> <%= pkg.version %> | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n' coffee: compile: expand: true cwd: 'coffee/' src: ['**/*.coffee'] dest: 'js/' ext: '.js' uglify: options: banner: '<%= meta.banner %>' dist: files: 'js/uTip.min.js': ['js/uTip.js'] watch: files: 'coffee/**/*.coffee' tasks: ['compile'] grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.registerTask 'compile', ['coffee', 'uglify'] grunt.registerTask 'dev', ['compile', 'watch'] grunt.registerTask 'default', ['default']
Create "dev" grunt task and set "default" as alias
Create "dev" grunt task and set "default" as alias
CoffeeScript
mit
aduth/uTip