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 |
|---|---|---|---|---|---|---|---|---|---|
d9095d06830f23b030a8e47a031310756863daae | app/assets/javascripts/lib/managers/select_group_manager.js.coffee | app/assets/javascripts/lib/managers/select_group_manager.js.coffee | define ['jquery'], ($) ->
class SelectGroup
constructor: (@parent = null, @callback = false) ->
@selectParent = (if @parent != null then $(@parent) else $('.js-select-group'))
@addHandlers()
addHandlers: ->
@selectParent.on 'focus', '.js-select', (e) =>
@getOverlay(e.target).addClass 'dropdown__value--selected'
@selectParent.on 'blur', '.js-select', (e) =>
@getOverlay(e.target).removeClass 'dropdown__value--selected'
@selectParent.on 'keyup', '.js-select', (e) =>
$(e.target).trigger('change')
@selectParent.on 'change', '.js-select', (e) =>
e.preventDefault()
t = $(e.target).find("option:selected")
val = t.text()
@getOverlay(e.target).text(val)
if @callback then @callback(e.target)
getOverlay: (target) ->
$(target).closest(@parent).find('.js-select-overlay')
| define ['jquery'], ($) ->
class SelectGroup
constructor: (@parent = null, @callback = false) ->
@selectParent = (if @parent != null then $(@parent) else $('.js-select-group'))
@selectParent.find('.js-select').each (eltIndex) =>
@setOverlay(@selectParent[eltIndex])
@addHandlers()
addHandlers: ->
@selectParent.on 'focus', '.js-select', (e) =>
@getOverlay(e.target).addClass 'dropdown__value--selected'
@selectParent.on 'blur', '.js-select', (e) =>
@getOverlay(e.target).removeClass 'dropdown__value--selected'
@selectParent.on 'keyup', '.js-select', (e) =>
$(e.target).trigger('change')
@selectParent.on 'change', '.js-select', (e) =>
e.preventDefault()
@setOverlay(e.target)
if @callback then @callback(e.target)
getOverlay: (target) ->
$(target).closest(@parent).find('.js-select-overlay')
setOverlay: (target) ->
t = $(target).find("option:selected")
val = t.text()
@getOverlay(target).text(val)
| Set the value of the overlay on initialition | Set the value of the overlay on initialition
| CoffeeScript | mit | lonelyplanet/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo |
07fa460c4366affee197675c30ab27b721948f4f | client/app/lib/flux/actions/user.coffee | client/app/lib/flux/actions/user.coffee | kd = require 'kd'
actions = require './actiontypes'
fetchAccount = require 'app/util/fetchAccount'
dispatch = (args...) -> kd.singletons.reactor.dispatch args...
###*
* Load account with given id.
*
* @param {string} id
###
loadAccount = (id) ->
origin = generateOrigin id
dispatch actions.LOAD_USER_BEGIN, { id, origin }
fetchAccount origin, (err, account) ->
if err
dispatch actions.LOAD_USER_FAIL, { err, id, origin }
return
dispatch actions.LOAD_USER_SUCCESS, { id, origin, account }
###*
* Generate an origin object for given id.
*
* @param {string} id - JAccount id
* @return {object}
* @api private
###
generateOrigin = (id) -> { id, constructorName: 'JAccount', _id: id }
module.exports = {
loadAccount
}
| kd = require 'kd'
actions = require './actiontypes'
fetchAccount = require 'app/util/fetchAccount'
###*
* Load account with given id.
*
* @param {string} id
###
loadAccount = (id) ->
origin = generateOrigin id
{ reactor } = kd.singletons
reactor.dispatch actions.LOAD_USER_BEGIN, { id, origin }
fetchAccount origin, (err, account) ->
if err
reactor.dispatch actions.LOAD_USER_FAIL, { err, id, origin }
return
reactor.dispatch actions.LOAD_USER_SUCCESS, { id, origin, account }
###*
* Generate an origin object for given id.
*
* @param {string} id - JAccount id
* @return {object}
* @api private
###
generateOrigin = (id) -> { id, constructorName: 'JAccount', _id: id }
module.exports = {
loadAccount
}
| Use reactor directly inside of action | app: Use reactor directly inside of action
| CoffeeScript | agpl-3.0 | kwagdy/koding-1,cihangir/koding,usirin/koding,mertaytore/koding,cihangir/koding,drewsetski/koding,cihangir/koding,acbodine/koding,sinan/koding,mertaytore/koding,jack89129/koding,jack89129/koding,koding/koding,gokmen/koding,usirin/koding,sinan/koding,szkl/koding,koding/koding,alex-ionochkin/koding,alex-ionochkin/koding,jack89129/koding,jack89129/koding,acbodine/koding,gokmen/koding,rjeczalik/koding,sinan/koding,koding/koding,sinan/koding,usirin/koding,drewsetski/koding,alex-ionochkin/koding,jack89129/koding,acbodine/koding,acbodine/koding,jack89129/koding,andrewjcasal/koding,mertaytore/koding,drewsetski/koding,drewsetski/koding,alex-ionochkin/koding,acbodine/koding,koding/koding,szkl/koding,alex-ionochkin/koding,andrewjcasal/koding,usirin/koding,kwagdy/koding-1,usirin/koding,sinan/koding,acbodine/koding,gokmen/koding,szkl/koding,koding/koding,gokmen/koding,acbodine/koding,mertaytore/koding,cihangir/koding,mertaytore/koding,drewsetski/koding,rjeczalik/koding,szkl/koding,jack89129/koding,kwagdy/koding-1,gokmen/koding,szkl/koding,kwagdy/koding-1,sinan/koding,kwagdy/koding-1,andrewjcasal/koding,kwagdy/koding-1,rjeczalik/koding,rjeczalik/koding,alex-ionochkin/koding,rjeczalik/koding,drewsetski/koding,gokmen/koding,cihangir/koding,koding/koding,rjeczalik/koding,andrewjcasal/koding,cihangir/koding,koding/koding,andrewjcasal/koding,usirin/koding,szkl/koding,gokmen/koding,szkl/koding,cihangir/koding,jack89129/koding,acbodine/koding,koding/koding,drewsetski/koding,cihangir/koding,gokmen/koding,alex-ionochkin/koding,usirin/koding,sinan/koding,mertaytore/koding,rjeczalik/koding,mertaytore/koding,rjeczalik/koding,andrewjcasal/koding,drewsetski/koding,alex-ionochkin/koding,kwagdy/koding-1,mertaytore/koding,sinan/koding,szkl/koding,usirin/koding,kwagdy/koding-1,andrewjcasal/koding,andrewjcasal/koding |
f38c370ba973efc90300f9d7b0b6838c05776d3d | lib/find-results-view.coffee | lib/find-results-view.coffee | _ = require 'underscore-plus'
{EditorView, View} = require 'atom'
MarkerView = require './marker-view'
module.exports =
class FindResultsView extends View
@content: ->
@div class: 'search-results'
initialize: (@findModel) ->
@markerViews = {}
@subscribe @findModel, 'updated', (args...) => @markersUpdated(args...)
attach: ->
@getEditor()?.underlayer.append(this)
detach: ->
super
beforeRemove: ->
@destroyAllViews()
getEditor: ->
activeView = atom.workspaceView.getActiveView()
if activeView?.hasClass('editor') then activeView else null
markersUpdated: (markers) ->
editor = @getEditor()
if not editor?
@destroyAllViews()
else
markerViewsToRemoveById = _.clone(@markerViews)
for marker in markers
if @markerViews[marker.id]
delete markerViewsToRemoveById[marker.id]
else
markerView = new MarkerView({editor, marker})
@append(markerView.element)
@markerViews[marker.id] = markerView
for id, markerView of markerViewsToRemoveById
delete @markerViews[id]
markerView.remove()
editor.requestDisplayUpdate()
destroyAllViews: ->
@empty()
@markerViews = {}
| _ = require 'underscore-plus'
{EditorView, View} = require 'atom'
MarkerView = require './marker-view'
# TODO: remove this when marker views are in core. Hopefully soon.
module.exports =
class FindResultsView extends View
@content: ->
@div class: 'search-results'
initialize: (@findModel) ->
@markerViews = {}
debouncedUpdate = _.debounce(@markersUpdated, 20)
@subscribe @findModel, 'updated', =>
if @getEditor()?.hasClass('react')
# HACK: there are some issues with some of the react editor's components
# being not available. We shouldnt be doing this rendering anyway.
# Marker views are coming.
debouncedUpdate()
else
@markersUpdated()
attach: ->
editor = @getEditor()
if editor? and editor.underlayer?
editor.underlayer.append(this)
else if editor?
subscription = @subscribe editor, 'editor:attached', =>
subscription.off()
editor.underlayer.append(this)
detach: ->
super
beforeRemove: ->
@destroyAllViews()
getEditor: ->
activeView = atom.workspaceView.getActiveView()
if activeView?.hasClass('editor') then activeView else null
markersUpdated: =>
editor = @getEditor()
markers = @findModel.markers
if not editor?
@destroyAllViews()
else
markerViewsToRemoveById = _.clone(@markerViews)
for marker in markers
if @markerViews[marker.id]
delete markerViewsToRemoveById[marker.id]
else
markerView = new MarkerView({editor, marker})
@append(markerView.element)
@markerViews[marker.id] = markerView
for id, markerView of markerViewsToRemoveById
delete @markerViews[id]
markerView.remove()
editor.requestDisplayUpdate()
destroyAllViews: ->
@empty()
@markerViews = {}
| Fix error with FindResultsView attachment and update on react editor | Fix error with FindResultsView attachment and update on react editor
When you’d split-open a file, the react editor wasn’t attached or
rendered yet. So there was no under layer, and when you’d try to request
a display update, it would call functions on objects that weren’t there.
So I hack this with a delay. This is not a pretty fix. It will all go
away when there are marker views in core.
refs #232 | CoffeeScript | mit | harai/find-and-replace,atom/find-and-replace,bmperrea/find-and-replace,trevdor/find-and-replace |
f5575743b63cb6eb5f4c11ccf28898b5225b3910 | atom/packages.cson | atom/packages.cson | packages: [
"advanced-open-file"
"atom-alignment"
"atom-beautify"
"atom-transpose"
"change-case"
"color-picker"
"docblockr"
"editorconfig"
"emmet"
"expand-region"
"language-apache"
"language-applescript"
"language-awk"
"language-babel"
"language-diff"
"language-env"
"language-gitattributes"
"language-gitignore"
"language-har"
"language-hosts"
"language-ini"
"language-javascript-jsx"
"language-latex"
"language-liquid"
"language-lisp"
"language-pegjs"
"language-pip"
"language-prolog"
"language-sca"
"language-svg"
"language-tcl"
"language-viml"
"language-x86"
"linter"
"linter-coffeescript"
"linter-eslint"
"linter-flake8"
"linter-jsonlint"
"linter-php"
"linter-shellcheck"
"linter-ui-default"
"monokai"
"package-sync"
"resize-indent"
"sort-lines"
"ssh-config"
"svg-preview"
"tabs-to-spaces"
"teletype"
]
| packages: [
"advanced-open-file"
"atom-alignment"
"atom-beautify"
"atom-transpose"
"change-case"
"color-picker"
"docblockr"
"editorconfig"
"emmet"
"expand-region"
"git-blame"
"language-apache"
"language-applescript"
"language-awk"
"language-babel"
"language-diff"
"language-env"
"language-gitattributes"
"language-gitignore"
"language-har"
"language-hosts"
"language-ini"
"language-javascript-jsx"
"language-latex"
"language-liquid"
"language-lisp"
"language-pegjs"
"language-pip"
"language-prolog"
"language-sca"
"language-svg"
"language-tcl"
"language-viml"
"language-x86"
"linter"
"linter-coffeescript"
"linter-eslint"
"linter-flake8"
"linter-jsonlint"
"linter-php"
"linter-shellcheck"
"linter-ui-default"
"monokai"
"package-sync"
"resize-indent"
"sort-lines"
"ssh-config"
"svg-preview"
"tabs-to-spaces"
"teletype"
]
| Add git-blame to Atom package list | Add git-blame to Atom package list
| CoffeeScript | mit | caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles |
5a0b823397ea4219fe773363e397bfe382acde33 | src/components/contextmenu/contextmenuitem.coffee | src/components/contextmenu/contextmenuitem.coffee | KDView = require './../../core/view.coffee'
JTreeItemView = require './../tree/treeitemview.coffee'
module.exports = class JContextMenuItem extends JTreeItemView
constructor:(options = {}, data = {})->
options.type = "contextitem"
options.cssClass or= "default"
super options, data
@unsetClass "jtreeitem"
if data
if data.type is "divider" or data.type is "separator"
@setClass "separator"
if data.cssClass
@setClass data.cssClass
if data.type is "customView"
@addCustomView data
if data.disabled
@setClass "disabled"
viewAppended:->
super() unless @customView
mouseDown:-> yes
addCustomView:(data)->
@setClass "custom-view"
@unsetClass "default"
@customView = data.view or new KDView
delete data.view
@addSubView @customView
| KDView = require './../../core/view.coffee'
JTreeItemView = require './../tree/treeitemview.coffee'
module.exports = class JContextMenuItem extends JTreeItemView
constructor:(options = {}, data = {})->
options.type = "contextitem"
options.cssClass or= "default #{KD.utils.slugify data.title}"
super options, data
@unsetClass "jtreeitem"
if data
if data.type is "divider" or data.type is "separator"
@setClass "separator"
if data.cssClass
@setClass data.cssClass
if data.type is "customView"
@addCustomView data
if data.disabled
@setClass "disabled"
viewAppended:->
super() unless @customView
mouseDown:-> yes
addCustomView:(data)->
@setClass "custom-view"
@unsetClass "default"
@customView = data.view or new KDView
delete data.view
@addSubView @customView
| Add slugified title as class name to context menu items. | ContextMenu: Add slugified title as class name to context menu items.
| CoffeeScript | mit | anonrig/kd,gokhanturunc/kd,anonrig/kd,gokhanturunc/kd,koding/kd |
ff1024c2a9735548a803a91dde643b9c72b47ae1 | coffee/document.coffee | coffee/document.coffee | "use strict"
ObjectID = require('mongodb').ObjectID
exports.param = (req, res, next, id) ->
return res.json 400, error: 'Invalid ObjectID' if not /[a-f0-9]{24}/.test id
req.id = ObjectID.createFromHexString id
next()
exports.options = (req, res, next) ->
res.setHeader 'Access-Control-Allow-Methods', 'GET, PUT, PATCH, DELETE'
res.send()
exports.get = (req, res, next) ->
req.col.findOne _id: req.id, (err, doc) ->
return next err if err
return res.json 200, documents: [doc], count: 1 if doc
return res.json 404, error: 'Document Not Found'
exports.put = (req, res, next) ->
res.send 501, 'Not Implemented'
# 200, object
exports.patch = (req, res, next) ->
res.send 501, 'Not Implemented'
# 200, object
exports.delete = (req, res, next) ->
res.send 501, 'Not Implemented'
# 204
| "use strict"
ObjectID = require('mongodb').ObjectID
exports.param = (req, res, next, id) ->
return res.json 400, error: 'Invalid ObjectID' if not /^[a-f0-9]{24}$/.test id
req.id = ObjectID.createFromHexString id
next()
exports.options = (req, res, next) ->
res.setHeader 'Access-Control-Allow-Methods', 'GET, PUT, PATCH, DELETE'
res.send()
exports.get = (req, res, next) ->
req.col.findOne _id: req.id, (err, doc) ->
return next err if err
return res.json 200, documents: [doc], count: 1 if doc
return res.json 404, error: 'Document Not Found'
exports.put = (req, res, next) ->
res.send 501, 'Not Implemented'
# 200, object
exports.patch = (req, res, next) ->
res.send 501, 'Not Implemented'
# 200, object
exports.delete = (req, res, next) ->
res.send 501, 'Not Implemented'
# 204
| Fix ObjectID hex string validation | Fix ObjectID hex string validation
| CoffeeScript | mit | Turistforeningen/Turbasen,Turbasen/Turbasen |
7d2896ab972eaddbb24a408d5cb505e7badeb356 | src/index.coffee | src/index.coffee | hl = require 'highlight.js'
mousetrap = require 'mousetrap'
$ = require 'zeptojs'
processor = require './slide-pack-processor'
ui = require './slide-pack-ui'
executeHooks = ->
if f = window._slide_pack_process_slides
f $('.slide')
$('[data-slide-pack]').each ->
slides = processor.process $(@).html()
$article = $('<article></article>').addClass 'slide-pack'
for slide in slides
$slide = $('<section></section>')
.addClass(slide.cssClass)
.addClass('slide')
$slide.html(slide.html)
$article.append $slide
$('body').append $article
executeHooks()
ui.init slidePack : $('.slide-pack')
# keyboard navigation
mousetrap.bind ['left', 'up', 'k', 'h'], ui.prev
mousetrap.bind ['right', 'down', 'j', 'l'], ui.next
# mouse/touch navigation
$(document).on 'click', ui.next
hl.initHighlightingOnLoad()
| hl = require 'highlight.js'
mousetrap = require 'mousetrap'
$ = require 'zeptojs'
processor = require './slide-pack-processor'
ui = require './slide-pack-ui'
executeHooks = ->
if f = window._slide_pack_process_slides
f $('.slide')
$('[data-slide-pack]').each ->
$slidePack = $(@)
slides = processor.process $slidePack.html()
$article = $('<article></article>')
for slide in slides
$slide = $('<section></section>')
.addClass(slide.cssClass)
$slide.html(slide.html)
$article.append $slide
$('body').append $article
executeHooks()
ui.init slidePack : $('article')
# keyboard navigation
mousetrap.bind ['left', 'up', 'k', 'h'], ui.prev
mousetrap.bind ['right', 'down', 'j', 'l'], ui.next
# mouse/touch navigation
$(document).on 'click', ui.next
hl.initHighlightingOnLoad()
| Remove specific CSS classes for slides and slide-pack | Remove specific CSS classes for slides and slide-pack
| CoffeeScript | mit | trabe/slide-pack,trabe/slide-pack |
9c97cc67f384ab942d9085068bd86ab1c89cd08e | lib/all-headers.coffee | lib/all-headers.coffee | # s2.2.5.3
# For now, only the "Transaction Descriptor" header (s2.2.5.3.2) is supported.
TYPE =
QUERY_NOTIFICATIONS: 1
TXN_DESCRIPTOR: 2
TRACE_ACTIVITY: 3
TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8
TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN
module.exports = (txnDescriptor, outstandingRequestCount) ->
buffer = new Buffer(4 + (4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN))
position = 0
buffer.writeUInt32LE(buffer.length, position)
position += 4
buffer.writeUInt32LE(TXNDESCRIPTOR_HEADER_LEN, position)
position += 4
buffer.writeUInt16LE(TYPE.TXN_DESCRIPTOR, position)
position += 2
buffer.writeUInt32LE(txnDescriptor % 0x100000000, position)
position += 4
buffer.writeUInt32LE(txnDescriptor / 0x100000000, position)
position += 4
buffer.writeUInt32LE(outstandingRequestCount, position)
position += 4
buffer | # s2.2.5.3
# For now, only the "Transaction Descriptor" header (s2.2.5.3.2) is supported.
WritableTrackingBuffer = require('../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
TYPE =
QUERY_NOTIFICATIONS: 1
TXN_DESCRIPTOR: 2
TRACE_ACTIVITY: 3
TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8
TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN
module.exports = (txnDescriptor, outstandingRequestCount) ->
buffer = new WritableTrackingBuffer(50)
buffer.writeUInt32LE(0) # Will write buffer length in here later.
buffer.writeUInt32LE(TXNDESCRIPTOR_HEADER_LEN)
buffer.writeUInt16LE(TYPE.TXN_DESCRIPTOR)
buffer.writeUInt32LE(txnDescriptor % 0x100000000)
buffer.writeUInt32LE(txnDescriptor / 0x100000000)
buffer.writeUInt32LE(outstandingRequestCount)
data = buffer.data
# Write deferred buffer length.
data.writeUInt32LE(data.length, 0)
data
| Use WritableTrackingBuffer to simplify the creation of AllHeaders. | Use WritableTrackingBuffer to simplify the creation of AllHeaders.
| CoffeeScript | mit | pekim/tedious,arthurschreiber/tedious,tediousjs/tedious,tediousjs/tedious,Sage-ERP-X3/tedious,LeanKit-Labs/tedious,spanditcaa/tedious |
7fa6879edb5f2c2b4d4389b76b35316728b75453 | src/type.coffee | src/type.coffee | {ArgumentError, NotImplementedError} = require './errors'
#
# 'Abstract' class for Finitio types
#
class Type
constructor: (@name)->
if @name? and typeof(@name) isnt "string"
throw new ArgumentError("String expected, got", @name)
@name ?= @defaultName()
#
# Dress `value` with this information type and returns the result.
#
# @return the dressing result
# @pre true
# @post this.include(output)
# @throws `Finitio.Error` if the dressing fails
#
dress: (value)->
throw new NotImplementedError(this, "dress")
#
# Undress `value` as a member of `as` type.
#
# @param `as` another Type instance
# @return the undressed result
# @pre this.include(value)
# @post as.include(output)
#
undress: (value, as)->
throw new NotImplementedError(this, "undress")
toString: ->
@name.toString()
equal: (other)->
this is other
module.exports = Type
| {ArgumentError, NotImplementedError, TypeError} = require './errors'
#
# 'Abstract' class for Finitio types
#
class Type
constructor: (@name)->
if @name? and typeof(@name) isnt "string"
throw new ArgumentError("String expected, got", @name)
@name ?= @defaultName()
#
# Returns true if `value` is valid member of this type, false otherwise.
#
include: (value)->
throw new NotImplementedError(this, "include")
#
# Dress `value` with this information type and returns the result.
#
# @return the dressing result
# @pre true
# @post this.include(output)
# @throws `TypeError` if the dressing fails
#
dress: (value)->
throw new NotImplementedError(this, "dress")
#
# Undress `value` as a member of `as` type.
#
# @param `as` another Type instance
# @return the undressed result
# @pre this.include(value)
# @post as.include(output)
# @throw `TypeError` if undressing fails
#
undress: (value, as)->
return value if this.equals(as)
throw new TypeError("Unable to undress `#{value}` to `#{as}`")
#
# Returns a String representation of this Type.
#
toString: ->
@name.toString()
#
# Returns true if `other` is structurally equivalent to this type, false
# otherwise.
#
equal: (other)->
this is other
module.exports = Type
| Document Type's public API a little bit. | Document Type's public API a little bit.
| CoffeeScript | mit | llambeau/finitio.js,llambeau/finitio.js |
3e8de2d22d8ce74cc0f7ed99c03a71fb73c7b1ca | tasks/test-task.coffee | tasks/test-task.coffee | path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'test', 'Run the specs', ->
done = @async()
commands = []
commands.push (callback) ->
spawn cmd: 'pkill', args: ['Atom'], -> callback()
commands.push (callback) ->
atomBinary = path.join(CONTENTS_DIR, 'MacOS', 'Atom')
spawn cmd: atomBinary, args: ['--test', "--resource-path=#{__dirname}"], (error) -> callback(error)
grunt.util.async.waterfall commands, (error) -> done(error)
| path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'test', 'Run the specs', ->
done = @async()
commands = []
commands.push (callback) ->
spawn cmd: 'pkill', args: ['Atom'], -> callback()
commands.push (callback) ->
atomBinary = path.join(grunt.config.get('atom.contentsDir'), 'MacOS', 'Atom')
spawn cmd: atomBinary, args: ['--test', "--resource-path=#{__dirname}"], (error) -> callback(error)
grunt.util.async.waterfall commands, (error) -> done(error)
| Use config to retrieve contents directory | Use config to retrieve contents directory
| CoffeeScript | mit | RuiDGoncalves/atom,liuderchi/atom,Dennis1978/atom,deoxilix/atom,rjattrill/atom,Galactix/atom,isghe/atom,FoldingText/atom,einarmagnus/atom,rjattrill/atom,rjattrill/atom,bcoe/atom,stinsonga/atom,brettle/atom,me6iaton/atom,darwin/atom,fedorov/atom,daxlab/atom,Austen-G/BlockBuilder,Klozz/atom,SlimeQ/atom,davideg/atom,darwin/atom,batjko/atom,fedorov/atom,ivoadf/atom,fang-yufeng/atom,Andrey-Pavlov/atom,rxkit/atom,oggy/atom,harshdattani/atom,kc8wxm/atom,ppamorim/atom,omarhuanca/atom,FoldingText/atom,Galactix/atom,lovesnow/atom,scv119/atom,folpindo/atom,devoncarew/atom,kc8wxm/atom,mnquintana/atom,Austen-G/BlockBuilder,codex8/atom,erikhakansson/atom,GHackAnonymous/atom,rookie125/atom,tanin47/atom,ReddTea/atom,acontreras89/atom,vcarrera/atom,yomybaby/atom,tmunro/atom,Jandersoft/atom,bencolon/atom,qskycolor/atom,kittens/atom,ilovezy/atom,dkfiresky/atom,Andrey-Pavlov/atom,panuchart/atom,001szymon/atom,bsmr-x-script/atom,bradgearon/atom,woss/atom,chengky/atom,GHackAnonymous/atom,hharchani/atom,champagnez/atom,prembasumatary/atom,nrodriguez13/atom,yomybaby/atom,0x73/atom,kandros/atom,chengky/atom,Austen-G/BlockBuilder,abcP9110/atom,johnrizzo1/atom,hharchani/atom,hellendag/atom,AlbertoBarrago/atom,mrodalgaard/atom,yangchenghu/atom,vhutheesing/atom,Jandersolutions/atom,liuderchi/atom,tanin47/atom,omarhuanca/atom,gisenberg/atom,Klozz/atom,ReddTea/atom,bcoe/atom,basarat/atom,lisonma/atom,rmartin/atom,crazyquark/atom,sxgao3001/atom,Ju2ender/atom,basarat/atom,beni55/atom,scv119/atom,targeter21/atom,atom/atom,NunoEdgarGub1/atom,0x73/atom,nvoron23/atom,n-riesco/atom,florianb/atom,andrewleverette/atom,rmartin/atom,bryonwinger/atom,panuchart/atom,ali/atom,dsandstrom/atom,stinsonga/atom,Neron-X5/atom,kc8wxm/atom,tmunro/atom,ali/atom,phord/atom,matthewclendening/atom,hpham04/atom,boomwaiza/atom,brumm/atom,helber/atom,matthewclendening/atom,qskycolor/atom,deepfox/atom,ezeoleaf/atom,bj7/atom,jjz/atom,me6iaton/atom,devmario/atom,Hasimir/atom,gabrielPeart/atom,qiujuer/atom,n-riesco/atom,Huaraz2/atom,russlescai/atom,ReddTea/atom,davideg/atom,omarhuanca/atom,FIT-CSE2410-A-Bombs/atom,Neron-X5/atom,rxkit/atom,Galactix/atom,hagb4rd/atom,seedtigo/atom,jtrose2/atom,nvoron23/atom,jlord/atom,vjeux/atom,me6iaton/atom,Jdesk/atom,transcranial/atom,fredericksilva/atom,jlord/atom,dkfiresky/atom,h0dgep0dge/atom,woss/atom,kevinrenaers/atom,execjosh/atom,Rychard/atom,avdg/atom,johnrizzo1/atom,decaffeinate-examples/atom,Shekharrajak/atom,abcP9110/atom,vcarrera/atom,nucked/atom,yalexx/atom,tjkr/atom,oggy/atom,Arcanemagus/atom,BogusCurry/atom,russlescai/atom,NunoEdgarGub1/atom,tanin47/atom,Galactix/atom,john-kelly/atom,florianb/atom,scv119/atom,phord/atom,beni55/atom,KENJU/atom,dkfiresky/atom,burodepeper/atom,andrewleverette/atom,me6iaton/atom,batjko/atom,bj7/atom,G-Baby/atom,niklabh/atom,decaffeinate-examples/atom,basarat/atom,daxlab/atom,bolinfest/atom,bsmr-x-script/atom,fredericksilva/atom,KENJU/atom,ralphtheninja/atom,alexandergmann/atom,dsandstrom/atom,originye/atom,me6iaton/atom,sebmck/atom,dijs/atom,Hasimir/atom,medovob/atom,devmario/atom,ardeshirj/atom,CraZySacX/atom,andrewleverette/atom,ilovezy/atom,rsvip/aTom,Sangaroonaom/atom,seedtigo/atom,jordanbtucker/atom,mnquintana/atom,jordanbtucker/atom,jordanbtucker/atom,fscherwi/atom,gzzhanghao/atom,Locke23rus/atom,kevinrenaers/atom,g2p/atom,Jandersoft/atom,ezeoleaf/atom,ardeshirj/atom,Ju2ender/atom,me-benni/atom,brumm/atom,lovesnow/atom,splodingsocks/atom,rmartin/atom,avdg/atom,vcarrera/atom,FIT-CSE2410-A-Bombs/atom,burodepeper/atom,001szymon/atom,amine7536/atom,oggy/atom,NunoEdgarGub1/atom,cyzn/atom,helber/atom,jjz/atom,Jonekee/atom,fscherwi/atom,basarat/atom,GHackAnonymous/atom,dijs/atom,kc8wxm/atom,SlimeQ/atom,decaffeinate-examples/atom,sxgao3001/atom,scippio/atom,execjosh/atom,efatsi/atom,woss/atom,xream/atom,Rodjana/atom,ralphtheninja/atom,dsandstrom/atom,chfritz/atom,qiujuer/atom,AdrianVovk/substance-ide,Rychard/atom,omarhuanca/atom,Jandersolutions/atom,liuderchi/atom,g2p/atom,Ju2ender/atom,stinsonga/atom,abcP9110/atom,lovesnow/atom,batjko/atom,ykeisuke/atom,kdheepak89/atom,jacekkopecky/atom,ilovezy/atom,jtrose2/atom,kandros/atom,Jandersolutions/atom,Abdillah/atom,acontreras89/atom,SlimeQ/atom,harshdattani/atom,deoxilix/atom,darwin/atom,scippio/atom,davideg/atom,vhutheesing/atom,batjko/atom,jacekkopecky/atom,toqz/atom,wiggzz/atom,rxkit/atom,KENJU/atom,fang-yufeng/atom,abe33/atom,tisu2tisu/atom,sotayamashita/atom,nrodriguez13/atom,lisonma/atom,dannyflax/atom,dsandstrom/atom,fredericksilva/atom,codex8/atom,rsvip/aTom,beni55/atom,hharchani/atom,brumm/atom,florianb/atom,qiujuer/atom,rlugojr/atom,charleswhchan/atom,crazyquark/atom,Hasimir/atom,tony612/atom,NunoEdgarGub1/atom,anuwat121/atom,0x73/atom,wiggzz/atom,fang-yufeng/atom,acontreras89/atom,charleswhchan/atom,SlimeQ/atom,h0dgep0dge/atom,Dennis1978/atom,hharchani/atom,amine7536/atom,bcoe/atom,rookie125/atom,scv119/atom,vjeux/atom,ykeisuke/atom,kjav/atom,ashneo76/atom,codex8/atom,Shekharrajak/atom,daxlab/atom,boomwaiza/atom,Ju2ender/atom,hpham04/atom,jacekkopecky/atom,yalexx/atom,toqz/atom,SlimeQ/atom,gzzhanghao/atom,avdg/atom,AlexxNica/atom,pkdevbox/atom,gisenberg/atom,devmario/atom,batjko/atom,yamhon/atom,BogusCurry/atom,matthewclendening/atom,PKRoma/atom,pkdevbox/atom,AlisaKiatkongkumthon/atom,paulcbetts/atom,mdumrauf/atom,0x73/atom,bencolon/atom,Abdillah/atom,gisenberg/atom,brettle/atom,johnhaley81/atom,kjav/atom,kittens/atom,Rychard/atom,paulcbetts/atom,nucked/atom,PKRoma/atom,Mokolea/atom,Abdillah/atom,YunchengLiao/atom,bradgearon/atom,niklabh/atom,sxgao3001/atom,CraZySacX/atom,bcoe/atom,Sangaroonaom/atom,svanharmelen/atom,paulcbetts/atom,gontadu/atom,bsmr-x-script/atom,charleswhchan/atom,ReddTea/atom,Mokolea/atom,toqz/atom,targeter21/atom,dannyflax/atom,Ingramz/atom,isghe/atom,tony612/atom,ezeoleaf/atom,transcranial/atom,stuartquin/atom,RuiDGoncalves/atom,mostafaeweda/atom,champagnez/atom,matthewclendening/atom,Shekharrajak/atom,Neron-X5/atom,devoncarew/atom,gontadu/atom,kevinrenaers/atom,RobinTec/atom,stuartquin/atom,fscherwi/atom,rlugojr/atom,vinodpanicker/atom,ali/atom,dijs/atom,Sangaroonaom/atom,isghe/atom,devoncarew/atom,chengky/atom,tjkr/atom,oggy/atom,mertkahyaoglu/atom,omarhuanca/atom,me-benni/atom,nvoron23/atom,ironbox360/atom,yamhon/atom,ppamorim/atom,lpommers/atom,githubteacher/atom,Austen-G/BlockBuilder,Rodjana/atom,gzzhanghao/atom,folpindo/atom,Andrey-Pavlov/atom,atom/atom,atom/atom,crazyquark/atom,mrodalgaard/atom,hagb4rd/atom,sillvan/atom,crazyquark/atom,FoldingText/atom,sxgao3001/atom,bolinfest/atom,FoldingText/atom,dannyflax/atom,targeter21/atom,alexandergmann/atom,deepfox/atom,ppamorim/atom,florianb/atom,kdheepak89/atom,gisenberg/atom,AlexxNica/atom,splodingsocks/atom,seedtigo/atom,einarmagnus/atom,oggy/atom,rlugojr/atom,phord/atom,Huaraz2/atom,jeremyramin/atom,rsvip/aTom,tisu2tisu/atom,efatsi/atom,abe33/atom,fredericksilva/atom,hakatashi/atom,ashneo76/atom,ppamorim/atom,abcP9110/atom,john-kelly/atom,Austen-G/BlockBuilder,qskycolor/atom,gabrielPeart/atom,alfredxing/atom,devmario/atom,russlescai/atom,AlexxNica/atom,dsandstrom/atom,basarat/atom,tjkr/atom,liuderchi/atom,Galactix/atom,RobinTec/atom,johnhaley81/atom,synaptek/atom,liuxiong332/atom,jeremyramin/atom,acontreras89/atom,chfritz/atom,tmunro/atom,Austen-G/BlockBuilder,Jdesk/atom,hagb4rd/atom,stinsonga/atom,xream/atom,vjeux/atom,abe33/atom,h0dgep0dge/atom,dannyflax/atom,execjosh/atom,anuwat121/atom,Huaraz2/atom,palita01/atom,synaptek/atom,me-benni/atom,liuxiong332/atom,pengshp/atom,sekcheong/atom,sekcheong/atom,t9md/atom,Ju2ender/atom,hagb4rd/atom,Andrey-Pavlov/atom,lovesnow/atom,bolinfest/atom,AlisaKiatkongkumthon/atom,prembasumatary/atom,originye/atom,chengky/atom,rjattrill/atom,Jdesk/atom,transcranial/atom,svanharmelen/atom,russlescai/atom,liuxiong332/atom,dannyflax/atom,fang-yufeng/atom,pkdevbox/atom,sxgao3001/atom,pengshp/atom,Hasimir/atom,ezeoleaf/atom,einarmagnus/atom,targeter21/atom,vcarrera/atom,liuxiong332/atom,Hasimir/atom,vinodpanicker/atom,prembasumatary/atom,davideg/atom,tony612/atom,elkingtonmcb/atom,DiogoXRP/atom,chfritz/atom,mdumrauf/atom,prembasumatary/atom,jacekkopecky/atom,rsvip/aTom,BogusCurry/atom,hharchani/atom,FoldingText/atom,mrodalgaard/atom,rmartin/atom,mostafaeweda/atom,mostafaeweda/atom,ilovezy/atom,pombredanne/atom,rookie125/atom,tony612/atom,sillvan/atom,synaptek/atom,Ingramz/atom,yangchenghu/atom,Jonekee/atom,davideg/atom,dkfiresky/atom,DiogoXRP/atom,jlord/atom,sekcheong/atom,ali/atom,ObviouslyGreen/atom,lpommers/atom,MjAbuz/atom,DiogoXRP/atom,basarat/atom,YunchengLiao/atom,tisu2tisu/atom,bryonwinger/atom,erikhakansson/atom,liuxiong332/atom,alfredxing/atom,john-kelly/atom,jacekkopecky/atom,ilovezy/atom,Andrey-Pavlov/atom,fredericksilva/atom,constanzaurzua/atom,mertkahyaoglu/atom,nvoron23/atom,vjeux/atom,AlisaKiatkongkumthon/atom,MjAbuz/atom,nucked/atom,jjz/atom,prembasumatary/atom,sekcheong/atom,kc8wxm/atom,Klozz/atom,deepfox/atom,amine7536/atom,bryonwinger/atom,n-riesco/atom,sebmck/atom,pombredanne/atom,mostafaeweda/atom,dannyflax/atom,Jdesk/atom,kaicataldo/atom,ashneo76/atom,Jdesk/atom,chengky/atom,kdheepak89/atom,Mokolea/atom,svanharmelen/atom,jjz/atom,splodingsocks/atom,mertkahyaoglu/atom,alexandergmann/atom,fedorov/atom,ironbox360/atom,hakatashi/atom,Neron-X5/atom,jtrose2/atom,G-Baby/atom,gabrielPeart/atom,sebmck/atom,targeter21/atom,Rodjana/atom,florianb/atom,hakatashi/atom,vhutheesing/atom,devoncarew/atom,PKRoma/atom,xream/atom,kdheepak89/atom,sekcheong/atom,boomwaiza/atom,folpindo/atom,russlescai/atom,wiggzz/atom,MjAbuz/atom,vinodpanicker/atom,ykeisuke/atom,kaicataldo/atom,bradgearon/atom,FoldingText/atom,fedorov/atom,Arcanemagus/atom,githubteacher/atom,devoncarew/atom,charleswhchan/atom,YunchengLiao/atom,burodepeper/atom,deoxilix/atom,kaicataldo/atom,palita01/atom,constanzaurzua/atom,t9md/atom,kjav/atom,Abdillah/atom,hakatashi/atom,n-riesco/atom,GHackAnonymous/atom,palita01/atom,jtrose2/atom,gontadu/atom,fang-yufeng/atom,jlord/atom,kittens/atom,G-Baby/atom,MjAbuz/atom,sotayamashita/atom,isghe/atom,cyzn/atom,champagnez/atom,kandros/atom,001szymon/atom,woss/atom,devmario/atom,CraZySacX/atom,john-kelly/atom,jjz/atom,Jandersolutions/atom,kjav/atom,tony612/atom,Dennis1978/atom,YunchengLiao/atom,decaffeinate-examples/atom,hpham04/atom,FIT-CSE2410-A-Bombs/atom,MjAbuz/atom,anuwat121/atom,codex8/atom,amine7536/atom,nrodriguez13/atom,qskycolor/atom,yomybaby/atom,constanzaurzua/atom,kdheepak89/atom,charleswhchan/atom,mnquintana/atom,RobinTec/atom,yomybaby/atom,AdrianVovk/substance-ide,cyzn/atom,johnrizzo1/atom,jacekkopecky/atom,jtrose2/atom,rmartin/atom,Jandersoft/atom,Jandersoft/atom,ralphtheninja/atom,paulcbetts/atom,toqz/atom,dkfiresky/atom,sillvan/atom,hellendag/atom,pombredanne/atom,jlord/atom,qskycolor/atom,erikhakansson/atom,RobinTec/atom,woss/atom,isghe/atom,stuartquin/atom,fedorov/atom,ppamorim/atom,rsvip/aTom,elkingtonmcb/atom,qiujuer/atom,AlbertoBarrago/atom,sillvan/atom,ivoadf/atom,yomybaby/atom,Locke23rus/atom,pengshp/atom,sebmck/atom,KENJU/atom,vinodpanicker/atom,hellendag/atom,mdumrauf/atom,yamhon/atom,qiujuer/atom,synaptek/atom,acontreras89/atom,bryonwinger/atom,sotayamashita/atom,ivoadf/atom,Neron-X5/atom,amine7536/atom,brettle/atom,elkingtonmcb/atom,constanzaurzua/atom,bcoe/atom,toqz/atom,NunoEdgarGub1/atom,pombredanne/atom,jeremyramin/atom,crazyquark/atom,Arcanemagus/atom,ardeshirj/atom,ObviouslyGreen/atom,abcP9110/atom,n-riesco/atom,mnquintana/atom,lovesnow/atom,originye/atom,githubteacher/atom,RobinTec/atom,bj7/atom,GHackAnonymous/atom,niklabh/atom,medovob/atom,yangchenghu/atom,Locke23rus/atom,yalexx/atom,ironbox360/atom,YunchengLiao/atom,mnquintana/atom,constanzaurzua/atom,Jandersolutions/atom,t9md/atom,hagb4rd/atom,splodingsocks/atom,ReddTea/atom,g2p/atom,kittens/atom,AdrianVovk/substance-ide,Ingramz/atom,panuchart/atom,hpham04/atom,synaptek/atom,johnhaley81/atom,Jandersoft/atom,lisonma/atom,Jonekee/atom,scippio/atom,einarmagnus/atom,medovob/atom,Shekharrajak/atom,KENJU/atom,kittens/atom,Abdillah/atom,mertkahyaoglu/atom,mertkahyaoglu/atom,lpommers/atom,lisonma/atom,yalexx/atom,codex8/atom,vcarrera/atom,lisonma/atom,einarmagnus/atom,Shekharrajak/atom,hpham04/atom,alfredxing/atom,AlbertoBarrago/atom,sebmck/atom,ObviouslyGreen/atom,deepfox/atom,ali/atom,pombredanne/atom,nvoron23/atom,vjeux/atom,h0dgep0dge/atom,bencolon/atom,helber/atom,harshdattani/atom,sillvan/atom,yalexx/atom,gisenberg/atom,RuiDGoncalves/atom,vinodpanicker/atom,mostafaeweda/atom,kjav/atom,efatsi/atom,deepfox/atom,john-kelly/atom,matthewclendening/atom |
85e416d53e061b3ee53759a2ce1229e87215321c | app/assets/javascripts/application-admin.js.coffee | app/assets/javascripts/application-admin.js.coffee | #= require jquery
#= require jquery_ujs
#= require bootstrap-sprockets
#= require_tree ./admin
| #= require jquery
#= require jquery_ujs
#= require bootstrap-sprockets
| Remove useless empty admin JS require | Remove useless empty admin JS require
| CoffeeScript | mit | bitzesty/qae,bitzesty/qae,bitzesty/qae,bitzesty/qae |
056bb6b0f49e98a5d44e05e14944d8fdfbbb44f7 | services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee | services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee | Settings = require "settings-sharelatex"
logger = require "logger-sharelatex"
_ = require "underscore"
if !Settings.analytics?.postgres?
module.exports =
recordEvent: (user_id, event, metadata, callback = () ->) ->
logger.log {user_id, event, metadata}, "no event tracking configured, logging event"
callback()
else
Sequelize = require "sequelize"
options = _.extend {logging:false}, Settings.analytics.postgres
sequelize = new Sequelize(
Settings.analytics.postgres.database,
Settings.analytics.postgres.username,
Settings.analytics.postgres.password,
options
)
Event = sequelize.define("Event", {
user_id: Sequelize.STRING,
event: Sequelize.STRING,
metadata: Sequelize.STRING
})
module.exports =
recordEvent: (user_id, event, metadata = {}, callback = (error) ->) ->
if typeof(metadata) != "string"
metadata = JSON.stringify(metadata)
if user_id? and typeof(user_id) != "string"
user_id = user_id.toString()
if user_id == Settings.smokeTest?.userId
# Don't record smoke tests analytics
return callback()
Event
.create({ user_id, event, metadata })
.then(
(result) -> callback(),
(error) ->
logger.err {err: error, user_id, event, metadata}, "error recording analytics event"
callback(error)
)
sync: () -> sequelize.sync() | Settings = require "settings-sharelatex"
logger = require "logger-sharelatex"
_ = require "underscore"
if !Settings.analytics?.postgres?
module.exports =
recordEvent: (user_id, event, metadata, callback = () ->) ->
logger.log {user_id, event, metadata}, "no event tracking configured, logging event"
callback()
else
Sequelize = require "sequelize"
options = _.extend {logging:false}, Settings.analytics.postgres
sequelize = new Sequelize(
Settings.analytics.postgres.database,
Settings.analytics.postgres.username,
Settings.analytics.postgres.password,
options
)
Event = sequelize.define("Event", {
user_id: Sequelize.STRING,
event: Sequelize.STRING,
metadata: Sequelize.JSON
})
module.exports =
recordEvent: (user_id, event, metadata = {}, callback = (error) ->) ->
if user_id? and typeof(user_id) != "string"
user_id = user_id.toString()
if user_id == Settings.smokeTest?.userId
# Don't record smoke tests analytics
return callback()
Event
.create({ user_id, event, metadata })
.then(
(result) -> callback(),
(error) ->
logger.err {err: error, user_id, event, metadata}, "error recording analytics event"
callback(error)
)
sync: () -> sequelize.sync() | Use a JSON column for metadata | Use a JSON column for metadata
| CoffeeScript | agpl-3.0 | sharelatex/sharelatex |
3d1133eb6ae24f30a6b0ed5d88aa2bbeb23d331f | coffeescript/object_example.coffee | coffeescript/object_example.coffee | circle =
radius: 3
center:
x: 5
y: 4
color: 'green'
thickness: 2
lineStyle: 'dashed'
| circle =
radius: 3
center:
x: 5
y: 4
color: 'green'
fillColor: 'pink'
thickness: 2
lineStyle: 'dashed'
| Make some CoffeeScript examples more interesting | Make some CoffeeScript examples more interesting
| CoffeeScript | mit | rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple |
12aa35f83f9a8fe38388afdccb40c73af9a4311b | src/buffered-node-process.coffee | src/buffered-node-process.coffee | BufferedProcess = require 'buffered-process'
path = require 'path'
# Private: Like BufferedProcess, but accepts a node script instead of an
# executable, on Unix which allows running scripts and executables, this seems
# unnecessary, but on Windows we have to separate scripts from executables since
# it doesn't support shebang strings.
module.exports =
class BufferedNodeProcess extends BufferedProcess
constructor: ({command, args, options, stdout, stderr, exit}) ->
args = ['--atom-child_process-fork', command].concat(args)
node =
if process.platform is 'darwin'
# On OS X we use the helper process to run script, because it doesn't
# create an icon on the Dock.
path.resolve(process.resourcesPath, '..', 'Frameworks',
'Atom Helper.app', 'Contents', 'MacOS', 'Atom Helper')
else
process.execPath
super({command: node, args, options, stdout, stderr, exit})
| BufferedProcess = require 'buffered-process'
path = require 'path'
# Private: Like BufferedProcess, but accepts a node script instead of an
# executable, on Unix which allows running scripts and executables, this seems
# unnecessary, but on Windows we have to separate scripts from executables since
# it doesn't support shebang strings.
module.exports =
class BufferedNodeProcess extends BufferedProcess
constructor: ({command, args, options, stdout, stderr, exit}) ->
node =
if process.platform is 'darwin'
# On OS X we use the helper process to run script, because it doesn't
# create an icon on the Dock.
path.resolve(process.resourcesPath, '..', 'Frameworks',
'Atom Helper.app', 'Contents', 'MacOS', 'Atom Helper')
else
process.execPath
# Tell atom-shell to run like upstream node.
options = {} if not options?
options.env = Object.create(process.env) if not options.env?
options.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = 1
args.unshift(command)
super({command: node, args, options, stdout, stderr, exit})
| Make BufferedNodeProcess adapt to changes of atom-shell v0.4.4. | Make BufferedNodeProcess adapt to changes of atom-shell v0.4.4.
| CoffeeScript | mit | prembasumatary/atom,mostafaeweda/atom,harshdattani/atom,Austen-G/BlockBuilder,dannyflax/atom,0x73/atom,medovob/atom,vcarrera/atom,vjeux/atom,tisu2tisu/atom,alexandergmann/atom,pkdevbox/atom,gontadu/atom,jtrose2/atom,jacekkopecky/atom,seedtigo/atom,dannyflax/atom,0x73/atom,Dennis1978/atom,jtrose2/atom,dsandstrom/atom,Dennis1978/atom,ObviouslyGreen/atom,bcoe/atom,Jonekee/atom,rookie125/atom,vcarrera/atom,liuderchi/atom,kevinrenaers/atom,helber/atom,yamhon/atom,tmunro/atom,kittens/atom,jeremyramin/atom,kjav/atom,gisenberg/atom,sillvan/atom,deepfox/atom,me6iaton/atom,alfredxing/atom,phord/atom,woss/atom,yangchenghu/atom,stuartquin/atom,Hasimir/atom,abcP9110/atom,wiggzz/atom,lpommers/atom,hagb4rd/atom,rlugojr/atom,batjko/atom,fredericksilva/atom,Andrey-Pavlov/atom,nvoron23/atom,gabrielPeart/atom,helber/atom,decaffeinate-examples/atom,ezeoleaf/atom,Jdesk/atom,lovesnow/atom,devoncarew/atom,YunchengLiao/atom,ashneo76/atom,FoldingText/atom,vjeux/atom,G-Baby/atom,splodingsocks/atom,stuartquin/atom,vinodpanicker/atom,nrodriguez13/atom,ObviouslyGreen/atom,mertkahyaoglu/atom,vjeux/atom,Rychard/atom,Andrey-Pavlov/atom,charleswhchan/atom,oggy/atom,daxlab/atom,Arcanemagus/atom,transcranial/atom,nvoron23/atom,nrodriguez13/atom,githubteacher/atom,niklabh/atom,russlescai/atom,sekcheong/atom,xream/atom,ali/atom,lovesnow/atom,GHackAnonymous/atom,Jdesk/atom,einarmagnus/atom,FoldingText/atom,BogusCurry/atom,rsvip/aTom,pengshp/atom,n-riesco/atom,stinsonga/atom,AdrianVovk/substance-ide,pombredanne/atom,ivoadf/atom,jacekkopecky/atom,andrewleverette/atom,Neron-X5/atom,execjosh/atom,erikhakansson/atom,rmartin/atom,dsandstrom/atom,Mokolea/atom,hpham04/atom,tanin47/atom,acontreras89/atom,abe33/atom,palita01/atom,synaptek/atom,florianb/atom,acontreras89/atom,ashneo76/atom,yamhon/atom,toqz/atom,yomybaby/atom,Ju2ender/atom,paulcbetts/atom,hharchani/atom,vcarrera/atom,charleswhchan/atom,vhutheesing/atom,g2p/atom,bryonwinger/atom,Jandersoft/atom,Andrey-Pavlov/atom,yalexx/atom,matthewclendening/atom,alfredxing/atom,Austen-G/BlockBuilder,yalexx/atom,FoldingText/atom,CraZySacX/atom,stinsonga/atom,hellendag/atom,jacekkopecky/atom,FoldingText/atom,hharchani/atom,rjattrill/atom,folpindo/atom,bsmr-x-script/atom,matthewclendening/atom,mertkahyaoglu/atom,rjattrill/atom,jlord/atom,ralphtheninja/atom,avdg/atom,fscherwi/atom,panuchart/atom,chfritz/atom,Ju2ender/atom,oggy/atom,Jandersolutions/atom,panuchart/atom,woss/atom,bryonwinger/atom,sekcheong/atom,fang-yufeng/atom,decaffeinate-examples/atom,GHackAnonymous/atom,amine7536/atom,davideg/atom,davideg/atom,amine7536/atom,tony612/atom,yalexx/atom,niklabh/atom,omarhuanca/atom,yomybaby/atom,toqz/atom,daxlab/atom,rmartin/atom,kandros/atom,jordanbtucker/atom,Galactix/atom,Ju2ender/atom,charleswhchan/atom,chengky/atom,matthewclendening/atom,phord/atom,tjkr/atom,constanzaurzua/atom,h0dgep0dge/atom,ReddTea/atom,Jandersolutions/atom,seedtigo/atom,qskycolor/atom,Jandersolutions/atom,wiggzz/atom,kjav/atom,champagnez/atom,dannyflax/atom,ppamorim/atom,seedtigo/atom,crazyquark/atom,kandros/atom,jjz/atom,Klozz/atom,devmario/atom,Klozz/atom,lovesnow/atom,liuxiong332/atom,nvoron23/atom,fedorov/atom,constanzaurzua/atom,bryonwinger/atom,KENJU/atom,AlisaKiatkongkumthon/atom,Ju2ender/atom,Jdesk/atom,tanin47/atom,DiogoXRP/atom,jjz/atom,t9md/atom,rjattrill/atom,alexandergmann/atom,scv119/atom,deoxilix/atom,chengky/atom,kdheepak89/atom,Jandersoft/atom,hellendag/atom,alexandergmann/atom,BogusCurry/atom,russlescai/atom,yangchenghu/atom,prembasumatary/atom,dsandstrom/atom,qiujuer/atom,einarmagnus/atom,ali/atom,batjko/atom,chfritz/atom,FIT-CSE2410-A-Bombs/atom,ivoadf/atom,BogusCurry/atom,fang-yufeng/atom,targeter21/atom,fredericksilva/atom,efatsi/atom,tony612/atom,lisonma/atom,GHackAnonymous/atom,efatsi/atom,ezeoleaf/atom,Jonekee/atom,isghe/atom,dijs/atom,ykeisuke/atom,jtrose2/atom,rjattrill/atom,AdrianVovk/substance-ide,florianb/atom,hpham04/atom,kjav/atom,bradgearon/atom,john-kelly/atom,lisonma/atom,toqz/atom,devmario/atom,charleswhchan/atom,qskycolor/atom,hpham04/atom,Rodjana/atom,qskycolor/atom,dkfiresky/atom,svanharmelen/atom,gzzhanghao/atom,NunoEdgarGub1/atom,ppamorim/atom,targeter21/atom,dsandstrom/atom,johnrizzo1/atom,pombredanne/atom,n-riesco/atom,paulcbetts/atom,MjAbuz/atom,g2p/atom,acontreras89/atom,basarat/atom,Abdillah/atom,hharchani/atom,ykeisuke/atom,sebmck/atom,charleswhchan/atom,fscherwi/atom,Hasimir/atom,andrewleverette/atom,palita01/atom,AlbertoBarrago/atom,brumm/atom,constanzaurzua/atom,RobinTec/atom,beni55/atom,andrewleverette/atom,kittens/atom,Huaraz2/atom,tony612/atom,hakatashi/atom,panuchart/atom,G-Baby/atom,sillvan/atom,rxkit/atom,Sangaroonaom/atom,cyzn/atom,paulcbetts/atom,kandros/atom,me-benni/atom,hakatashi/atom,bcoe/atom,Austen-G/BlockBuilder,Jandersoft/atom,rookie125/atom,YunchengLiao/atom,targeter21/atom,sebmck/atom,n-riesco/atom,ralphtheninja/atom,ReddTea/atom,ilovezy/atom,omarhuanca/atom,davideg/atom,SlimeQ/atom,Mokolea/atom,hharchani/atom,kc8wxm/atom,deoxilix/atom,vjeux/atom,jacekkopecky/atom,hharchani/atom,gontadu/atom,sekcheong/atom,gisenberg/atom,omarhuanca/atom,n-riesco/atom,rxkit/atom,synaptek/atom,bencolon/atom,Neron-X5/atom,AlbertoBarrago/atom,john-kelly/atom,vcarrera/atom,boomwaiza/atom,hellendag/atom,qiujuer/atom,gzzhanghao/atom,beni55/atom,qiujuer/atom,devoncarew/atom,hagb4rd/atom,Locke23rus/atom,liuxiong332/atom,bolinfest/atom,scippio/atom,tony612/atom,hagb4rd/atom,basarat/atom,sekcheong/atom,vinodpanicker/atom,YunchengLiao/atom,bsmr-x-script/atom,nvoron23/atom,cyzn/atom,nucked/atom,Locke23rus/atom,SlimeQ/atom,champagnez/atom,FIT-CSE2410-A-Bombs/atom,gabrielPeart/atom,ali/atom,Andrey-Pavlov/atom,originye/atom,qskycolor/atom,Rodjana/atom,Ingramz/atom,isghe/atom,woss/atom,Neron-X5/atom,ReddTea/atom,bolinfest/atom,mrodalgaard/atom,AlexxNica/atom,ilovezy/atom,Klozz/atom,fedorov/atom,scippio/atom,ezeoleaf/atom,prembasumatary/atom,jacekkopecky/atom,dsandstrom/atom,mnquintana/atom,russlescai/atom,0x73/atom,kdheepak89/atom,jtrose2/atom,Galactix/atom,pengshp/atom,FIT-CSE2410-A-Bombs/atom,jacekkopecky/atom,kc8wxm/atom,pombredanne/atom,jlord/atom,abcP9110/atom,RuiDGoncalves/atom,rmartin/atom,lisonma/atom,stinsonga/atom,sebmck/atom,GHackAnonymous/atom,Shekharrajak/atom,dkfiresky/atom,kdheepak89/atom,mdumrauf/atom,ilovezy/atom,scippio/atom,mdumrauf/atom,omarhuanca/atom,kaicataldo/atom,kc8wxm/atom,oggy/atom,me6iaton/atom,bj7/atom,elkingtonmcb/atom,jjz/atom,t9md/atom,transcranial/atom,CraZySacX/atom,Arcanemagus/atom,liuxiong332/atom,MjAbuz/atom,constanzaurzua/atom,ReddTea/atom,kc8wxm/atom,Sangaroonaom/atom,Jandersoft/atom,ali/atom,medovob/atom,lpommers/atom,scv119/atom,sxgao3001/atom,svanharmelen/atom,vinodpanicker/atom,basarat/atom,bradgearon/atom,rsvip/aTom,brumm/atom,dannyflax/atom,toqz/atom,vjeux/atom,bj7/atom,Dennis1978/atom,bsmr-x-script/atom,einarmagnus/atom,dkfiresky/atom,atom/atom,folpindo/atom,execjosh/atom,amine7536/atom,darwin/atom,brettle/atom,jlord/atom,constanzaurzua/atom,Neron-X5/atom,kaicataldo/atom,lisonma/atom,matthewclendening/atom,rxkit/atom,dkfiresky/atom,florianb/atom,tmunro/atom,RuiDGoncalves/atom,Ju2ender/atom,rookie125/atom,originye/atom,einarmagnus/atom,deepfox/atom,kjav/atom,hakatashi/atom,einarmagnus/atom,mnquintana/atom,gisenberg/atom,sillvan/atom,ilovezy/atom,sekcheong/atom,davideg/atom,RuiDGoncalves/atom,rsvip/aTom,abcP9110/atom,Galactix/atom,0x73/atom,me-benni/atom,avdg/atom,codex8/atom,dijs/atom,sxgao3001/atom,hpham04/atom,mertkahyaoglu/atom,medovob/atom,champagnez/atom,boomwaiza/atom,fredericksilva/atom,Neron-X5/atom,MjAbuz/atom,qiujuer/atom,jtrose2/atom,gisenberg/atom,omarhuanca/atom,scv119/atom,dijs/atom,sotayamashita/atom,xream/atom,vhutheesing/atom,001szymon/atom,ironbox360/atom,palita01/atom,targeter21/atom,Shekharrajak/atom,jjz/atom,devoncarew/atom,ppamorim/atom,svanharmelen/atom,g2p/atom,jlord/atom,n-riesco/atom,yomybaby/atom,ivoadf/atom,Andrey-Pavlov/atom,folpindo/atom,splodingsocks/atom,davideg/atom,kittens/atom,johnhaley81/atom,abe33/atom,devoncarew/atom,mrodalgaard/atom,yalexx/atom,Abdillah/atom,yomybaby/atom,tisu2tisu/atom,russlescai/atom,phord/atom,stinsonga/atom,KENJU/atom,boomwaiza/atom,jjz/atom,PKRoma/atom,ardeshirj/atom,basarat/atom,gisenberg/atom,harshdattani/atom,liuderchi/atom,Jandersolutions/atom,Rychard/atom,RobinTec/atom,paulcbetts/atom,sebmck/atom,MjAbuz/atom,SlimeQ/atom,scv119/atom,Austen-G/BlockBuilder,elkingtonmcb/atom,ashneo76/atom,pombredanne/atom,mertkahyaoglu/atom,burodepeper/atom,kevinrenaers/atom,Abdillah/atom,mostafaeweda/atom,devoncarew/atom,ilovezy/atom,KENJU/atom,vhutheesing/atom,me-benni/atom,john-kelly/atom,liuxiong332/atom,isghe/atom,kittens/atom,isghe/atom,atom/atom,kdheepak89/atom,john-kelly/atom,abcP9110/atom,h0dgep0dge/atom,yalexx/atom,fscherwi/atom,Ingramz/atom,ralphtheninja/atom,crazyquark/atom,johnrizzo1/atom,gzzhanghao/atom,dannyflax/atom,tony612/atom,cyzn/atom,hakatashi/atom,ykeisuke/atom,mnquintana/atom,fedorov/atom,synaptek/atom,Jdesk/atom,tjkr/atom,ppamorim/atom,erikhakansson/atom,decaffeinate-examples/atom,woss/atom,deoxilix/atom,crazyquark/atom,burodepeper/atom,codex8/atom,stuartquin/atom,bradgearon/atom,NunoEdgarGub1/atom,nrodriguez13/atom,johnhaley81/atom,AlisaKiatkongkumthon/atom,deepfox/atom,Ingramz/atom,gabrielPeart/atom,me6iaton/atom,anuwat121/atom,Arcanemagus/atom,acontreras89/atom,sotayamashita/atom,amine7536/atom,yomybaby/atom,decaffeinate-examples/atom,qskycolor/atom,brumm/atom,matthewclendening/atom,h0dgep0dge/atom,AdrianVovk/substance-ide,crazyquark/atom,001szymon/atom,Jandersolutions/atom,chfritz/atom,batjko/atom,prembasumatary/atom,kittens/atom,sxgao3001/atom,basarat/atom,devmario/atom,Rodjana/atom,jeremyramin/atom,PKRoma/atom,xream/atom,ironbox360/atom,mnquintana/atom,rmartin/atom,hagb4rd/atom,SlimeQ/atom,liuxiong332/atom,Abdillah/atom,Shekharrajak/atom,ezeoleaf/atom,lovesnow/atom,prembasumatary/atom,atom/atom,Hasimir/atom,transcranial/atom,kc8wxm/atom,Jdesk/atom,rmartin/atom,h0dgep0dge/atom,tanin47/atom,ppamorim/atom,johnhaley81/atom,lpommers/atom,pombredanne/atom,tjkr/atom,daxlab/atom,nucked/atom,AlexxNica/atom,johnrizzo1/atom,me6iaton/atom,DiogoXRP/atom,liuderchi/atom,anuwat121/atom,woss/atom,darwin/atom,sxgao3001/atom,NunoEdgarGub1/atom,splodingsocks/atom,jordanbtucker/atom,kevinrenaers/atom,bryonwinger/atom,acontreras89/atom,bcoe/atom,AlisaKiatkongkumthon/atom,fang-yufeng/atom,yangchenghu/atom,chengky/atom,sotayamashita/atom,bj7/atom,githubteacher/atom,fedorov/atom,deepfox/atom,rlugojr/atom,kjav/atom,rsvip/aTom,Austen-G/BlockBuilder,deepfox/atom,fredericksilva/atom,SlimeQ/atom,crazyquark/atom,pengshp/atom,darwin/atom,vinodpanicker/atom,gontadu/atom,lisonma/atom,fang-yufeng/atom,dkfiresky/atom,synaptek/atom,harshdattani/atom,devmario/atom,Shekharrajak/atom,githubteacher/atom,amine7536/atom,oggy/atom,codex8/atom,originye/atom,KENJU/atom,sillvan/atom,abcP9110/atom,Hasimir/atom,chengky/atom,oggy/atom,Huaraz2/atom,sillvan/atom,jordanbtucker/atom,Galactix/atom,fedorov/atom,execjosh/atom,bcoe/atom,pkdevbox/atom,rlugojr/atom,toqz/atom,mostafaeweda/atom,ironbox360/atom,FoldingText/atom,dannyflax/atom,mdumrauf/atom,Huaraz2/atom,Shekharrajak/atom,anuwat121/atom,burodepeper/atom,codex8/atom,kdheepak89/atom,fredericksilva/atom,pkdevbox/atom,ardeshirj/atom,elkingtonmcb/atom,florianb/atom,liuderchi/atom,batjko/atom,mrodalgaard/atom,kaicataldo/atom,Sangaroonaom/atom,jlord/atom,nvoron23/atom,niklabh/atom,batjko/atom,Jandersoft/atom,basarat/atom,bencolon/atom,nucked/atom,isghe/atom,bolinfest/atom,brettle/atom,hpham04/atom,vinodpanicker/atom,synaptek/atom,rsvip/aTom,tisu2tisu/atom,Mokolea/atom,ali/atom,splodingsocks/atom,sxgao3001/atom,Hasimir/atom,wiggzz/atom,abe33/atom,russlescai/atom,erikhakansson/atom,efatsi/atom,YunchengLiao/atom,hagb4rd/atom,NunoEdgarGub1/atom,chengky/atom,RobinTec/atom,sebmck/atom,yamhon/atom,beni55/atom,mostafaeweda/atom,helber/atom,tmunro/atom,ReddTea/atom,DiogoXRP/atom,avdg/atom,AlexxNica/atom,targeter21/atom,KENJU/atom,t9md/atom,bcoe/atom,ObviouslyGreen/atom,PKRoma/atom,Rychard/atom,mertkahyaoglu/atom,mnquintana/atom,CraZySacX/atom,Jonekee/atom,ardeshirj/atom,001szymon/atom,FoldingText/atom,john-kelly/atom,Austen-G/BlockBuilder,GHackAnonymous/atom,brettle/atom,fang-yufeng/atom,bencolon/atom,AlbertoBarrago/atom,qiujuer/atom,codex8/atom,lovesnow/atom,Galactix/atom,jeremyramin/atom,alfredxing/atom,NunoEdgarGub1/atom,MjAbuz/atom,mostafaeweda/atom,vcarrera/atom,RobinTec/atom,florianb/atom,G-Baby/atom,YunchengLiao/atom,me6iaton/atom,Locke23rus/atom,devmario/atom,Abdillah/atom,RobinTec/atom |
d56f2d32b8112820a82734db035ac66b5802277b | gulp/specs.coffee | gulp/specs.coffee | mocha = require 'gulp-mocha'
gutil = require 'gulp-util'
webpack = require 'webpack-stream'
runSequence = require 'run-sequence'
karma = require 'gulp-karma'
require 'coffee-loader'
module.exports = (gulp) ->
gulp.task 'specs', (next) ->
runSequence 'specs:server', 'specs:client', next
gulp.task 'specs:client', (next) ->
runSequence 'specs:client:build', 'specs:client:run', next
gulp.task 'specs:server', ->
gulp.src 'src/**/*.coffee'
.pipe mocha()
gulp.task 'specs:client:build', ->
webpackConfig = require('./webpack_config').getDefaultConfiguration()
webpackConfig.output =
filename: 'specs.js'
gulp.src [
'src/**/*.coffee'
]
.pipe webpack webpackConfig
.pipe gulp.dest 'dist/specs'
gulp.task 'specs:client:run', (next) ->
gulp.src 'dist/specs/specs.js'
.pipe karma
configFile: 'karma.conf.coffee'
action: 'start' | mocha = require 'gulp-mocha'
gutil = require 'gulp-util'
webpack = require 'webpack-stream'
runSequence = require 'run-sequence'
karma = require 'gulp-karma'
require 'coffee-loader'
module.exports = (gulp) ->
gulp.task 'specs', (next) ->
runSequence 'specs:server', 'specs:client', next
gulp.task 'specs:client', (next) ->
runSequence 'specs:client:build', 'specs:client:run', next
gulp.task 'specs:server', ->
gulp.src [
'src/spec_setup.coffee'
'src/**/*.coffee'
]
.pipe mocha()
gulp.task 'specs:client:build', ->
webpackConfig = require('./webpack_config').getDefaultConfiguration()
webpackConfig.output =
filename: 'specs.js'
gulp.src [
'src/spec_setup.coffee'
'src/**/*.coffee'
]
.pipe webpack webpackConfig
.pipe gulp.dest 'dist/specs'
gulp.task 'specs:client:run', (next) ->
gulp.src 'dist/specs/specs.js'
.pipe karma
configFile: 'karma.conf.coffee'
action: 'start' | Fix globs for spec tasks, make sure spec_setup always comes first | Gulp: Fix globs for spec tasks, make sure spec_setup always comes first
| CoffeeScript | mit | efacilitation/eventric |
0f403074c10820fdc9c2110c579d5fa6f51e9b18 | resource_helper.coffee | resource_helper.coffee | ExpressHttpResource = require 'bloops/adapters/express_resource'
MongooseAdapter = require 'bloops/adapters/mongoose_adapter'
models = require('./db').models
filters = require 'bloops/filters'
cors = require 'cors'
class BaseResource extends ExpressHttpResource
adapter: MongooseAdapter
context:
models: models
class Resource extends BaseResource
willAddEndpoint: (app, route, method, handler) ->
# Enable a pre-flight OPTIONS request
app.options(route, cors())
getMiddleware: ->
[cors()]
module.exports = {Resource, models, filters} | ExpressHttpResource = require 'bloops/adapters/express_resource'
MongooseAdapter = require 'bloops/adapters/mongoose_adapter'
models = require('./db').models
filters = require 'bloops/filters'
cors = require 'cors'
class BaseResource extends ExpressHttpResource
adapter: MongooseAdapter
context:
models: models
class Resource extends BaseResource
willAddEndpoint: (app, route, method, handler) ->
# Enable a pre-flight OPTIONS request
app.options(route, cors())
getMiddleware: ->
[cors()].concat(super)
module.exports = {Resource, models, filters} | Use provided middleware in resources by default | Use provided middleware in resources by default
| CoffeeScript | mit | bosgood/votewithme-server |
58281da6c2123458a0c3e6999bb90d0d41ce6dcd | 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'
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="disabled header item">
<i className="world 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'} target="_blank">
<i className="feed icon"></i>
Atom feed
</a>
<a className="item" href="https://github.com/foobert/gc" target="_blank">
<i className="github icon"></i>
View Source
</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'
# log calculator -> book icon
# statistics -> bar chart icon
<div className="ui left thin vertical inverted icon labeled sidebar menu">
<div className="disabled header item">
<i className="world 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'} target="_blank">
<i className="feed icon"></i>
Atom feed
</a>
<a className="item" href="https://github.com/foobert/gc" target="_blank">
<i className="github icon"></i>
View Source
</a>
</div>
| Add comment for later menu entries | Add comment for later menu entries
| CoffeeScript | mit | foobert/gc,foobert/gc,foobert/gc,foobert/gc |
c7b9c1a9fb8ec37ae68de5cfb1099aaf80035f9e | konecty:nrr.coffee | konecty:nrr.coffee | if Package.templating?
Template = Package.templating.Template
Blaze = Package.blaze.Blaze
Blaze.toHTMLWithDataNonReactive = (content, data) ->
makeCursorReactive = (obj) ->
if obj instanceof Meteor.Collection.Cursor
obj._depend
added: true
removed: true
changed: true
makeCursorReactive data
if data instanceof Spacebars.kw and Object.keys(data.hash).length > 0
for key, value of data.hash
makeCursorReactive value
data = data.hash
html = ''
Tracker.nonreactive ->
html = Blaze.toHTMLWithData content, data
return html
Blaze.renderNonReactive = (templateName, data) ->
return Blaze.toHTMLWithDataNonReactive Template[templateName], data
Blaze.registerHelper 'nonReactiveRender', Blaze.renderNonReactive
Blaze.registerHelper 'nrr', Blaze.renderNonReactive | if Package.templating?
Template = Package.templating.Template
Blaze = Package.blaze.Blaze
HTML = Package.htmljs.HTML
Blaze.toHTMLWithDataNonReactive = (content, data) ->
makeCursorReactive = (obj) ->
if obj instanceof Meteor.Collection.Cursor
obj._depend
added: true
removed: true
changed: true
makeCursorReactive data
if data instanceof Spacebars.kw and Object.keys(data.hash).length > 0
for key, value of data.hash
makeCursorReactive value
data = data.hash
html = ''
Tracker.nonreactive ->
html = Blaze.toHTMLWithData content, data
return html
Blaze.registerHelper 'nrrargs', ->
obj = {}
obj._arguments = arguments
return obj
Blaze.renderNonReactive = (templateName, data) ->
_arguments = this.parentView.dataVar.get()._arguments
templateName = _arguments[0]
data = _arguments[1]
view = undefined
Tracker.nonreactive ->
view = new Blaze.View 'nrr', ->
return HTML.Raw Blaze.toHTMLWithDataNonReactive Template[templateName], data
view.onViewReady ->
Template[templateName].onViewReady?.call view
return view
Blaze.registerHelper 'nrr', Blaze.Template('nrr', Blaze.renderNonReactive) | Change from simple helper to block to allow track render | Change from simple helper to block to allow track render
| CoffeeScript | mit | Konecty/meteor-nrr |
5f84ef3459fe61dc9a58f5253a51bc1ce34ad581 | lib/js_refactor.coffee | lib/js_refactor.coffee | Ripper = require './ripper'
NotificationView = require './notification-view'
{ packages: packageManager } = atom
module.exports =
activate: ->
return if 'refactor' in packageManager.getAvailablePackageNames() and
!packageManager.isPackageDisabled 'refactor'
new NotificationView
deactivate: ->
serialize: ->
Ripper: Ripper
| Ripper = require './ripper'
NotificationView = require './notification_view'
{ packages: packageManager } = atom
module.exports =
activate: ->
return if 'refactor' in packageManager.getAvailablePackageNames() and
!packageManager.isPackageDisabled 'refactor'
new NotificationView
deactivate: ->
serialize: ->
Ripper: Ripper
| Rename filename to snake case | Rename filename to snake case
| CoffeeScript | mit | hax/js-refactor,minodisk/js-refactor,minodisk/js-refactor |
c510afa3f14cb2a53a42ad267c039c44cb7b8316 | lib/table-edit.coffee | lib/table-edit.coffee |
module.exports =
activate: (state) ->
atom.workspaceView.command 'table-edit:demo', ->
Table = require './table'
TableView = require './table-view'
table = new Table
table.addColumn 'key'
table.addColumn 'value'
table.addColumn 'foo'
for i in [0...100]
table.addRow [
"row#{i}"
i * 100
if i % 2 is 0 then 'yes' else 'no'
]
tableView = new TableView(table)
tableView.setRowHeight 20
tableView.setRowOverdraw 10
tableView.addClass('demo overlay from-top').height(300)
atom.workspaceView.append(tableView)
tableView.on 'core:cancel', -> tableView.destroy()
deactivate: ->
serialize: ->
|
module.exports =
activate: (state) ->
atom.workspaceView.command 'table-edit:demo', ->
Table = require './table'
TableView = require './table-view'
table = new Table
table.addColumn 'key'
table.addColumn 'value', align: 'right'
table.addColumn 'foo', align: 'right'
for i in [0...100]
table.addRow [
"row#{i}"
i * 100
if i % 2 is 0 then 'yes' else 'no'
]
tableView = new TableView(table)
tableView.setRowHeight 20
tableView.setRowOverdraw 10
tableView.addClass('demo overlay from-top').height(300)
atom.workspaceView.append(tableView)
tableView.on 'core:cancel', -> tableView.destroy()
deactivate: ->
serialize: ->
| Add an alignment on columns in demo table | Add an alignment on columns in demo table
| CoffeeScript | mit | abe33/atom-tablr |
fdb7363575bd69172a6672b9c337c6e2ffdf4877 | lib/side-view.coffee | lib/side-view.coffee | {View, $} = require 'atom'
module.exports =
class SideView extends View
@content: (side) ->
@div class: "side #{side.klass()} ui-site-#{side.site()}", =>
@div class: 'controls', =>
@label class: 'text-highlight', side.ref
@span class: 'text-subtle', "// #{side.description()}"
@button class: 'btn btn-xs pull-right', click: 'useMe', "Use Me"
initialize: (@side) ->
installIn: (editorView) ->
@side.lines.addClass("conflict-line ours")
@offset left: 0, top: @side.marker.position().top
@height @side.marker.height()
@appendTo editorView.find(".overlayer")
useMe: ->
console.log "useMe clicked"
getModel: -> null
| {View, $} = require 'atom'
module.exports =
class SideView extends View
@content: (side) ->
@div class: "side #{side.klass()} ui-site-#{side.site()}", =>
@div class: 'controls', =>
@label class: 'text-highlight', side.ref
@span class: 'text-subtle', "// #{side.description()}"
@button class: 'btn btn-xs pull-right', click: 'useMe', "Use Me"
initialize: (@side) ->
installIn: (editorView) ->
@side.lines.addClass("conflict-line #{@side.klass()}")
@offset left: 0, top: @side.marker.position().top
@height @side.marker.height()
@appendTo editorView.find(".overlayer")
useMe: ->
console.log "useMe clicked"
getModel: -> null
| Add the appropriate line class. | Add the appropriate line class.
| CoffeeScript | mit | smashwilson/merge-conflicts,antcodd/merge-conflicts,smashwilson/merge-conflicts |
da1d5cd8128f2f08fcdffc715662f5b21a32ebba | app/assets/volume/editLinks.coffee | app/assets/volume/editLinks.coffee | 'use strict'
app.directive 'volumeEditLinksForm', [
'pageService',
(page) ->
restrict: 'E',
templateUrl: 'volume/editLinks.html',
link: ($scope) ->
volume = $scope.volume
form = $scope.volumeEditLinksForm
form.data = _.map volume.links, (ref) ->
head: ref.head
url: ref.url
blank = () ->
form.data.push
head: ''
url: ''
blank()
form.change = () -> blank() unless form.data[form.data.length-1].url == ''
form.remove = (ref) ->
ref.removed = true
ref.head = ''
ref.url = ''
form.$setDirty()
form.save = () ->
page.messages.clear(form)
data = _.filter form.data, (ref) -> !ref.removed
form.$setSubmitted()
volume.save({links: data}).then(() ->
form.validator.server {}
form.data = data.filter (ref) -> ref.head != '' || ref.url != ''
blank()
page.messages.add
type: 'green'
body: page.constants.message('volume.edit.success')
owner: form
form.$setPristine()
form.$setUnsubmitted()
, (res) ->
form.validator.server res
)
return
]
| 'use strict'
app.directive 'volumeEditLinksForm', [
'pageService',
(page) ->
restrict: 'E',
templateUrl: 'volume/editLinks.html',
link: ($scope) ->
volume = $scope.volume
form = $scope.volumeEditLinksForm
form.data = _.map volume.links, (ref) ->
head: ref.head
url: ref.url
blank = () ->
form.data.push
head: ''
url: ''
blank()
form.change = () -> blank() unless form.data[form.data.length-1].url == ''
form.remove = (ref) ->
ref.removed = true
ref.head = ''
ref.url = ''
form.$setDirty()
form.save = () ->
page.messages.clear(form)
data = _.filter form.data, (ref) -> !ref.removed
form.$setSubmitted()
volume.save({links: data}).then(() ->
form.validator.server {}
form.data = data.filter (ref) -> ref.head != '' || ref.url != ''
blank()
page.messages.add
type: 'green'
body: page.constants.message('volume.edit.success')
owner: form
form.$setPristine()
form.$setUnsubmitted()
, (res) ->
form.$setUnsubmitted()
form.validator.server res
)
return
]
| Set unsubmitted for error case of editlinks. | Set unsubmitted for error case of editlinks.
| CoffeeScript | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
d253d93aba7dabd3a1e302596625cf1d084fe541 | layouts/Body.coffee | layouts/Body.coffee | React = require 'react'
Nav = React.createFactory require 'antwar-default-theme/Nav'
Paths = require('antwar-core/PathsMixin')
require 'antwar-default-theme/scss/main.scss'
require 'react-ghfork/gh-fork-ribbon.ie.css' # ie support
require 'react-ghfork/gh-fork-ribbon.css'
Fork = React.createFactory(require 'react-ghfork')
{ div, main, script, link } = require 'react-coffee-elements'
config = require 'config'
if config.theme.customStyles?
require 'customStyles/' + config.theme.customStyles
module.exports = React.createClass
displayName: 'Body'
mixins: [
Paths
]
render: ->
sectionName = @getSectionName()
div { },
if sectionName and sectionName != '/'
Nav()
Fork { className: 'right', project: 'survivejs/webpack_react/issues/new', text: 'Submit feedback', style: {backgroundColor: 'black'}}
main { role: 'main' }, @props.children
| React = require 'react'
Nav = React.createFactory require 'antwar-default-theme/Nav'
Paths = require('antwar-core/PathsMixin')
require 'antwar-default-theme/scss/main.scss'
require 'react-ghfork/gh-fork-ribbon.ie.css' # ie support
require 'react-ghfork/gh-fork-ribbon.css'
Fork = React.createFactory(require 'react-ghfork')
{ div, main, script, link } = require 'react-coffee-elements'
config = require 'config'
if config.theme.customStyles?
require 'customStyles/' + config.theme.customStyles
module.exports = React.createClass
displayName: 'Body'
mixins: [
Paths
]
render: ->
sectionName = @getSectionName()
itemTitle = @getItem().title;
div { },
if sectionName and sectionName != '/'
Nav()
Fork { className: 'right', project: "survivejs/webpack_react/issues/new?title=#{itemTitle} - ", text: 'Submit feedback', style: {backgroundColor: 'black'}}
main { role: 'main' }, @props.children
| Add the section name when creating a new issue | Add the section name when creating a new issue
| CoffeeScript | mit | Foxandxss/site,Foxandxss/site |
d6bd20f7ff23f293218d1c084e180d5f5b94d8a0 | lib/shuss-config.coffee | lib/shuss-config.coffee | convict = require 'convict'
config = convict {
env:
doc: 'The application environment.'
default: 'development'
env: 'NODE_ENV'
verbose:
doc: 'speak to me'
default: false
port:
doc: 'Listened port'
format: 'port'
default: '1234'
env: 'SHUSS_PORT'
dir:
doc: 'Served file directory'
default: '.'
env: 'SHUSS_DIR'
livereloadport:
doc: 'Enable livereload'
default: 35729
env: 'SHUSS_LR'
livereload:
doc: 'The livereload server port'
default: false
env: 'SHUSS_LR_PORT'
}
config.validate()
module.exports = config
| convict = require 'convict'
config = convict {
verbose:
doc: 'speak to me'
default: false
port:
doc: 'Listened port'
format: 'port'
default: '1234'
env: 'SHUSS_PORT'
dir:
doc: 'Served file directory'
default: '.'
env: 'SHUSS_DIR'
livereload:
doc: 'Enable livereload'
default: false
env: 'SHUSS_LR'
livereloadport:
doc: 'The livereload server port'
default: 35729
env: 'SHUSS_LR_PORT'
}
config.validate()
module.exports = config
| Remove useless env config, fix livereload settings | Remove useless env config, fix livereload settings
| CoffeeScript | mit | ArnaudRinquin/shuss |
1107b552f41da78ee3fe7dafb50ef58f7d4fabd9 | lib/tooltip-view.coffee | lib/tooltip-view.coffee | # Source: https://github.com/lukehoban/atom-ide-flow/blob/master/lib/tooltip-view.coffee
{$, View} = require 'atom'
module.exports = (Main)->
class TooltipView extends View
@content: ->
@div class: 'ide-hack-tooltip'
initialize: (@rect, @LeMessage) ->
@append LeMessage
$(document.body).append this
@updatePosition()
# smart position update
updatePosition: ->
coords = [@rect.right, @rect.bottom, undefined]
offset = 10
# x axis adjust
if coords[0] + this[0].offsetWidth >= $(document.body).width()
coords[0] = $(document.body).width() - this[0].offsetWidth - offset
if coords[0] < 0
this.css({ 'white-space': 'pre-wrap' })
coords[0] = offset
coords[2] = offset
# y axis adjust
if coords[1] + this[0].offsetHeight >= $(document.body).height()
coords[1] = @rect.top - this[0].offsetHeight
this.css({ left: coords[0], top: coords[1], right: coords[2] }) | # Source: https://github.com/lukehoban/atom-ide-flow/blob/master/lib/tooltip-view.coffee
{$, View} = require 'atom'
module.exports = (Main)->
class TooltipView extends View
@content: ->
@div class: 'ide-hack-tooltip'
initialize: (rect, @LeMessage) ->
@append LeMessage
$(document.body).append this
Coords = [rect.right, rect.bottom, undefined]
Offset = 10
# x axis adjust
if Coords[0] + this[0].OffsetWidth >= $(document.body).width()
Coords[0] = $(document.body).width() - this[0].OffsetWidth - Offset
if Coords[0] < 0
this.css({ 'white-space': 'pre-wrap' })
Coords[0] = Offset
Coords[2] = Offset
# y axis adjust
if Coords[1] + this[0].OffsetHeight >= $(document.body).height()
Coords[1] = @rect.top - this[0].OffsetHeight
this.css({ left: Coords[0], top: Coords[1], right: Coords[2] })
| Merge updatePosition function into Initialize | :art: Merge updatePosition function into Initialize
| CoffeeScript | mit | steelbrain/Atom-Hack |
5596e8614f83b95c09eeb3aef267f7af9ad957b0 | src/coffee/run.coffee | src/coffee/run.coffee | Validator = require('../main').Validator
fs = require 'fs'
argv = require('optimist')
.usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --csv file')
.demand(['projectKey', 'clientId', 'clientSecret', 'csv'])
.argv
timeout = argv.timeout
timeout or= 60000
options =
config:
project_key: argv.projectKey
client_id: argv.clientId
client_secret: argv.clientSecret
timeout: timeout
validator = new Validator options
fs.readFile argv.csv, 'utf8', (err, content) ->
if err
console.error "Problems on reading file '#{argv.csv}': " + err
process.exit 2
validator.parse content, (data, count) ->
errors = validator.validate data, (then) ->
process.exit 0 if validator.errors.length is 0
console.log validator.errors
process.exit 1 | Validator = require('../main').Validator
fs = require 'fs'
argv = require('optimist')
.usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --csv file')
.describe('projectKey', 'your SPHERE.IO project-key')
.describe('clientId', 'your OAuth client id for the SPHERE.IO API')
.describe('clientSecret', 'your OAuth client secret for the SPHERE.IO API')
.describe('csv', 'CSV file containing products to validate or import')
.demand(['projectKey', 'clientId', 'clientSecret', 'csv'])
.argv
timeout = argv.timeout
timeout or= 60000
options =
config:
project_key: argv.projectKey
client_id: argv.clientId
client_secret: argv.clientSecret
timeout: timeout
validator = new Validator options
fs.readFile argv.csv, 'utf8', (err, content) ->
if err
console.error "Problems on reading file '#{argv.csv}': " + err
process.exit 2
validator.parse content, (data, count) ->
errors = validator.validate data, (then) ->
process.exit 0 if validator.errors.length is 0
console.log validator.errors
process.exit 1 | Add description for command line options. | Add description for command line options.
| CoffeeScript | mit | sphereio/sphere-node-product-csv-sync,sphereio/sphere-node-product-csv-sync,sphereio/sphere-node-product-csv-sync |
3e773c9d3b221f63f2f8d9d0e595e42dc23aadb7 | app/scripts/models/command.coffee | app/scripts/models/command.coffee | define [
"jquery"
"backbone"
"app"
"lib/extension"
"lib/fuzzy-match"
], (
$
Backbone
App
Extension
FuzzyMatch
) ->
class Command extends Backbone.Model
match: null
getTemplateData: ->
$.extend {}, @toJSON(), match: @match
createMatch: (search) ->
@match = new FuzzyMatch @get("name"), search
execute: ->
Extension.trigger "fetch.commands", @attributes
App.once "fetched.commands", (src) =>
window.location = "javascript:#{encodeURIComponent src}"
App.trigger "close"
| define [
"jquery"
"backbone"
"app"
"lib/extension"
"lib/fuzzy-match"
], (
$
Backbone
App
Extension
FuzzyMatch
) ->
class Command extends Backbone.Model
match: null
getTemplateData: ->
$.extend {}, @toJSON(), match: @match
createMatch: (search) ->
@match = new FuzzyMatch @get("name"), search
execute: ->
Extension.trigger "fetch.commands", @attributes
App.once "fetched.commands", (src) =>
src = decodeURIComponent src
window.location = "javascript:#{encodeURIComponent src}"
App.trigger "close"
| Make sure code is url decoded before encoding it to avoid double encoding | Make sure code is url decoded before encoding it to avoid double encoding
| CoffeeScript | mit | JoelBesada/Backtick |
0c1c960f383c869e4639847545a7fc6ac01f896c | src/draggable-mixin.coffee | src/draggable-mixin.coffee | Mixin = require 'mixto'
module.exports =
class Draggable extends Mixin
# Allows for user dragging on the screen
# * `startEvent` (optional) event from a mousedown event
enableDragging: (startEvent) ->
return if @_draggingEnabled
element = @svgEl
return unless element?
element.draggable(startEvent)
element.dragmove = =>
@updateFromAttributes()
element.dragend = (event) =>
@model.setTransformString(null)
@model.translate([event.x, event.y])
@_draggingEnabled = true
disableDragging: ->
return unless @_draggingEnabled
element = @svgEl
return unless element?
element.fixed?()
element.dragstart = null
element.dragmove = null
element.dragend = null
@_draggingEnabled = false
| Mixin = require 'mixto'
module.exports =
class Draggable extends Mixin
# Allows for user dragging on the screen
# * `startEvent` (optional) event from a mousedown event
enableDragging: (startEvent) ->
return if @_draggingEnabled
element = @svgEl
return unless element?
element.draggable(startEvent)
element.dragmove = =>
@updateFromAttributes()
element.dragend = (event) =>
@model.set(transform: null)
@model.translate([event.x, event.y])
@_draggingEnabled = true
disableDragging: ->
return unless @_draggingEnabled
element = @svgEl
return unless element?
element.fixed?()
element.dragstart = null
element.dragmove = null
element.dragend = null
@_draggingEnabled = false
| Use new model setter in draggable | Use new model setter in draggable | CoffeeScript | mit | benogle/curve,benogle/curve |
cd2c711e9ec5c4bbb3309c7ef55164225302ecbe | app/assets/javascripts/models/paper.js.coffee | app/assets/javascripts/models/paper.js.coffee | a = DS.attr
ETahi.Paper = DS.Model.extend
assignees: DS.hasMany('user')
editors: DS.hasMany('user')
reviewers: DS.hasMany('user')
editor: Ember.computed.alias('editors.firstObject')
collaborations: DS.hasMany('collaboration')
collaborators: (->
@get('collaborations').mapBy('user')
).property('collaborations.@each')
authors: DS.hasMany('author')
figures: DS.hasMany('figure', inverse: 'paper')
supportingInformationFiles: DS.hasMany('supportingInformationFile')
journal: DS.belongsTo('journal')
phases: DS.hasMany('phase')
tasks: DS.hasMany('task', {async: true, polymorphic: true})
lockedBy: DS.belongsTo('user')
body: a('string')
shortTitle: a('string')
submitted: a('boolean')
status: a('string')
title: a('string')
paperType: a('string')
eventName: a('string')
strikingImageId: a('string')
relationshipsToSerialize: []
displayTitle: (->
@get('title') || @get('shortTitle')
).property('title', 'shortTitle')
allMetadataTasks: (->
@get('tasks').filterBy('isMetadataTask')
).property('tasks.content.@each.isMetadataTask')
allMetadataTasksCompleted: ETahi.computed.all('allMetadataTasks', 'completed', true)
editable: (->
!(@get('allTasksCompleted') and @get('submitted'))
).property('allTasksCompleted', 'submitted')
| a = DS.attr
ETahi.Paper = DS.Model.extend
assignees: DS.hasMany('user') # these are admins that have been assigned to the paper.
editors: DS.hasMany('user') # these are editors that have been assigned to the paper.
reviewers: DS.hasMany('user') # these are reviewers that have been assigned to the paper.
editor: Ember.computed.alias('editors.firstObject')
collaborations: DS.hasMany('collaboration')
collaborators: (->
@get('collaborations').mapBy('user')
).property('collaborations.@each')
authors: DS.hasMany('author')
figures: DS.hasMany('figure', inverse: 'paper')
supportingInformationFiles: DS.hasMany('supportingInformationFile')
journal: DS.belongsTo('journal')
phases: DS.hasMany('phase')
tasks: DS.hasMany('task', {async: true, polymorphic: true})
lockedBy: DS.belongsTo('user')
body: a('string')
shortTitle: a('string')
submitted: a('boolean')
status: a('string')
title: a('string')
paperType: a('string')
eventName: a('string')
strikingImageId: a('string')
relationshipsToSerialize: []
displayTitle: (->
@get('title') || @get('shortTitle')
).property('title', 'shortTitle')
allMetadataTasks: (->
@get('tasks').filterBy('isMetadataTask')
).property('tasks.content.@each.isMetadataTask')
allMetadataTasksCompleted: ETahi.computed.all('allMetadataTasks', 'completed', true)
editable: (->
!(@get('allTasksCompleted') and @get('submitted'))
).property('allTasksCompleted', 'submitted')
| Add clarifying comments to model. | Add clarifying comments to model.
| CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi |
e4e6823a144ddeb7a7b80211a42dfadd015bf05f | src/coffee/edsl.coffee | src/coffee/edsl.coffee | angular.module 'qbn.edsl', ['qbn.quality', 'qbn.storylet', 'qbn.choice']
.factory 'qbnEdsl', (qualities, storylets, frontalChoices, choiceFactory) ->
api =
quality: (id, name, description, args = {}) ->
{defaultValue, defaultProgress, maxProgress, hasProgress, progressEscalation,
visible} = args
defaultValue ?= 0
defaultProgress ?= 0
maxProgress ?= if hasProgress then 100 else 0
progressEscalation ?= 0.10
visible ?= true
qualities.register id, name, description, defaultValue,
defaultProgress, maxProgress, progressEscalation,
visible
return
storylet: (id, title, text, choices = [], args = {}) ->
{frontFacingChoice} = args
storylets.register id, title, text, choices, frontFacingChoice
return
choice: (title, text, next, args) ->
{visibleReqs, activeReqs} = args
visibleReqs ?= {}
activeReqs ?= {}
choiceFactory title, text, visibleReqs, activeReqs, args
front: (choice) ->
frontalChoices.register choice
return
return Object.freeze api
| angular.module 'qbn.edsl', ['qbn.quality', 'qbn.storylet', 'qbn.choice']
.factory 'qbnEdsl', (qualities, storylets, frontalChoices, choiceFactory) ->
api =
quality: (id, name, description, args = {}) ->
{defaultValue, defaultProgress, maxProgress, hasProgress, progressEscalation,
visible} = args
defaultValue ?= 0
defaultProgress ?= 0
maxProgress ?= if hasProgress then 100 else 0
progressEscalation ?= 0.10
visible ?= true
qualities.register id, name, description, defaultValue,
defaultProgress, maxProgress, progressEscalation,
visible
return
storylet: (id, title, text, choices = [], args = {}) ->
{frontFacingChoice} = args
storylets.register id, title, text, choices, frontFacingChoice
return
choice: (title, text, next, args = {}) ->
{visibleReqs, activeReqs} = args
visibleReqs ?= {}
activeReqs ?= {}
choiceFactory title, text, visibleReqs, activeReqs, args
front: (choice) ->
frontalChoices.register choice
return
return Object.freeze api
| Fix Missing Default Param in choice EDSL | Fix Missing Default Param in choice EDSL
| CoffeeScript | unlicense | arashikou/exper3-2015 |
16d2dd8652ad4b3091f96fb718a7f0aeb3d9366c | drawing-tools/pinpoint.coffee | drawing-tools/pinpoint.coffee | BasePoint = require 'zooniverse-readymade/lib/drawing-tools/point'
ToolControls = require './tool-controls'
class Pinpoint extends BasePoint
@Controls: ToolControls
constructor: ->
super
@disc.attr 'class', 'pinpoint'
rescale: (scale) ->
super
coords: (e) ->
@markingSurface.screenPixelToScale @markingSurface.svg.pointerOffset e
onMove: (e) =>
{x, y} = @coords e
@mark.set {x, y}
render: ->
super
@controls.moveTo
x: @mark.x + 30
y: @mark.y
module.exports = Pinpoint | BasePoint = require 'zooniverse-readymade/lib/drawing-tools/point'
ToolControls = require './tool-controls'
class Pinpoint extends BasePoint
@Controls: ToolControls
constructor: ->
super
@disc.attr 'class', 'pinpoint'
rescale: (scale) ->
super
coords: (e) ->
@markingSurface.screenPixelToScale @markingSurface.svg.pointerOffset e
onMove: (e) =>
{x, y} = @coords e
@mark.set {x, y}
render: ->
super
offset = @radius / @markingSurface.magnification
@controls.moveTo
x: @mark.x + offset
y: @mark.y
module.exports = Pinpoint | Fix point tool controls offset when scaling image. | Fix point tool controls offset when scaling image.
| CoffeeScript | apache-2.0 | zooniverse/BHL |
0c1d9d1694ade33dab52c138ffebd58fc2cb8b64 | scripts/kerb.coffee | scripts/kerb.coffee | # Description:
# Make hubot list what tasty treats are available at Kerb Kings Cross (eat.st)
#
# Dependencies:
#
# Configuration:
# None
#
# Commands:
# hubot what's on kerb
jsdom = require "jsdom"
module.exports = (robot) ->
robot.respond /what\'s on kerb/i, (msg) ->
url = "http://www.kerbfood.com/kings-cross/"
jsdom.env url, [ "http://code.jquery.com/jquery-1.5.min.js" ], (errors, window) ->
d = new Date();
formatted_date = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate()
traders = window.$("#date-"+formatted_date+" ul li div.rota_content")
message_str = "\n"
traders.each (index, element) =>
trader_name = window.$(element).children("h4").text()
trader_desc = window.$(element).children("p").text()
message_str += trader_name + "\n"
message_str += " " + trader_desc + "\n"
msg.send message_str
| # Description:
# Make hubot list what tasty treats are available at Kerb Kings Cross (eat.st)
#
# Dependencies:
#
# Configuration:
# None
#
# Commands:
# hubot what's on kerb
jsdom = require "jsdom"
module.exports = (robot) ->
robot.respond /what\'s on kerb/i, (msg) ->
url = "http://www.kerbfood.com/kings-cross/"
jsdom.env url, [ "http://code.jquery.com/jquery-1.5.min.js" ], (errors, window) ->
d = new Date();
day = d.getDate()
day = (day < 10 ? '0' : '') + number
formatted_date = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + day
traders = window.$("#date-"+formatted_date+" ul li div.rota_content")
message_str = "\n"
traders.each (index, element) =>
trader_name = window.$(element).children("h4").text()
trader_desc = window.$(element).children("p").text()
message_str += trader_name + "\n"
message_str += " " + trader_desc + "\n"
msg.send message_str | Fix days of week formatting (1 -> 01) | Fix days of week formatting (1 -> 01)
| CoffeeScript | mit | altmetric/hubot-kerb,altmetric/hubot-kerb |
36f580c0533ffbe4516e49bca40f23ad2833ee9f | lib/chat_channel.coffee | lib/chat_channel.coffee | builder = require('xmlbuilder')
class ChatChannel
constructor: (@reflector) ->
sendMessage: (player, message) ->
xml = builder.create('root')
.ele('chat', { from : player.name, message : message })
.toString({ pretty: false })
console.log(xml)
@reflector.sendAll "<chat from='#{player.name}'>"
@reflector.scene.dispatchEvent 'chat', { player : player, message : message } | # builder = require('xmlbuilder')
class ChatChannel
constructor: (@reflector) ->
sendMessage: (player, message) ->
return
xml = builder.create('root')
.ele('chat', { from : player.name, message : message })
.toString({ pretty: false })
console.log(xml)
@reflector.sendAll "<chat from='#{player.name}'>"
@reflector.scene.dispatchEvent 'chat', { player : player, message : message } | Fix for broken chat channel stuff. | Fix for broken chat channel stuff.
| CoffeeScript | bsd-3-clause | elekezem/server,scenevr/server,Flet/scenevr,scenevr/server |
96ca6d751b222df0b9bd833c413f4defecd2e11b | src/Timer.coffee | src/Timer.coffee | class Timer
constructor: (@id, @elapsed) ->
@seconds = 0
@minutes = 0
@hours = 0
@interval = undefined
if @elapsed
time = parseSeconds(@elapsed)
@seconds = time.seconds
@minutes = time.minutes
@hours = time.hours
parseSeconds = (seconds) ->
hours = Math.floor(seconds/3600)
seconds -= hours*3600
minutes = Math.floor(seconds/60)
seconds -= minutes*60
{hours: hours, minutes: minutes, seconds: seconds}
timeToString = (seconds, minutes, hours) ->
hoursString = ""
minutesString = ""
secondsString = ""
if hours < 10
hoursString = "0" + hours
else
hoursString = hours
if minutes < 10
minutesString = "0" + minutes
else
minutesString = minutes
if seconds < 10
secondsString = "0" + seconds
else
secondsString = seconds
timeString = ""
if hours > 0
timeString += hoursString + ":"
timeString += "#{minutesString}:#{secondsString}"
return timeString
startInterval: () ->
stepSecond = () =>
@seconds++
if @seconds >= 60
@seconds = @seconds % 60
@minutes++
$(@id).html(timeToString(@seconds, @minutes, @hours))
@interval = setInterval(stepSecond, 1000)
stop: () ->
clearInterval(@interval)
module.exports = Timer
| class Timer
constructor: (@id, @elapsed) ->
@seconds = 0
@minutes = 0
@hours = 0
@startTime = null
@interval = undefined
if @elapsed
time = parseSeconds(@elapsed)
@seconds = time.seconds
@minutes = time.minutes
@hours = time.hours
parseSeconds = (seconds) ->
hours = Math.floor(seconds/3600)
seconds -= hours*3600
minutes = Math.floor(seconds/60)
seconds -= minutes*60
{hours: hours, minutes: minutes, seconds: seconds}
timeToString = (seconds, minutes, hours) ->
hoursString = ""
minutesString = ""
secondsString = ""
if hours < 10
hoursString = "0" + hours
else
hoursString = hours
if minutes < 10
minutesString = "0" + minutes
else
minutesString = minutes
if seconds < 10
secondsString = "0" + seconds
else
secondsString = seconds
timeString = ""
if hours > 0
timeString += hoursString + ":"
timeString += "#{minutesString}:#{secondsString}"
return timeString
startInterval: () ->
@startTime = Date.now()
stepSecond = () =>
totalSeconds = Math.floor((Date.now() - @startTime) / 1000) + @elapsed
time = parseSeconds(totalSeconds)
@hours = time.hours
@minutes = time.minutes
@seconds = time.seconds
$(@id).html(timeToString(@seconds, @minutes, @hours))
@interval = setInterval(stepSecond, 500)
stop: () ->
clearInterval(@interval)
module.exports = Timer
| Set timer based on time, not setInterval calls | Set timer based on time, not setInterval calls
- timer was drifting like crazy
| CoffeeScript | mit | CMS611-snap/snap-frontend,CMS611-snap/snap-frontend,CMS611-snap/snap-frontend |
e7154cea5c9be70347be88f76f1b7e94f17a5550 | app/assets/javascripts/controllers/activities.coffee | app/assets/javascripts/controllers/activities.coffee | scrollHandler = ->
url = $(".actvty-pagination .next_page a").attr("href")
if url and $(window).scrollTop() > $(document).height() - $(window).height() - 300
$(".actvty-pagination").text "Nicht so schnell..."
showSpinner()
$.getScript url
return
if $(".actvty-pagination").length
$(window).scroll(scrollHandler)
$(window).scroll()
$(document).on 'page:load', ->
$(window).off "scroll", scrollHandler
showActivitiesClickHandler = ->
$(this).closest(".grouped-activities").children(".activity").each ->
$(this).slideDown()
$(this).parent().hide()
$(".show-activities").click showActivitiesClickHandler
for id of window.unread["activity"]
$("#activity-#{id} .unread-flag").show();
| scrollHandler = ->
url = $(".actvty-pagination .next_page a").attr("href")
if url and $(window).scrollTop() > $(document).height() - $(window).height() - 300
$(".actvty-pagination").text "Nicht so schnell..."
showSpinner()
$.getScript url
return
if $(".actvty-pagination").length
$(window).scroll(scrollHandler)
$(window).scroll()
$(document).on 'page:load', ->
$(window).off "scroll", scrollHandler
showActivitiesClickHandler = ->
$(this).closest(".grouped-activities").children(".activity").each ->
$(this).slideDown()
$(this).parent().hide()
$(".show-activities").click showActivitiesClickHandler
$.turboInit ->
for k, v of window.unread["activity"]
$("#activity-#{v} .unread-flag").show();
| Fix adding of unread astericks | Fix adding of unread astericks
| CoffeeScript | unlicense | caffeineshock/dysnomia,caffeineshock/dysnomia,caffeineshock/dysnomia |
bb7adfab522b918e86bc7af9c6e6e4ce90dd6c92 | lib/getThrottles.coffee | lib/getThrottles.coffee | debug = require('debug')('meshblu:getThrottles')
Limitus = require 'limitus'
limiter = new Limitus()
config = require '../config'
config.rateLimits ?= {};
windowRate = 1000
createThrottle = (name, rate) ->
debug 'createThrottle', name, rate
limiter.rule name, max: rate, interval: windowRate
rateLimit: (id="", callback=->) =>
debug 'rateLimit', name, id
limiter.drop(name, id, callback)
module.exports =
connection: createThrottle 'connection', config.rateLimits.connection
query: createThrottle 'query', config.rateLimits.query
message: createThrottle 'message', config.rateLimits.message
data: createThrottle 'data', config.rateLimits.data
whoami: createThrottle 'whoami', config.rateLimits.whoami
unthrottledIps : config.rateLimits.unthrottledIps
| debug = require('debug')('meshblu:getThrottles')
Limitus = require 'limitus'
limiter = new Limitus()
config = require '../config'
config.rateLimits ?= {};
windowRate = 1000
createThrottle = (name, rate) ->
debug 'createThrottle', name, rate
limiter.rule name, max: rate, interval: windowRate, mode: 'interval'
rateLimit: (id="", callback=->) =>
debug 'rateLimit', name, id
limiter.drop(name, id, callback)
module.exports =
connection: createThrottle 'connection', config.rateLimits.connection
query: createThrottle 'query', config.rateLimits.query
message: createThrottle 'message', config.rateLimits.message
data: createThrottle 'data', config.rateLimits.data
whoami: createThrottle 'whoami', config.rateLimits.whoami
unthrottledIps : config.rateLimits.unthrottledIps
| Switch to interval rate limiting | Switch to interval rate limiting
| CoffeeScript | mit | masato/meshblu-dev,masato/meshblu-dev,ChemTics/meshblu,octoblu/meshblu,jaambee/meshblu,masato/meshblu,osokay/IotServerCore,osokay/IotServerCore,ChemTics/meshblu,masato/meshblu-dev,dommert/meshblu,masato/meshblu,jaambee/meshblu,jaambee/meshblu,osokay/IotServerCore,dommert/meshblu,masato/meshblu,dommert/meshblu,octoblu/meshblu,ChemTics/meshblu |
a406fe603ff9348c90b04638786fe214fcc09167 | spec/javascripts/foobar_spec.js.coffee | spec/javascripts/foobar_spec.js.coffee | # spec/javascripts/foobar_spec.js.coffee
describe "foobar", ->
it 'works', -> expect(1 + 1).toEqual(2);
describe "wanted failure", ->
it 'fails', -> expect(1 + 1).toEqual(42);
| # spec/javascripts/foobar_spec.js.coffee
describe "foobar", ->
it 'works', -> expect(1 + 1).toEqual(2);
| Remove failing test since Travis works. | Remove failing test since Travis works.
| CoffeeScript | agpl-3.0 | sjockers/teikei,sjockers/teikei,teikei/teikei,teikei/teikei,sjockers/teikei,teikei/teikei |
a260977da934624b8ad212f09f7b04e3cde2d778 | js-library/app/js/jail_iframe/classes/content_box.coffee | js-library/app/js/jail_iframe/classes/content_box.coffee | FactlinkJailRoot.contentBox = (element) ->
$element = $(element)
offset = $element.offset()
top: offset.top + parseInt window.getComputedStyle(element)['padding-top']
left: offset.left + parseInt window.getComputedStyle(element)['padding-left']
width: $element.width()
height: $element.height()
| FactlinkJailRoot.contentBox = (element) ->
$element = $(element)
offset = $element.offset()
top: offset.top + parseInt window.getComputedStyle(element).paddingTop
left: offset.left + parseInt window.getComputedStyle(element).paddingLeft
width: $element.width()
height: $element.height()
| Use paddingTop/Left, as this also works in firefox | Use paddingTop/Left, as this also works in firefox
| CoffeeScript | mit | daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core |
6fa0c05f00140eb62d86c963b2eeb16aa035d9ff | apps/block/routes.coffee | apps/block/routes.coffee | Q = require 'bluebird-q'
Channel = require "../../models/channel"
Block = require "../../models/block"
Comments = require "../../collections/comments"
User = require "../../models/user"
markdown = require '../../lib/markdown'
sd = require("sharify").data
_ = require 'underscore'
@block = (req, res, next) ->
block = new Block id: req.params.block_id
comments = new Comments [], block: block
Q.all [
block.fetch data: auth_token: req.user?.get('authentication_token')
comments.fetch(data: auth_token: req.user?.get('authentication_token')) if req.user?.has('username')
]
.then ->
res.locals.sd.BLOCK = block.toJSON()
res.locals.sd.COMMENTS = comments.toJSON()
res.locals.sd.CURRENT_ACTION = 'block'
canIndexConnections = _.all block.get('connections'), (c) -> c.can_index
canIndexUser = block.get('user')?.can_index
res.render 'index',
block: block
comments: comments
md: markdown
canIndex: canIndexUser && canIndexConnections
tab: req.params.tab || 'info'
connections: block.connections()
.catch next
.done()
| Q = require 'bluebird-q'
Channel = require "../../models/channel"
Block = require "../../models/block"
Comments = require "../../collections/comments"
User = require "../../models/user"
markdown = require '../../lib/markdown'
sd = require("sharify").data
_ = require 'underscore'
@block = (req, res, next) ->
block = new Block id: req.params.block_id
comments = new Comments [], block: block
Q.all [
block.fetch data: auth_token: req.user?.get('authentication_token')
comments.fetch(data: auth_token: req.user?.get('authentication_token')) if req.user?.has('username')
]
.then ->
res.locals.sd.BLOCK = block.toJSON()
res.locals.sd.COMMENTS = comments.toJSON()
res.locals.sd.CURRENT_ACTION = 'block'
canIndexConnections = _.all block.get('connections'), (c) -> c.user?.can_index
canIndexUser = block.get('user')?.can_index
res.render 'index',
block: block
comments: comments
md: markdown
canIndex: canIndexUser && canIndexConnections
tab: req.params.tab || 'info'
connections: block.connections()
.catch next
.done()
| Check for can_index on the user, not the connection | Check for can_index on the user, not the connection
| CoffeeScript | mit | aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell |
2bb708153d67765f3d34b8cdbf455aa43fe2a7bf | src/cli/argv.coffee | src/cli/argv.coffee | parser = require 'nomnom'
braveMouse = require '../brave-mouse'
module.exports = (argv) ->
parser
.script 'brave-mouse'
.parse argv.slice 2
| parser = require 'nomnom'
braveMouse = require '../brave-mouse'
braveMousePackageJson = require '../../package.json'
module.exports = (argv) ->
opts = parser
.script 'brave-mouse'
.options
version:
abbr: 'v'
flag: true
help: 'Print brave-mouse’s version'
.parse argv.slice 2
if opts.version
return console.log 'v' + braveMousePackageJson.version
| Print version on ‘brave-mouse -v’ | Print version on ‘brave-mouse -v’
| CoffeeScript | bsd-2-clause | SonicHedgehog/brave-mouse |
207923f1615ef8fe5ac59def2537f16edf856f1d | backend/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee | backend/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee | # variant autocompletion
$(document).ready ->
if $("#variant_autocomplete_template").length > 0
window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text())
window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text())
window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text())
return
formatVariantResult = (variant) ->
variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
variantTemplate variant: variant
$.fn.variantAutocomplete = ->
@select2
placeholder: Spree.translations.variant_placeholder
minimumInputLength: 3
initSelection: (element, callback) ->
$.get Spree.routes.variants_search + "/" + element.val(), {}, (data) ->
callback data
ajax:
url: Spree.url(Spree.routes.variants_api)
quietMillis: 200
datatype: "json"
data: (term, page) ->
q:
product_name_or_sku_cont: term
token: Spree.api_key
results: (data, page) ->
window.variants = data["variants"]
results: data["variants"]
formatResult: formatVariantResult
formatSelection: (variant) ->
if !!variant.options_text
variant.name + " (#{variant.options_text})"
else
variant.name
| # variant autocompletion
$(document).ready ->
if $("#variant_autocomplete_template").length > 0
window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text())
window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text())
window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text())
return
formatVariantResult = (variant) ->
variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
variantTemplate variant: variant
$.fn.variantAutocomplete = ->
@select2
placeholder: Spree.translations.variant_placeholder
minimumInputLength: 3
initSelection: (element, callback) ->
$.get Spree.routes.variants_api + "/" + element.val(), { token: Spree.api_key }, (data) ->
callback data
ajax:
url: Spree.url(Spree.routes.variants_api)
quietMillis: 200
datatype: "json"
data: (term, page) ->
q:
product_name_or_sku_cont: term
token: Spree.api_key
results: (data, page) ->
window.variants = data["variants"]
results: data["variants"]
formatResult: formatVariantResult
formatSelection: (variant) ->
if !!variant.options_text
variant.name + " (#{variant.options_text})"
else
variant.name
| Fix initSelection of variant autocomplete. | Fix initSelection of variant autocomplete.
Fixes #6631
| CoffeeScript | bsd-3-clause | yushine/spree,yushine/spree,yushine/spree,yushine/spree |
e979f326e54a5c256d2b11d8df498d8a28c306e0 | app/assets/javascripts/ng-modules/ng-app.js.coffee | app/assets/javascripts/ng-modules/ng-app.js.coffee | ########################################################
# AngularJS main application file
########################################################
module = angular.module 'feedbunch', ['infinite-scroll', 'ngSanitize', 'ngTouch']
module.config ["$httpProvider", ($httpProvider)->
# Configure $http service to send the CSRF-prevention token, otherwise POST, DELETE etc requests will be rejected
$httpProvider.defaults.headers.common['X-CSRF-Token'] = $('meta[name=csrf-token]').attr('content')
# Redirect user to /login if any AJAX request is responded with a 401 status (unauthorized).
# Otherwise pass on errors to the individual error handler callback.
$httpProvider.interceptors.push ['$window', '$q', ($window, $q)->
'responseError': (rejection)->
if rejection.status == 401
$window.location.href = '/login'
else
return $q.reject rejection
]
]
module.config ["$compileProvider", ($compileProvider)->
#alert $compileProvider.imgSrcSanitizationWhitelist()
] | ########################################################
# AngularJS main application file
########################################################
module = angular.module 'feedbunch', ['infinite-scroll', 'ngSanitize', 'ngTouch']
module.config ["$httpProvider", ($httpProvider)->
# Configure $http service to send the CSRF-prevention token, otherwise POST, DELETE etc requests will be rejected
$httpProvider.defaults.headers.common['X-CSRF-Token'] = $('meta[name=csrf-token]').attr('content')
# Redirect user to /login if any AJAX request is responded with a 401 status (unauthorized).
# Otherwise pass on errors to the individual error handler callback.
$httpProvider.interceptors.push ['$window', '$q', ($window, $q)->
'responseError': (rejection)->
if rejection.status == 401
$window.location.href = '/login'
else
return $q.reject rejection
]
] | Revert "WIP: add data-src attribute to attributes whitelist in angularJS html sanitization." | Revert "WIP: add data-src attribute to attributes whitelist in angularJS html sanitization."
This reverts commit 962d28f193803a85327188f2cb47ad762b615325.
| CoffeeScript | mit | amatriain/feedbunch,jmwenda/feedbunch,jmwenda/feedbunch,amatriain/feedbunch,amatriain/feedbunch,amatriain/feedbunch,jmwenda/feedbunch |
9b8f7cdac58af24b823fbdcbbd3a1d87c3d0dc4a | atom/.atom/config.cson | atom/.atom/config.cson | "*":
"autocomplete-plus": {}
core:
autoHideMenuBar: true
editor:
fontFamily: "Hasklig"
invisibles:
eol: " "
space: " "
scrollPastEnd: true
showIndentGuide: true
showInvisibles: true
softWrap: true
zoomFontWhenCtrlScrolling: false
"exception-reporting":
userId: "01c5d91d-38f2-dfb7-3a4c-12341a62271e"
"file-icons":
coloured: false
"find-and-replace": {}
"line-ending-selector": {}
linter:
errorPanelHeight: 263
showErrorPanel: false
"linter-rubocop":
command: "/home/alex/.gem/ruby/2.2.0/bin/rubocop"
"markdown-preview":
useGitHubStyle: true
"spell-check": {}
"status-bar": {}
tabs: {}
"tree-view":
squashDirectoryNames: true
welcome:
showOnStartup: false
| "*":
"atom-beautify":
_analyticsUserId: "a2516150-332e-464a-9a4d-531203fa7735"
"autocomplete-plus": {}
"autohide-tree-view":
hideDelay: 0
showDelay: 0
core:
autoHideMenuBar: true
editor:
fontFamily: "Hasklig"
invisibles:
eol: " "
space: " "
scrollPastEnd: true
showIndentGuide: true
showInvisibles: true
softWrap: true
zoomFontWhenCtrlScrolling: false
"exception-reporting":
userId: "01c5d91d-38f2-dfb7-3a4c-12341a62271e"
"file-icons":
coloured: false
"find-and-replace": {}
"gulp-control": {}
"line-ending-selector": {}
linter:
errorPanelHeight: 263
showErrorPanel: false
"linter-rubocop":
command: "/home/alex/.gem/ruby/2.2.0/bin/rubocop"
"markdown-preview":
useGitHubStyle: true
pigments: {}
"spell-check": {}
"status-bar": {}
tabs: {}
"tree-view": {}
welcome:
showOnStartup: false
| Add hide tree view plugin | Add hide tree view plugin
| CoffeeScript | mit | Alexendoo/dotfiles |
29718d47af0afd4c6fbcefdc5cf092e702e0455c | app/assets/javascripts/shipit.js.coffee | app/assets/javascripts/shipit.js.coffee | # This is a manifest file that'll be compiled into application.js, which will include all the files
# listed below.
#
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
#
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
# compiled file.
#
# Read Sprockets README (https:#github.com/sstephenson/sprockets#sprockets-directives) for details
# about supported directives.
#
#= require jquery
#= require jquery_ujs
#= require rails-timeago
#= require_tree ./shipit
#= require_self
$(document).on 'click', 'a.disabled', (event) ->
event.preventDefault()
jQuery ->
$notificationNotice = $('.notifications')
if $.notifyCheck() == $.NOTIFY_NOT_ALLOWED
$button = $notificationNotice.find('button')
$button.on 'click', ->
$.notifyRequest()
$notificationNotice.addClass('hidden')
$notificationNotice.removeClass('hidden')
| # This is a manifest file that'll be compiled into application.js, which will include all the files
# listed below.
#
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
#
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
# compiled file.
#
# Read Sprockets README (https:#github.com/sstephenson/sprockets#sprockets-directives) for details
# about supported directives.
#
#= require jquery
#= require jquery_ujs
#= require rails-timeago
#= require jquery-notify
#= require_tree ./shipit
#= require_self
$(document).on 'click', 'a.disabled', (event) ->
event.preventDefault()
jQuery ->
$notificationNotice = $('.notifications')
if $.notifyCheck() == $.NOTIFY_NOT_ALLOWED
$button = $notificationNotice.find('button')
$button.on 'click', ->
$.notifyRequest()
$notificationNotice.addClass('hidden')
$notificationNotice.removeClass('hidden')
| Revert "Revert "Add jQuery notify back in"" | Revert "Revert "Add jQuery notify back in""
This reverts commit b62a0177c8e3c89a0b1f86e600e20461796f7a81.
Sorry for the mess. This was working already on master. My mistake
| CoffeeScript | mit | Shopify/shipit-engine,Shopify/shipit-engine,ershad/shipit-engine,Shopify/shipit-engine,ershad/shipit-engine,ershad/shipit-engine,ershad/shipit-engine,perobertson/shipit-engine,Shopify/shipit-engine,perobertson/shipit-engine,perobertson/shipit-engine,perobertson/shipit-engine,perobertson/shipit-engine,Shopify/shipit-engine,ershad/shipit-engine |
b28a35e4281ea1d4b88864ac441523133ad63949 | src/scripts/helpers/handlers/analytics.coffee | src/scripts/helpers/handlers/analytics.coffee | define (require) ->
Backbone = require('backbone')
settings = require('settings')
# Class to handle loading analytics scripts and wrapping
# handlers around them so that modules don't have to
# interact with global variables directly
return new class AnalyticsHandler
constructor: () ->
# Setup temporary analytics.js objects
# window.GoogleAnalyticsObject = 'ga'
# window.ga = () -> (window.ga.q ?= []).push(arguments)
# window.ga.l = 1 * new Date()
# Initialize analytics.js account
# window.ga('create', settings.analyticsID, 'auto')
# ## Setup ga.js
window._gaq ?= []
window._gaq.push(['_setAccount', settings.analyticsID])
# Asynchronously load analytics.js.
# require(['https://www.google-analytics.com/analytics.js'])
# Asynchronously load ga.js
require(['https://www.google-analytics.com/ga.js'])
# Wrapper functions to add analytics events
# ga: () -> window.ga?.apply(@, arguments) # analytics.js
gaq: () -> window._gaq?.push(arguments[0]) # ga.js
# Send the current page to every analytics service
send: () ->
fragment = Backbone.history.fragment
if not /^\//.test(fragment) then fragment = '/' + fragment
# @ga('send', 'pageview')
@gaq(['_trackPageview', fragment])
| define (require) ->
Backbone = require('backbone')
settings = require('settings')
# Class to handle loading analytics scripts and wrapping
# handlers around them so that modules don't have to
# interact with global variables directly
return new class AnalyticsHandler
constructor: () ->
# Setup temporary analytics.js objects
# window.GoogleAnalyticsObject = 'ga'
# window.ga = () -> (window.ga.q ?= []).push(arguments)
# window.ga.l = 1 * new Date()
# Initialize analytics.js account
# window.ga('create', settings.analyticsID, 'auto')
# ## Setup ga.js
window._gaq ?= []
# Asynchronously load analytics.js.
# require(['https://www.google-analytics.com/analytics.js'])
# Asynchronously load ga.js
require(['https://www.google-analytics.com/ga.js'])
# Wrapper functions to add analytics events
# ga: () -> window.ga?.apply(@, arguments) # analytics.js
gaq: () -> window._gaq?.push(arguments[0]) # ga.js
# Send the current page to every analytics service
send: (account) ->
fragment = Backbone.history.fragment
if not /^\//.test(fragment) then fragment = '/' + fragment
# Use the default analytics ID in settings if no account is specified
account ?= settings.analyticsID
# @ga('send', 'pageview')
@gaq(['_trackPageview', fragment])
@gaq.push(['_setAccount', account], ['_trackPageview'])
| Add support for tracking multiple GA accounts | Add support for tracking multiple GA accounts
| CoffeeScript | agpl-3.0 | Connexions/webview,dak/webview,Connexions/webview,katalysteducation/webview,katalysteducation/webview,dak/webview,Connexions/webview,carolinelane10/webview,katalysteducation/webview,katalysteducation/webview,Connexions/webview,dak/webview |
7042782f8779ce9558c9d0314f1156f11a0fabe7 | components/inquiry_questionnaire/views/step.coffee | components/inquiry_questionnaire/views/step.coffee | _ = require 'underscore'
Backbone = require 'backbone'
form = require '../../form/utilities.coffee'
module.exports = class StepView extends Backbone.View
__events__: null
events: ->
_.extend @__events__,
'click .js-nevermind': 'dismiss'
initialize: ({ @user, @inquiry, @artwork, @state }) ->
@__setup__()
template: ->
throw new Error 'no template provided'
next: (e) ->
e?.preventDefault()
@state.next()
dismiss: (e) ->
e.preventDefault()
@state.trigger 'abort'
autofocus: -> _.defer =>
$input = form.firstVisibleInput @$el
form.autofocus $input
setup: -> #
__setup__: ->
return if @__isSetup__
@setup()
@__isSetup__ = true
render: ->
@$el.html @template
user: @user
inquiry: @inquiry
artwork: @artwork
state: @state
@postRender()
@autofocus()
this
postRender: -> #
| _ = require 'underscore'
Backbone = require 'backbone'
form = require '../../form/utilities.coffee'
module.exports = class StepView extends Backbone.View
__events__: null
events: ->
_.extend @__events__,
'click .js-nevermind': 'dismiss'
initialize: ({ @user, @inquiry, @artwork, @state }) ->
@__setup__()
template: ->
throw new Error 'no template provided'
next: (e) ->
e?.preventDefault()
@state.next()
dismiss: (e) ->
e.preventDefault()
@state.trigger 'abort'
shouldAutofocus: true
autofocus: ->
return unless @shouldAutofocus
$input = form.firstVisibleInput @$el
form.autofocus $input, true
setup: -> #
__setup__: ->
return if @__isSetup__
@setup()
@__isSetup__ = true
render: ->
@$el.html @template
user: @user
inquiry: @inquiry
artwork: @artwork
state: @state
@postRender()
@autofocus()
this
postRender: -> #
| Allow for turning off autofocusing; use defer option | Allow for turning off autofocusing; use defer option
| CoffeeScript | mit | yuki24/force,mzikherman/force,erikdstock/force,kanaabe/force,erikdstock/force,yuki24/force,joeyAghion/force,mzikherman/force,kanaabe/force,xtina-starr/force,izakp/force,oxaudo/force,joeyAghion/force,oxaudo/force,artsy/force,kanaabe/force,erikdstock/force,oxaudo/force,eessex/force,yuki24/force,artsy/force-public,anandaroop/force,joeyAghion/force,dblock/force,joeyAghion/force,eessex/force,cavvia/force-1,oxaudo/force,erikdstock/force,damassi/force,cavvia/force-1,damassi/force,yuki24/force,artsy/force,xtina-starr/force,anandaroop/force,artsy/force,izakp/force,cavvia/force-1,mzikherman/force,izakp/force,kanaabe/force,eessex/force,dblock/force,artsy/force-public,izakp/force,damassi/force,xtina-starr/force,damassi/force,kanaabe/force,cavvia/force-1,mzikherman/force,xtina-starr/force,eessex/force,anandaroop/force,anandaroop/force,dblock/force,artsy/force |
fed74f75a51763b55c7766b04a7dd2860e0cc42e | app/assets/javascripts/views/journal_index_view.js.coffee | app/assets/javascripts/views/journal_index_view.js.coffee | ETahi.JournalIndexView = Ember.View.extend
toggleSpinner: (->
if @get('controller.epubCoverUploading')
@spinnerDiv = @$('#epub-cover-spinner')[0]
@spinner ||= new Spinner(color: "#aaa").spin(@spinnerDiv)
$(@spinnerDiv).show()
else
$(@spinnerDiv).hide()
).observes('controller.epubCoverUploading')
| ETahi.JournalIndexView = Ember.View.extend ETahi.SpinnerMixin,
toggleSpinner: (->
@createSpinner('controller.epubCoverUploading', '#epub-cover-spinner', color: '#aaa')
).observes('controller.epubCoverUploading').on('didInsertElement')
| Use createSpinner on journal index. | Use createSpinner on journal index.
| CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi |
7b1484bde227911145acad81e092aac5154c7e84 | app/assets/javascripts/replace_self_on_load.js.coffee | app/assets/javascripts/replace_self_on_load.js.coffee | RunLoop.register ->
for el in $('[data-replace-self-on-load]')
url = $(el).data('replace-self-on-load')
$(el).removeAttr('data-replace-self-on-load').trigger('replace:success')
window.fetchAndReplace(el, url)
| RunLoop.register ->
for el in $('[data-replace-self-on-load]')
url = $(el).data('replace-self-on-load')
window.fetchAndReplace el, url, (newEl) =>
$(newEl).trigger('replace:success')
| Fix replace self on load function | Fix replace self on load function
It will now trigger the replace:success event only after the new
new content is loaded.
| CoffeeScript | mit | RobinClowers/photo-album,RobinClowers/photo-album,RobinClowers/photo-album,RobinClowers/photo-album |
c533835365c9186559f302d1ee59e6a15f202efd | test/integration/setup_teardown.coffee | test/integration/setup_teardown.coffee | require './setup_teardown'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
cleaner.clear_and_set_fixtures ->
console.log "Cleared and set fixtures"
wd40.init ->
browser.get login_url, done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
# done() | require './setup_teardown'
{parallel} = require 'async'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
parallel [
(cb) ->
cleaner.clear_and_set_fixtures ->
cb()
(cb) ->
wd40.init ->
browser.get base_url, ->
cb()
], done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
| Initialize browser and database in parallel | Initialize browser and database in parallel
| CoffeeScript | agpl-3.0 | scraperwiki/custard,scraperwiki/custard,scraperwiki/custard |
f96a9b25b7d9077ab8cda34e47fc5a4de132bfef | scripts/boomtown.coffee | scripts/boomtown.coffee | # Description
# Trys to crash Hubot on purpose
#
# Commands:
# hubot boom [other text]- try to crash Hubot
# hubot boom emit with msg - try to crash Hubot by emitting an error with a msg
# hubot boom emit without msg - try to crash Hubot by emitting an error without a msg
boomError = (boom, string) ->
new Error "Trying to #{boom} because you told me to #{string}"
module.exports = (robot) ->
robot.respond /(boo+m)(?: (emit with(?:out)? msg|timeout|throw))?/i, (msg) ->
boom = msg.match[1]
how = msg.match[2]
err = boomError(boom, how)
switch msg.match[1]
when 'emit with msg'
robot.emit 'error', boomError(boom, how), msg
when 'emit without msg'
robot.emit 'error', boomError(boom, how)
when 'timeout'
setTimeout (->
throw boomError(boom, how)
), 0
else
throw boomError(boom, how)
| # Description
# Trys to crash Hubot on purpose
#
# Commands:
# hubot boom [other text]- try to crash Hubot
# hubot boom emit with msg - try to crash Hubot by emitting an error with a msg
# hubot boom emit without msg - try to crash Hubot by emitting an error without a msg
boomError = (boom, string) ->
new Error "Trying to #{boom} because you told me to #{string}"
module.exports = (robot) ->
robot.respond /(boo+m)(?: (emit with(?:out)? msg|timeout|throw))?/i, (msg) ->
boom = msg.match[1]
how = msg.match[2]
err = boomError(boom, how)
switch msg.match[1]
when 'emit with msg'
robot.emit 'error', boomError(boom, how), msg
when 'emit without msg'
robot.emit 'error', boomError(boom, how)
when 'timeout'
setTimeout (->
throw boomError(boom, how)
), 0
else
throw boomError(boom, how)
robot.error (err, msg) ->
robot.logger.error "BOOM"
if msg?
msg.reply "BOOM"
| Add an error handler for testing | Add an error handler for testing
| CoffeeScript | mit | chadfurman/hubot,edorsey/hubot,github/hubot,hotrannam/hubot,voltsdigital/hubot,geoffreyanderson/hubot,jianchen2580/hubot,alex-zhang/hubot,keyvanakbary/hubot,cameronmcefee/hubot,rlugojr/hubot,ouadie-lahdioui/hubot,lisb/hubot,Hartmarken/hubot,PropertyUX/nubot,mjurczyk/hubot,scboucher/hubot,lukw00/hubot,msound/hubot,ddmng/brazil82-hubot,RavenB/hubot,taojuntjpp/hubot,plated/hubot,kkirsche/hubot,mcanthony/hubot,ajschex/hubot,aslihandincer/hubot,rmdelo/appboy-hubot,RiddickSky/hubot,decaffeinate-examples/hubot,tiagochiavericosta/hubot,minted/hubot,mutewinter/hubot,hubotio/hubot,eshamow/gutterbot,yujiroarai/hws-hubot,WaleedAshraf/hubot,brodul/hubot,GrimDerp/hubot,ajayanandgit/hubot,CobyR/hubot,sdimkov/hubot,dopeboy/hubot,alucardzhou/hubot,bgranberry/hubot,ooohiroyukiooo/hubot,iDTLabssl/hubot,makii42/hubot,howprice/hubot,PropertyUX/nubot,pchaigno/hubot,krahman/hubot,jasonrhodes/botzero,kgrz/hubot,Drooids/hubot,julianromera/hubot,Snorlock/hubot,daudich/hubot,nandub/hubot,zvelo/hubot,craig5/hubot,vkhang55/hubot,rafaell-lycan/Hubot-X9,decaffeinate-examples/hubot,Mattlk13/Hubot,scboucher/hubot,jasonkarns/hubot,leohmoraes/hubot,wieden-kennedy/hubot,sharabash/hubot,melexis/melexis-hubot,joshsobota/hubot,fstehle/hubot,codydaig/hubot,hubotio/hubot,mujiansu/hubot,ykelvis/hubot,blackwellops/hubot,jschell/hubot,mrb/hubot,gregkare/hubot,b3nj4m/hubot,shinvdu/hubot,bradparks/hubot__github_chat_bot,AlexandrPuryshev/hubot,michaelansel/hubot,hcxiong/hubot,doudoupower/hubot,danielcompton/hubot,fgbreel/hubot,kristenmills/hubot,nandub/hubot,lisb/hubot,awbauer/hubot,cycomachead/hubot,ClaudeBot/hubot,github/hubot,davidkassa/hubot,mchill/hubot,Arthraim/merlin,limianwang/hubot,mauricionr/hubot,poppingtonic/hubot,skcript/skubot,eetuuuu/hubot,ykusumi/test-hubot,wyncode/hubot,lisb/hubot |
c8b34ffe6f40e8334fff5b82cd68a8be1b213a50 | components/LoggingMiddleware.coffee | components/LoggingMiddleware.coffee | noflo = require 'noflo'
debugAction = require('debug') 'noflo-ui:action'
debugActionFull = require('debug') 'noflo-ui:action:full'
sendEvent = (label, action = 'click', category = 'menu') ->
return unless typeof window.ga is 'function'
window.ga 'send', 'event', category, action, label
exports.getComponent = ->
c = new noflo.Component
c.inPorts.add 'in',
datatype: 'all'
c.outPorts.add 'pass',
datatype: 'all'
noflo.helpers.WirePattern c,
in: 'in'
out: 'pass'
forwardGroups: true
async: true
, (data, groups, out, callback) ->
action = groups.join ':'
debugAction action
debugActionFull action, data.payload
switch action
when 'user:login'
sendEvent 'userLogin'
when 'user:logout'
sendEvent 'userLogout'
when 'github:open'
sendEvent 'pullGithub', 'navigation', 'url'
when 'gist:open'
sendEvent 'pullGist', 'navigation', 'url'
when 'main:open'
sendEvent 'openHome', 'navigation', 'url'
out.send data
do callback
| noflo = require 'noflo'
debugAction = require('debug') 'noflo-ui:action'
debugActionFull = require('debug') 'noflo-ui:action:full'
sendEvent = (label, action = 'click', category = 'menu') ->
return unless typeof window.ga is 'function'
window.ga 'send', 'event', category, action, label
exports.getComponent = ->
c = new noflo.Component
c.inPorts.add 'in',
datatype: 'all'
c.outPorts.add 'pass',
datatype: 'all'
noflo.helpers.WirePattern c,
in: 'in'
out: 'pass'
forwardGroups: true
async: true
, (data, groups, out, callback) ->
action = data.action
debugAction action
debugActionFull action, data.payload
switch action
when 'user:login'
sendEvent 'userLogin'
when 'user:logout'
sendEvent 'userLogout'
when 'github:open'
sendEvent 'pullGithub', 'navigation', 'url'
when 'gist:open'
sendEvent 'pullGist', 'navigation', 'url'
when 'main:open'
sendEvent 'openHome', 'navigation', 'url'
out.send data
do callback
| Read action from correct location | Read action from correct location
| CoffeeScript | mit | noflo/noflo-ui,noflo/noflo-ui |
46f71c858138c40daf4b4a9848f5104d7b6d0f4b | app/src/controllers/onboarding/device/onboarding_device_pin_view_controller.coffee | app/src/controllers/onboarding/device/onboarding_device_pin_view_controller.coffee | class @OnboardingDevicePinViewController extends @OnboardingViewController
onAfterRender: ->
super
do @_insertPinCode
_insertPinCode: ->
@view.pinCode = new ledger.pin_codes.PinCode()
@view.pinCode.insertIn(@select('div#pin_container')[0])
@view.pinCode.setStealsFocus(yes)
@view.pinCode.once 'complete', (event, value) =>
ledger.app.wallet.unlockWithPinCode value, (success, error) =>
{retryCount} = error
if success == yes
ledger.app.router.go '/onboarding/device/opening'
else if retryCount > 0
ledger.app.router.go '/onboarding/device/wrongpin', {tries_left: retryCount}
else
ledger.app.router.go '/onboarding/device/frozen'
openSupport: ->
window.open t 'application.support_url' | class @OnboardingDevicePinViewController extends @OnboardingViewController
onAfterRender: ->
super
do @_insertPinCode
_insertPinCode: ->
@view.pinCode = new ledger.pin_codes.PinCode()
@view.pinCode.insertIn(@select('div#pin_container')[0])
@view.pinCode.setStealsFocus(yes)
@view.pinCode.once 'complete', (event, value) =>
ledger.app.wallet.unlockWithPinCode value, (success, error) =>
if success == yes
ledger.app.router.go '/onboarding/device/opening'
else if error.code == ledger.errors.WrongPinCode and error['retryCount'] > 0
ledger.app.router.go '/onboarding/device/wrongpin', {tries_left: error['retryCount']}
else if error.code == ledger.errors.NotSupportedDongle
ledger.app.router.go '/onboarding/device/frozen'
else
ledger.app.router.go '/onboarding/device/frozen'
openSupport: ->
window.open t 'application.support_url' | Add NotSupportedDongle in error case of pin view controller | Add NotSupportedDongle in error case of pin view controller
| CoffeeScript | mit | Morveus/ledger-wallet-doge-chrome,LedgerHQ/ledger-wallet-chrome,Morveus/ledger-wallet-doge-chrome,LedgerHQ/ledger-wallet-chrome |
e9f7043b83bb1e1640b36d79a6e37ee793193aae | app/assets/javascripts/langtrainer_frontend_backbone/views/navbar_control.js.coffee | app/assets/javascripts/langtrainer_frontend_backbone/views/navbar_control.js.coffee | class Langtrainer.LangtrainerApp.Views.NavbarControl extends Backbone.View
template: JST['langtrainer_frontend_backbone/templates/navbar_control']
className: 'navbar-user-controls'
events:
'click .sign-in-btn': 'onSignInBtnClick'
'click .sign-up-btn': 'onSignUpBtnClick'
'click .sign-out-btn': 'onSignOutBtnClick'
initialize: ->
Langtrainer.LangtrainerApp.globalBus.on 'user:signedUp user:signedIn user:signedOut', @render, @
render: ->
@$el.hide().html(@template()).fadeIn()
@
onSignInBtnClick: ->
Langtrainer.LangtrainerApp.navigateToSignIn()
false
onSignUpBtnClick: ->
Langtrainer.LangtrainerApp.navigateToSignUp()
false
onSignOutBtnClick: ->
Langtrainer.LangtrainerApp.currentUser.signOut()
false
| class Langtrainer.LangtrainerApp.Views.NavbarControl extends Backbone.View
template: JST['langtrainer_frontend_backbone/templates/navbar_control']
className: 'navbar-user-controls'
events:
'click .sign-in-btn': 'onSignInBtnClick'
'click .sign-up-btn': 'onSignUpBtnClick'
'click .sign-out-btn': 'onSignOutBtnClick'
initialize: ->
Langtrainer.LangtrainerApp.globalBus.on 'user:signedUp user:signedIn user:signedOut', @render, @
render: ->
@$el.html(@template())
@
onSignInBtnClick: ->
Langtrainer.LangtrainerApp.navigateToSignIn()
false
onSignUpBtnClick: ->
Langtrainer.LangtrainerApp.navigateToSignUp()
false
onSignOutBtnClick: ->
Langtrainer.LangtrainerApp.currentUser.signOut()
false
| Remove fade in of navbar control | Remove fade in of navbar control
| CoffeeScript | mit | langtrainer/langtrainer_frontend_backbone,langtrainer/langtrainer_frontend_backbone,langtrainer/langtrainer_frontend_backbone |
b19a24681362dc3ebc15d9da18ed3b097b70e21b | core/app/backbone/collections/followers.coffee | core/app/backbone/collections/followers.coffee | class window.Followers extends Backbone.Collection
model: User
initialize: (models, opts) ->
@user = opts.user
url: -> "/#{@user.get('username')}/followers"
followed_by_me: ->
!! @find (model) ->
model.get('username') == currentUser.get('username')
class window.Following extends Backbone.Collection
model: User
initialize: (models, opts) ->
@user = opts.user
url: -> "/#{@user.get('username')}/following"
| class window.Followers extends Backbone.Collection
model: User
initialize: (models, opts) ->
@user = opts.user
url: -> "/#{@user.get('username')}/followers"
followed_by_me: ->
@some (model) ->
model.get('username') == currentUser.get('username')
class window.Following extends Backbone.Collection
model: User
initialize: (models, opts) ->
@user = opts.user
url: -> "/#{@user.get('username')}/following"
| Use @some instead of @find | Use @some instead of @find
| CoffeeScript | mit | daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core |
c3c19c46e4f10abcfdb1c272651b2d7f2729ff80 | app/scripts/main.coffee | app/scripts/main.coffee | L.mapbox.accessToken = 'pk.eyJ1Ijoia25vY2siLCJhIjoiRVdjRFVjRSJ9.nIZeVnR6dJZ0hwNnKAiAlQ'
map = L.mapbox.map('map', 'examples.map-i86nkdio').
setView([40, -74.50], 9)
console.log('I did stuff')
| L.mapbox.accessToken = 'pk.eyJ1Ijoia25vY2siLCJhIjoiRVdjRFVjRSJ9.nIZeVnR6dJZ0hwNnKAiAlQ'
map = L.mapbox.map('map', 'knock.l5dpakki').
setView([47.61, -122.33], 13)
featureLayer = L.mapbox.featureLayer().addTo(map)
featureLayer.loadURL('http://zillowhack.hud.opendata.arcgis.com/datasets/2a462f6b548e4ab8bfd9b2523a3db4e2_0.geojson?where=FORMAL_PARTICIPANT_NAME%20like%20\'%25Seattle%20Housing%20Authority%25\'&geometry={"xmin":-13644455.898275688,"ymin":6030489.247026406,"xmax":-13589421.237910435,"ymax":6053382.136997785,"spatialReference":{"wkid":102100}}')
| Move map loading into app. | Move map loading into app.
| CoffeeScript | mit | harleyholt/hackhousing.knockX2,harleyholt/hackhousing.knockX2 |
21c2b0a43c6cf5d58a53895b46c2516c14f65a39 | app/assets/javascripts/home.js.coffee | app/assets/javascripts/home.js.coffee | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$("[data-toggle=tab]").click ->
$($(this).attr("href")).toggleClass "active" if $(this).parent().hasClass("active")
| # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$("[data-toggle=tab]").click ->
$($(this).attr("href")).toggleClass "active" if $(this).parent().hasClass("active")
$ ->
$('select').change (e) ->
oldClass = $('.profile-image').attr('class').split(' ').pop()
$('.profile-image').removeClass(oldClass).addClass e.target.value
| Update UI behavior on User's profile card to update color using selected role | Update UI behavior on User's profile card to update color using selected role
| CoffeeScript | mit | SoPR/sopr-platform,SoPR/sopr-platform |
4846adf04969911185f04c7df276c75b159a3188 | backend/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee | backend/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee | # variant autocompletion
$(document).ready ->
if $("#variant_autocomplete_template").length > 0
window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text())
window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text())
window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text())
return
formatVariantResult = (variant) ->
variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
variantTemplate variant: variant
$.fn.variantAutocomplete = ->
@select2
placeholder: Spree.translations.variant_placeholder
minimumInputLength: 3
initSelection: (element, callback) ->
$.get Spree.routes.variants_search + "/" + element.val(), {}, (data) ->
callback data
ajax:
url: Spree.url(Spree.routes.variants_api)
datatype: "json"
data: (term, page) ->
q:
product_name_or_sku_cont: term
token: Spree.api_key
results: (data, page) ->
window.variants = data["variants"]
results: data["variants"]
formatResult: formatVariantResult
formatSelection: (variant) ->
if !!variant.options_text
variant.name + " (#{variant.options_text})"
else
variant.name
| # variant autocompletion
$(document).ready ->
if $("#variant_autocomplete_template").length > 0
window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text())
window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text())
window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text())
return
formatVariantResult = (variant) ->
variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
variantTemplate variant: variant
$.fn.variantAutocomplete = ->
@select2
placeholder: Spree.translations.variant_placeholder
minimumInputLength: 3
initSelection: (element, callback) ->
$.get Spree.routes.variants_search + "/" + element.val(), {}, (data) ->
callback data
ajax:
url: Spree.url(Spree.routes.variants_api)
quietMillis: 200
datatype: "json"
data: (term, page) ->
q:
product_name_or_sku_cont: term
token: Spree.api_key
results: (data, page) ->
window.variants = data["variants"]
results: data["variants"]
formatResult: formatVariantResult
formatSelection: (variant) ->
if !!variant.options_text
variant.name + " (#{variant.options_text})"
else
variant.name
| Reduce number of AJAX calls in variant autocomplete. | Reduce number of AJAX calls in variant autocomplete.
Fixes #6338
Fixes #5667
| CoffeeScript | bsd-3-clause | keatonrow/spree,keatonrow/spree,keatonrow/spree,azclick/spree,azclick/spree,azclick/spree,azclick/spree,keatonrow/spree |
cace8f191cd191ae7408d8583e98cd6611aaab0f | src/models/claim.coffee | src/models/claim.coffee | {log, p, pjson} = require 'lightsaber'
Promise = require 'bluebird'
trustExchange = require './trustExchange'
class Claim
@put: (trustAtom) ->
results = for adaptor in trustExchange.adaptors()
adaptor.putClaim trustAtom
Promise.all results
module.exports = Claim
| {log, p, pjson} = require 'lightsaber'
Promise = require 'bluebird'
trustExchange = require './trustExchange'
class Claim
@put: (trustAtom, options) ->
results = for adaptor in trustExchange.adaptors()
adaptor.putClaim trustAtom, options
Promise.all results
module.exports = Claim
| Fix Claim.put to allow options | Fix Claim.put to allow options
| CoffeeScript | mit | citizencode/trust-exchange |
5ec2dda235129db97a50428f738caf816f81c06f | app/src/controllers/onboarding/device/onboarding_device_pin_view_controller.coffee | app/src/controllers/onboarding/device/onboarding_device_pin_view_controller.coffee | class @OnboardingDevicePinViewController extends @OnboardingViewController
onAfterRender: ->
super
do @_insertPinCode
_insertPinCode: ->
@_pinCode = new ledger.pin_codes.PinCode()
@_pinCode.insertIn(@select('div.greyed-container')[0])
@_pinCode.setStealsFocus(yes)
@_pinCode.on 'complete', (event, value) ->
ledger.application.devicesManager.devices()[0].lwCard.verifyPIN(value)
openSupport: ->
window.open t 'application.support_url' | class @OnboardingDevicePinViewController extends @OnboardingViewController
onAfterRender: ->
super
do @_insertPinCode
_insertPinCode: ->
@_pinCode = new ledger.pin_codes.PinCode()
@_pinCode.insertIn(@select('div.greyed-container')[0])
@_pinCode.setStealsFocus(yes)
@_pinCode.on 'complete', (event, value) ->
openSupport: ->
window.open t 'application.support_url' | Remove old card pin verification | Remove old card pin verification
| CoffeeScript | mit | LedgerHQ/ledger-wallet-chrome,Morveus/ledger-wallet-doge-chrome,LedgerHQ/ledger-wallet-chrome,Morveus/ledger-wallet-doge-chrome |
2fa2ea533b5595b3062077b6f0501078f1642b10 | assets/scripts/app/controllers/account_index.coffee | assets/scripts/app/controllers/account_index.coffee | Travis.AccountIndexController = Em.Controller.extend
needs: ['profile', 'currentUser']
hooksBinding: 'controllers.profile.hooks'
allHooksBinding: 'controllers.profile.allHooks'
hooksWithoutAdminBinding: 'controllers.profile.hooksWithoutAdmin'
userBinding: 'controllers.currentUser'
sync: ->
@get('user').sync()
toggle: (hook) ->
hook.toggle()
| Travis.AccountIndexController = Em.Controller.extend
needs: ['profile', 'currentUser']
hooksBinding: 'controllers.profile.hooks'
allHooksBinding: 'controllers.profile.allHooks'
hooksWithoutAdminBinding: 'controllers.profile.hooksWithoutAdmin'
userBinding: 'controllers.currentUser'
sync: ->
@get('user').sync()
toggle: (hook) ->
hook.toggle()
showPrivateReposHint: (->
Travis.config.show_repos_hint == 'private'
) .property()
showPublicReposHint: (->
Travis.config.show_repos_hint == 'public'
) .property()
| Fix repository hint on accounts pages. | Fix repository hint on accounts pages.
Accounts and the profile are currently separate controllers, so
whenever you switched the account, the message would be hidden.
| CoffeeScript | mit | fotinakis/travis-web,2947721120/travis-web,jlrigau/travis-web,jlrigau/travis-web,mjlambert/travis-web,2947721120/travis-web,jlrigau/travis-web,travis-ci/travis-web,Tiger66639/travis-web,travis-ci/travis-web,Tiger66639/travis-web,mjlambert/travis-web,Tiger66639/travis-web,jlrigau/travis-web,fotinakis/travis-web,2947721120/travis-web,mjlambert/travis-web,fauxton/travis-web,fauxton/travis-web,travis-ci/travis-web,Tiger66639/travis-web,fauxton/travis-web,fauxton/travis-web,travis-ci/travis-web,mjlambert/travis-web,2947721120/travis-web,fotinakis/travis-web,fotinakis/travis-web |
86f1d6120b96bb8f2531bf006cbc5080ff313c22 | test/remind-test.coffee | test/remind-test.coffee | chai = require "chai"
sinon = require "sinon"
chai.use require "sinon-chai"
expect = chai.expect
describe "remind", ->
beforeEach ->
@robot =
respond: sinon.spy()
hear: sinon.spy()
require("../src/remind")(@robot)
it "registers a respond listener", ->
expect(@robot.respond).to.have.been.calledWith(/remind( me)? (.+)/i)
expect(@robot.respond).to.have.been.calledWith(/remind cancel/i)
expect(@robot.respond).to.have.been.calledWith(/remind( me)? now/i)
expect(@robot.respond).to.have.been.calledWith(/remind clear/i)
it "registers a hear listener", ->
expect(@robot.hear).to.have.been.calledWith(/(.+)/i)
| chai = require "chai"
sinon = require "sinon"
chai.use require "sinon-chai"
expect = chai.expect
describe "remind", ->
before ->
@robot =
brain:
on: sinon.spy()
respond: sinon.spy()
hear: sinon.spy()
require("../src/remind")(@robot)
it "registers a respond listener", ->
expect(@robot.respond).to.have.been.calledWith(/remind( me)? (.+)/i)
expect(@robot.respond).to.have.been.calledWith(/remind cancel/i)
expect(@robot.respond).to.have.been.calledWith(/remind( me)? now/i)
expect(@robot.respond).to.have.been.calledWith(/remind clear/i)
it "registers a hear listener", ->
expect(@robot.hear).to.have.been.calledWith(/(.+)/i)
it "registers a brain event listener", ->
expect(@robot.brain.on).to.have.been.calledWith("loaded") | Fix tests, and add test for brain event | Fix tests, and add test for brain event
| CoffeeScript | mit | ClaudeBot/hubot-remind-advanced,ClaudeBot/hubot-remind-advanced |
3343eca5456da80a855a8ab749558c7305299b44 | lib/views/analysis_status_view.coffee | lib/views/analysis_status_view.coffee | {View} = require 'atom'
React = require 'react-atom-fork'
{_} = require 'lodash'
{a, div, span} = require 'reactionary-atom-fork'
module.exports =
class AnalysisStatusView extends View
Object.defineProperty @::, 'analysisCount', get: -> @items.length
items: []
@content: ->
@div class: 'inline-block'
initialize: (@statusBar) =>
@subscribe atom.workspace, 'dart-tools:analysis', (result) =>
@items.push(result)
@updateState()
return null
@subscribe atom.workspace, 'dart-tools:refresh', (fullPath) =>
_.remove @items, (item) => item.fullpath == fullPath
@updateState()
return null
attach: ->
@statusBar.appendLeft(this)
afterAttach: ->
@component = React.renderComponent (StatusBar {items: @items }), @element
updateState: ->
@component.setState({ items: @items })
StatusBar = React.createClass
showAnalysis: (e) ->
atom.workspaceView.trigger('dart-tools:problems:show')
e.preventDefault()
return false
render: ->
length = @props.items.length
className = if length > 0 then 'icon icon-x' else 'icon icon-check'
statusText = if length > 0 then "#{length} problems" else 'No problems'
div {},
a { href: '#', onClick: @showAnalysis },
span className: className
span className: 'status-text', @props.items.length, " problems"
| {View} = require 'atom'
{_} = require 'lodash'
module.exports =
class AnalysisStatusView extends View
Object.defineProperty @::, 'analysisCount', get: -> @items.length
items: []
@content: ->
@div class: 'inline-block', =>
@a href: '#', click: 'showAnalysis', =>
@span class: 'dart-tools-status icon'
@span class: 'dart-tools-status-text'
initialize: (@statusBar) =>
@subscribe atom.workspace, 'dart-tools:analysis', (result) =>
@items.push(result)
@updateState()
@subscribe atom.workspace, 'dart-tools:refresh', (fullPath) =>
_.remove @items, (item) => item.location.file == fullPath
@updateState()
attach: ->
@updateState()
atom.workspaceView.statusBar?.appendLeft(this)
updateState: ->
length = @items.length
className = if length > 0 then 'icon-x' else 'icon-check'
statusText = if length > 0 then "#{length} issues" else 'No issues'
@find('.dart-tools-status')
.removeClass('icon-x icon-check')
.addClass(className)
@find('.dart-tools-status-text').text(statusText)
showAnalysis: (e) ->
atom.workspaceView.trigger('dart-tools:problems:show')
e.preventDefault()
| Clean up implementation of status view. | [REFACTOR] Clean up implementation of status view.
The previous status view was based on React and unnecessarily complex.
I've replaced it with Spacepen.
| CoffeeScript | mit | radicaled/dart-tools |
f174026d7780fed8192c4e7f66f7c987471492d4 | server/initializers/authentication.coffee | server/initializers/authentication.coffee | passport = require('passport')
BasicStrategy = require('passport-http').BasicStrategy
passport.serializeUser (user, done) ->
done(null, user._id)
passport.deserializeUser (id, done) ->
User = require('../models/user').model
User
.find(id)
.exec( (err, user) ->
if err?
console.error err
return done(err, false)
return done(null, user)
)
passport.use(
new BasicStrategy(
(username, password, done) ->
User = require('../models/user').model
User.findOne({email: username}, (err, user) ->
if err?
console.error err
return done(err, false)
if !user
return done(null, false, { message: 'Incorrect username.' })
if !user.validPassword(password)
return done(null, false, { message: 'Incorrect password.' })
return done(null, user)
)
)
)
passport.addCurrentUserToLocals = (req, res, next) ->
res.locals.currentUser = req.user
next()
module.exports = passport
| passport = require('passport')
BasicStrategy = require('passport-http').BasicStrategy
passport.serializeUser (user, done) ->
done(null, user._id)
passport.deserializeUser (id, done) ->
User = require('../models/user').model
unless id?
console.error 'No user ID supplied'
return done(err, false)
User
.findOne(_id: id)
.exec( (err, user) ->
if err?
console.error err
return done(err, false)
return done(null, user)
)
passport.use(
new BasicStrategy(
(username, password, done) ->
User = require('../models/user').model
User.findOne({email: username}, (err, user) ->
if err?
console.error err
return done(err, false)
if !user
return done(null, false, { message: 'Incorrect username.' })
if !user.validPassword(password)
return done(null, false, { message: 'Incorrect password.' })
return done(null, user)
)
)
)
passport.addCurrentUserToLocals = (req, res, next) ->
res.locals.currentUser = req.user
next()
module.exports = passport
| Fix bug where all users are returned when not authenticated | Fix bug where all users are returned when not authenticated
| CoffeeScript | bsd-3-clause | unepwcmc/NRT,unepwcmc/NRT |
f6a3b3822c7eb626ef97b5a4c83d282e23fc3f32 | client/account/lib/views/leavegroupmodal.coffee | client/account/lib/views/leavegroupmodal.coffee | kd = require 'kd'
nick = require 'app/util/nick'
kookies = require 'kookies'
DeleteModalView = require '../deletemodalview'
module.exports = class LeaveGroupModal extends DeleteModalView
constructor: (options = {}, data) ->
data = nick()
options.title = 'Please confirm'
options.buttonTitle = 'Leave Team'
options.content = """
<div class='modalformline'>
<p>
<strong>CAUTION! </strong>You are going to leave your team and you will not be able to login again. This action <strong>CANNOT</strong> be undone.
</p>
<br>
<p>Please enter <strong>#{data}</strong> into the field below to continue: </p>
</div>
"""
super options, data
doAction: ->
kd.singletons.groupsController.getCurrentGroup().leave (err)->
if err
return new KDNotificationView title : 'There was a problem, please try again!'
kookies.expire 'clientId'
global.location.replace '/'
| kd = require 'kd'
nick = require 'app/util/nick'
kookies = require 'kookies'
DeleteModalView = require '../deletemodalview'
module.exports = class LeaveGroupModal extends DeleteModalView
constructor: (options = {}, data) ->
data = nick()
options.title = 'Please confirm'
options.buttonTitle = 'Leave Team'
options.content = """
<div class='modalformline'>
<p>
<strong>CAUTION! </strong>You are going to leave your team and you will not be able to login again. This action <strong>CANNOT</strong> be undone.
</p>
<br>
<p>Please enter <strong>#{data}</strong> into the field below to continue: </p>
</div>
"""
super options, data
doAction: ->
kd.singletons.groupsController.getCurrentGroup().leave (err) =>
if err
new kd.NotificationView title : 'There was a problem, please try again!'
return @modalTabs.forms.dangerForm.buttons.confirmButton.hideLoader()
kookies.expire 'clientId'
global.location.replace '/'
| Fix require and hide loader in err case. | LeaveGroupModal: Fix require and hide loader in err case.
| CoffeeScript | agpl-3.0 | szkl/koding,alex-ionochkin/koding,acbodine/koding,drewsetski/koding,alex-ionochkin/koding,kwagdy/koding-1,jack89129/koding,kwagdy/koding-1,rjeczalik/koding,jack89129/koding,sinan/koding,usirin/koding,kwagdy/koding-1,drewsetski/koding,jack89129/koding,drewsetski/koding,gokmen/koding,alex-ionochkin/koding,kwagdy/koding-1,szkl/koding,acbodine/koding,rjeczalik/koding,gokmen/koding,rjeczalik/koding,usirin/koding,sinan/koding,usirin/koding,gokmen/koding,mertaytore/koding,andrewjcasal/koding,kwagdy/koding-1,koding/koding,koding/koding,usirin/koding,szkl/koding,gokmen/koding,acbodine/koding,cihangir/koding,acbodine/koding,usirin/koding,andrewjcasal/koding,sinan/koding,mertaytore/koding,andrewjcasal/koding,gokmen/koding,jack89129/koding,szkl/koding,sinan/koding,szkl/koding,cihangir/koding,kwagdy/koding-1,drewsetski/koding,koding/koding,cihangir/koding,mertaytore/koding,kwagdy/koding-1,koding/koding,drewsetski/koding,alex-ionochkin/koding,sinan/koding,drewsetski/koding,andrewjcasal/koding,alex-ionochkin/koding,koding/koding,andrewjcasal/koding,jack89129/koding,andrewjcasal/koding,acbodine/koding,cihangir/koding,cihangir/koding,mertaytore/koding,acbodine/koding,jack89129/koding,szkl/koding,szkl/koding,cihangir/koding,sinan/koding,koding/koding,rjeczalik/koding,alex-ionochkin/koding,drewsetski/koding,andrewjcasal/koding,kwagdy/koding-1,gokmen/koding,acbodine/koding,alex-ionochkin/koding,mertaytore/koding,usirin/koding,mertaytore/koding,usirin/koding,rjeczalik/koding,szkl/koding,rjeczalik/koding,gokmen/koding,koding/koding,alex-ionochkin/koding,jack89129/koding,cihangir/koding,andrewjcasal/koding,mertaytore/koding,cihangir/koding,usirin/koding,acbodine/koding,koding/koding,mertaytore/koding,jack89129/koding,rjeczalik/koding,sinan/koding,gokmen/koding,rjeczalik/koding,drewsetski/koding,sinan/koding |
765ed37a65d84548a57111eea674cde6da5b98aa | client/lanes/components/record-finder/RecordFinder.cjsx | client/lanes/components/record-finder/RecordFinder.cjsx | class Lanes.Components.RecordFinder extends Lanes.React.Component
propTypes:
query: Lanes.PropTypes.State.isRequired
model: Lanes.PropTypes.State.isRequired
commands: React.PropTypes.object.isRequired
contextTypes:
uistate: Lanes.PropTypes.State.isRequired
showFinder: ->
body = Lanes.u.withReactContext @context, =>
<LC.RecordFinder.Dialog query={@props.query} onRecordSelect={@props.commands.setModel} />
@context.viewport.displayModal(
body: body
title: "Find #{@props.query.title}"
buttons: [{title: 'Cancel'}]
)
loadCurrentSelection: ->
value = @props.model[@props.query.initialField.id]
@props.query.loadSingle(value).then (model) =>
@props.commands.setModel(model)
onKeyPress: (ev) ->
if "Enter" == ev.key
ev.stopPropagation()
this.loadCurrentSelection()
null
render: ->
findIcon = <button className="btn btn-primary icon icon-search icon-lg" onClick={@showFinder}/>
<LC.Input
ref="input"
{...@props}
groupClassName="record-finder"
editOnly writable
name={@props.query.initialField.id}
onKeyPress={@onKeyPress}
model={@props.model}
buttonAfter={findIcon} />
| class Lanes.Components.RecordFinder extends Lanes.React.Component
propTypes:
query: Lanes.PropTypes.State.isRequired
model: Lanes.PropTypes.State.isRequired
commands: React.PropTypes.object.isRequired
contextTypes:
viewport: Lanes.PropTypes.State.isRequired
showFinder: ->
body = Lanes.u.withReactContext @context, =>
<LC.RecordFinder.Dialog query={@props.query} onRecordSelect={@props.commands.setModel} />
@context.viewport.displayModal(
body: body
title: "Find #{@props.query.title}"
buttons: [{title: 'Cancel'}]
).then(Lanes.emptyFn, Lanes.emptyFn)
loadCurrentSelection: ->
value = @props.model[@props.query.initialField.id]
@props.query.loadSingle(value).then (model) =>
@props.commands.setModel(model)
onKeyPress: (ev) ->
if "Enter" == ev.key
ev.stopPropagation()
this.loadCurrentSelection()
null
render: ->
findIcon = <button className="btn btn-primary icon icon-search icon-lg" onClick={@showFinder}/>
<LC.Input
ref="input"
{...@props}
groupClassName="record-finder"
editOnly writable
name={@props.query.initialField.id}
onKeyPress={@onKeyPress}
model={@props.model}
buttonAfter={findIcon} />
| Set both viewport and uistate context | Set both viewport and uistate context
| CoffeeScript | mit | argosity/hippo,argosity/hippo,argosity/lanes,argosity/lanes,argosity/lanes,argosity/hippo |
e85721f71049ce180f00a79e4ab1a7c0a2f6ea55 | frontend/config/application.coffee | frontend/config/application.coffee | # Exports an object that defines
# all of the configuration needed by the projects'
# depended-on grunt tasks.
#
# You can familiarize yourself with all of Lineman's defaults by checking out the parent file:
# https://github.com/testdouble/lineman/blob/master/config/application.coffee
#
module.exports = require(process.env['LINEMAN_MAIN']).config.extend('application', {
removeTasks:
common: [ "webfonts:dev", "images:dev"]
dist: ["images:dist", "webfonts:dist", "pages:dist"]
server:
apiProxy:
enabled: true
host: 'localhost'
port: 4567
# enableSass: true
# configure lineman to load additional angular related npm tasks
loadNpmTasks: [ "grunt-ngmin"]
# task override configuration
prependTasks:
dist: ["ngmin"] # ngmin should run in dist only
watch:
scripts:
files: ["generated/**"],
tasks: ['copy:dev']
copy:
dev:
files: [expand: true, cwd: 'generated', src: ['css/**', 'js/**', '!**/spec.js',
'!**/*.less*', '!**/*.coffee*', '!**/spec.js.map'], dest: '../public' ]
# configuration for grunt-ngmin, this happens _after_ concat once, which is the ngmin ideal :)
ngmin: {
js: {
src: "<%= files.js.concatenated %>",
dest: "<%= files.js.concatenated %>"
}
},
})
| # Exports an object that defines
# all of the configuration needed by the projects'
# depended-on grunt tasks.
#
# You can familiarize yourself with all of Lineman's defaults by checking out the parent file:
# https://github.com/testdouble/lineman/blob/master/config/application.coffee
#
module.exports = require(process.env['LINEMAN_MAIN']).config.extend('application', {
removeTasks:
common: [ "webfonts:dev", "images:dev"]
dist: ["images:dist", "webfonts:dist", "pages:dist"]
server:
apiProxy:
enabled: true
host: 'localhost'
port: 4567
# enableSass: true
# configure lineman to load additional angular related npm tasks
loadNpmTasks: [ "grunt-ngmin"]
# task override configuration
prependTasks:
dist: ["ngmin"] # ngmin should run in dist only
watch:
scripts:
files: ["generated/**"],
tasks: ['copy:dev']
copy:
dev:
files: [expand: true, cwd: 'generated', src: ['css/**', 'js/**', '!**/spec.js',
'!**/*.less*', '!**/*.coffee*', '!**/spec.js.map'], dest: '../public' ]
dist:
files: [expand: true, cwd: 'dist', src: ['js/**'], dest: '../public']
# configuration for grunt-ngmin, this happens _after_ concat once, which is the ngmin ideal :)
ngmin: {
js: {
src: "<%= files.js.concatenated %>",
dest: "<%= files.js.concatenated %>"
}
},
})
| Copy JS files to public dir when building assets | Copy JS files to public dir when building assets
By default this copies to the /frontend/dist directory which meant the
uglified JS was not being served.
By default lineman runs copy:dev as part of it's common tasks
(confusingly really given it's *:dev name) which copies the non
minified version over which is how this problem didn't have more drastic
effects.
| CoffeeScript | agpl-3.0 | treiff/exercism.io,tejasbubane/exercism.io,treiff/exercism.io,treiff/exercism.io,tejasbubane/exercism.io,RaptorRCX/exercism.io,RaptorRCX/exercism.io,RaptorRCX/exercism.io,tejasbubane/exercism.io,RaptorRCX/exercism.io,treiff/exercism.io,tejasbubane/exercism.io |
c6ff23f33f261e7b8490b904adb142be97635d47 | src/components/buttons/back-button.cjsx | src/components/buttons/back-button.cjsx | React = require 'react'
BS = require 'react-bootstrap'
_ = require 'underscore'
{History, Link} = require 'react-router'
{TransitionActions, TransitionStore} = require '../../flux/transition'
BackButton = React.createClass
displayName: 'BackButton'
propTypes:
fallbackLink: React.PropTypes.shape(
to: React.PropTypes.string
params: React.PropTypes.object
text: React.PropTypes.string
).isRequired
contextTypes:
router: React.PropTypes.func
navigate: ->
historyInfo = TransitionStore.getPrevious(@context.router)
if historyInfo.path
@context.router.transitionTo(historyInfo.path)
else
@context.router.transitionTo(@props.fallbackLink.to, @props.fallbackLink.params)
render: ->
# Gets route to last path that was not the same as the current one
# See TransitionStore for more detail.
historyInfo = TransitionStore.getPrevious(@context.router)
{fallbackLink, className} = @props
{text} = fallbackLink
backText = if historyInfo.name then "Back to #{historyInfo.name}" else fallbackLink.text
<BS.Button className={className} {...@props}
onClick={@navigate}>
{backText}
</BS.Button>
module.exports = BackButton
| React = require 'react'
BS = require 'react-bootstrap'
_ = require 'underscore'
{History, Link} = require 'react-router'
{TransitionActions, TransitionStore} = require '../../flux/transition'
BackButton = React.createClass
displayName: 'BackButton'
propTypes:
fallbackLink: React.PropTypes.shape(
to: React.PropTypes.string
params: React.PropTypes.object
text: React.PropTypes.string
).isRequired
contextTypes:
router: React.PropTypes.func
render: ->
# Gets route to last path that was not the same as the current one
# See TransitionStore for more detail.
historyInfo = TransitionStore.getPrevious(@context.router)
{fallbackLink, className} = @props
{text} = fallbackLink
backText = if historyInfo.name then "Back to #{historyInfo.name}" else fallbackLink.text
href = historyInfo.path or @context.router.makeHref(
@props.fallbackLink.to, @props.fallbackLink.params
)
<BS.Button href={href} className={className} {...@props}>
{backText}
</BS.Button>
module.exports = BackButton
| Use anchor link form of button | Use anchor link form of button
This way it's a real link and can be opened in new tab
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
23c3b18cf45fac20d7118addf758804b128353ba | src/packages/spell-check/lib/spell-check-handler.coffee | src/packages/spell-check/lib/spell-check-handler.coffee | module.exports =
findMisspellings: (text) ->
wordRegex = /(?:^|\s)([a-zA-Z']+)(?=\s|\.|$)/g
row = 0
misspellings = []
for line in text.split('\n')
while matches = wordRegex.exec(line)
word = matches[1]
continue unless $native.isMisspelled(word)
startColumn = matches.index + matches[0].length - word.length
endColumn = startColumn + word.length
misspellings.push([[row, startColumn], [row, endColumn]])
row++
callTaskMethod('misspellingsFound', misspellings)
| module.exports =
findMisspellings: (text) ->
wordRegex = /(?:^|[\s\[\]])([a-zA-Z']+)(?=[\s\.\[\]]|$)/g
row = 0
misspellings = []
for line in text.split('\n')
while matches = wordRegex.exec(line)
word = matches[1]
continue unless $native.isMisspelled(word)
startColumn = matches.index + matches[0].length - word.length
endColumn = startColumn + word.length
misspellings.push([[row, startColumn], [row, endColumn]])
row++
callTaskMethod('misspellingsFound', misspellings)
| Add [] as word boundaries | Add [] as word boundaries
This is a common boundary used in markdown link text
| CoffeeScript | mit | Rodjana/atom,pengshp/atom,RobinTec/atom,Klozz/atom,nrodriguez13/atom,basarat/atom,Jandersoft/atom,bryonwinger/atom,mdumrauf/atom,mertkahyaoglu/atom,fedorov/atom,Shekharrajak/atom,chfritz/atom,pombredanne/atom,Sangaroonaom/atom,fscherwi/atom,davideg/atom,prembasumatary/atom,AdrianVovk/substance-ide,toqz/atom,jjz/atom,rlugojr/atom,jjz/atom,synaptek/atom,me6iaton/atom,jtrose2/atom,stinsonga/atom,matthewclendening/atom,bj7/atom,dkfiresky/atom,yalexx/atom,rsvip/aTom,gisenberg/atom,rxkit/atom,DiogoXRP/atom,kdheepak89/atom,matthewclendening/atom,Austen-G/BlockBuilder,ali/atom,constanzaurzua/atom,stuartquin/atom,isghe/atom,scv119/atom,targeter21/atom,AdrianVovk/substance-ide,targeter21/atom,gabrielPeart/atom,ezeoleaf/atom,ashneo76/atom,brettle/atom,lisonma/atom,dannyflax/atom,atom/atom,MjAbuz/atom,sxgao3001/atom,fang-yufeng/atom,vcarrera/atom,medovob/atom,mrodalgaard/atom,AlisaKiatkongkumthon/atom,scippio/atom,kittens/atom,AlbertoBarrago/atom,fredericksilva/atom,lisonma/atom,alfredxing/atom,mertkahyaoglu/atom,mrodalgaard/atom,kc8wxm/atom,hharchani/atom,dsandstrom/atom,Galactix/atom,splodingsocks/atom,Galactix/atom,h0dgep0dge/atom,deepfox/atom,qskycolor/atom,ReddTea/atom,codex8/atom,pombredanne/atom,ppamorim/atom,omarhuanca/atom,Klozz/atom,G-Baby/atom,Rodjana/atom,vjeux/atom,deepfox/atom,splodingsocks/atom,rjattrill/atom,transcranial/atom,gisenberg/atom,RobinTec/atom,dannyflax/atom,rjattrill/atom,sekcheong/atom,bcoe/atom,davideg/atom,daxlab/atom,Andrey-Pavlov/atom,NunoEdgarGub1/atom,gontadu/atom,helber/atom,paulcbetts/atom,bcoe/atom,tmunro/atom,vinodpanicker/atom,burodepeper/atom,hharchani/atom,wiggzz/atom,svanharmelen/atom,hpham04/atom,bryonwinger/atom,alexandergmann/atom,bcoe/atom,batjko/atom,pombredanne/atom,vinodpanicker/atom,tanin47/atom,tisu2tisu/atom,tjkr/atom,erikhakansson/atom,lpommers/atom,gisenberg/atom,vinodpanicker/atom,ezeoleaf/atom,bradgearon/atom,synaptek/atom,hharchani/atom,chfritz/atom,helber/atom,ali/atom,oggy/atom,ralphtheninja/atom,KENJU/atom,yomybaby/atom,isghe/atom,bsmr-x-script/atom,jlord/atom,charleswhchan/atom,AlisaKiatkongkumthon/atom,rmartin/atom,SlimeQ/atom,sekcheong/atom,ppamorim/atom,G-Baby/atom,Jandersoft/atom,cyzn/atom,ardeshirj/atom,boomwaiza/atom,liuderchi/atom,crazyquark/atom,sxgao3001/atom,Arcanemagus/atom,AlexxNica/atom,atom/atom,oggy/atom,lovesnow/atom,folpindo/atom,ali/atom,constanzaurzua/atom,jacekkopecky/atom,ykeisuke/atom,Locke23rus/atom,Ju2ender/atom,ardeshirj/atom,splodingsocks/atom,chengky/atom,paulcbetts/atom,pkdevbox/atom,gisenberg/atom,mrodalgaard/atom,vhutheesing/atom,PKRoma/atom,anuwat121/atom,Neron-X5/atom,russlescai/atom,Jdesk/atom,prembasumatary/atom,sotayamashita/atom,Shekharrajak/atom,vcarrera/atom,efatsi/atom,Ingramz/atom,devoncarew/atom,woss/atom,FIT-CSE2410-A-Bombs/atom,KENJU/atom,amine7536/atom,Austen-G/BlockBuilder,fang-yufeng/atom,Shekharrajak/atom,pombredanne/atom,vcarrera/atom,abcP9110/atom,Andrey-Pavlov/atom,targeter21/atom,isghe/atom,toqz/atom,PKRoma/atom,mertkahyaoglu/atom,kevinrenaers/atom,Dennis1978/atom,kdheepak89/atom,me6iaton/atom,deepfox/atom,bolinfest/atom,nvoron23/atom,tmunro/atom,qiujuer/atom,RobinTec/atom,CraZySacX/atom,alexandergmann/atom,seedtigo/atom,tisu2tisu/atom,batjko/atom,darwin/atom,constanzaurzua/atom,basarat/atom,rxkit/atom,mostafaeweda/atom,rjattrill/atom,dsandstrom/atom,liuxiong332/atom,ardeshirj/atom,CraZySacX/atom,kandros/atom,crazyquark/atom,hellendag/atom,sebmck/atom,bsmr-x-script/atom,Neron-X5/atom,Rychard/atom,bencolon/atom,tony612/atom,NunoEdgarGub1/atom,me6iaton/atom,Hasimir/atom,cyzn/atom,lovesnow/atom,devmario/atom,wiggzz/atom,vjeux/atom,ilovezy/atom,panuchart/atom,vcarrera/atom,dkfiresky/atom,Austen-G/BlockBuilder,nvoron23/atom,scv119/atom,hpham04/atom,Ingramz/atom,kdheepak89/atom,xream/atom,jordanbtucker/atom,ObviouslyGreen/atom,Abdillah/atom,NunoEdgarGub1/atom,ivoadf/atom,atom/atom,fang-yufeng/atom,chengky/atom,0x73/atom,svanharmelen/atom,n-riesco/atom,scippio/atom,charleswhchan/atom,Klozz/atom,Ju2ender/atom,originye/atom,ralphtheninja/atom,xream/atom,medovob/atom,florianb/atom,jacekkopecky/atom,qiujuer/atom,Galactix/atom,Hasimir/atom,basarat/atom,jtrose2/atom,execjosh/atom,Abdillah/atom,tanin47/atom,vhutheesing/atom,rlugojr/atom,SlimeQ/atom,Jandersolutions/atom,fredericksilva/atom,seedtigo/atom,matthewclendening/atom,toqz/atom,johnhaley81/atom,RuiDGoncalves/atom,sebmck/atom,john-kelly/atom,liuderchi/atom,SlimeQ/atom,pkdevbox/atom,Ju2ender/atom,prembasumatary/atom,prembasumatary/atom,bryonwinger/atom,sebmck/atom,RuiDGoncalves/atom,yalexx/atom,gzzhanghao/atom,chengky/atom,Galactix/atom,gzzhanghao/atom,acontreras89/atom,woss/atom,ivoadf/atom,fedorov/atom,tjkr/atom,Dennis1978/atom,hellendag/atom,jacekkopecky/atom,rjattrill/atom,cyzn/atom,RuiDGoncalves/atom,batjko/atom,johnrizzo1/atom,ReddTea/atom,devmario/atom,liuderchi/atom,qskycolor/atom,sillvan/atom,Andrey-Pavlov/atom,yalexx/atom,rlugojr/atom,devoncarew/atom,florianb/atom,AlbertoBarrago/atom,isghe/atom,codex8/atom,decaffeinate-examples/atom,einarmagnus/atom,russlescai/atom,Abdillah/atom,johnhaley81/atom,001szymon/atom,burodepeper/atom,vinodpanicker/atom,darwin/atom,Galactix/atom,sekcheong/atom,ppamorim/atom,FIT-CSE2410-A-Bombs/atom,n-riesco/atom,mnquintana/atom,jlord/atom,deepfox/atom,acontreras89/atom,jjz/atom,RobinTec/atom,lovesnow/atom,transcranial/atom,davideg/atom,chfritz/atom,Jandersolutions/atom,SlimeQ/atom,Rychard/atom,kevinrenaers/atom,abe33/atom,MjAbuz/atom,Mokolea/atom,anuwat121/atom,jtrose2/atom,liuxiong332/atom,bj7/atom,g2p/atom,hagb4rd/atom,mostafaeweda/atom,einarmagnus/atom,abe33/atom,yamhon/atom,G-Baby/atom,Dennis1978/atom,rmartin/atom,acontreras89/atom,devoncarew/atom,fedorov/atom,lisonma/atom,charleswhchan/atom,qiujuer/atom,AlbertoBarrago/atom,lpommers/atom,lpommers/atom,batjko/atom,vinodpanicker/atom,beni55/atom,rxkit/atom,DiogoXRP/atom,rsvip/aTom,dijs/atom,pengshp/atom,Andrey-Pavlov/atom,sillvan/atom,charleswhchan/atom,jlord/atom,FoldingText/atom,fang-yufeng/atom,jeremyramin/atom,bencolon/atom,hellendag/atom,kandros/atom,jacekkopecky/atom,n-riesco/atom,anuwat121/atom,gabrielPeart/atom,sekcheong/atom,bryonwinger/atom,YunchengLiao/atom,phord/atom,amine7536/atom,FoldingText/atom,jlord/atom,decaffeinate-examples/atom,decaffeinate-examples/atom,tony612/atom,jordanbtucker/atom,russlescai/atom,burodepeper/atom,harshdattani/atom,stinsonga/atom,pombredanne/atom,john-kelly/atom,kc8wxm/atom,dsandstrom/atom,YunchengLiao/atom,kittens/atom,lovesnow/atom,yalexx/atom,kc8wxm/atom,hharchani/atom,me-benni/atom,niklabh/atom,ashneo76/atom,nucked/atom,liuxiong332/atom,dannyflax/atom,amine7536/atom,githubteacher/atom,yangchenghu/atom,Hasimir/atom,champagnez/atom,ali/atom,sebmck/atom,rmartin/atom,scippio/atom,alfredxing/atom,johnhaley81/atom,woss/atom,palita01/atom,kdheepak89/atom,acontreras89/atom,synaptek/atom,mostafaeweda/atom,ironbox360/atom,andrewleverette/atom,andrewleverette/atom,batjko/atom,codex8/atom,liuderchi/atom,erikhakansson/atom,me6iaton/atom,FoldingText/atom,Andrey-Pavlov/atom,Shekharrajak/atom,abcP9110/atom,devmario/atom,lisonma/atom,crazyquark/atom,chengky/atom,avdg/atom,palita01/atom,yomybaby/atom,woss/atom,Hasimir/atom,efatsi/atom,ppamorim/atom,ironbox360/atom,harshdattani/atom,omarhuanca/atom,folpindo/atom,johnrizzo1/atom,mertkahyaoglu/atom,kjav/atom,liuxiong332/atom,nvoron23/atom,dijs/atom,codex8/atom,GHackAnonymous/atom,mdumrauf/atom,charleswhchan/atom,hpham04/atom,rsvip/aTom,vhutheesing/atom,YunchengLiao/atom,dannyflax/atom,sillvan/atom,xream/atom,mostafaeweda/atom,kjav/atom,h0dgep0dge/atom,acontreras89/atom,deoxilix/atom,001szymon/atom,davideg/atom,me-benni/atom,GHackAnonymous/atom,devmario/atom,abcP9110/atom,AlexxNica/atom,AlisaKiatkongkumthon/atom,FoldingText/atom,KENJU/atom,devoncarew/atom,Austen-G/BlockBuilder,originye/atom,0x73/atom,nucked/atom,medovob/atom,brumm/atom,fredericksilva/atom,dsandstrom/atom,NunoEdgarGub1/atom,Hasimir/atom,Neron-X5/atom,prembasumatary/atom,Jandersolutions/atom,GHackAnonymous/atom,ilovezy/atom,bsmr-x-script/atom,wiggzz/atom,deoxilix/atom,stinsonga/atom,0x73/atom,qskycolor/atom,Rodjana/atom,fang-yufeng/atom,ashneo76/atom,Huaraz2/atom,Sangaroonaom/atom,h0dgep0dge/atom,bencolon/atom,sotayamashita/atom,ilovezy/atom,seedtigo/atom,n-riesco/atom,tony612/atom,dannyflax/atom,kaicataldo/atom,Jdesk/atom,phord/atom,tmunro/atom,constanzaurzua/atom,stinsonga/atom,Jandersoft/atom,Rychard/atom,ReddTea/atom,nrodriguez13/atom,ppamorim/atom,Arcanemagus/atom,gontadu/atom,bcoe/atom,Huaraz2/atom,russlescai/atom,abcP9110/atom,chengky/atom,ali/atom,Jonekee/atom,ilovezy/atom,panuchart/atom,abe33/atom,FoldingText/atom,hharchani/atom,sxgao3001/atom,gzzhanghao/atom,jtrose2/atom,brettle/atom,kdheepak89/atom,sebmck/atom,KENJU/atom,tony612/atom,KENJU/atom,qskycolor/atom,nucked/atom,hagb4rd/atom,Jonekee/atom,toqz/atom,MjAbuz/atom,rsvip/aTom,rookie125/atom,Jandersolutions/atom,darwin/atom,lisonma/atom,niklabh/atom,Shekharrajak/atom,oggy/atom,deepfox/atom,vjeux/atom,targeter21/atom,vjeux/atom,jordanbtucker/atom,Jdesk/atom,Locke23rus/atom,scv119/atom,bolinfest/atom,basarat/atom,bj7/atom,davideg/atom,kjav/atom,001szymon/atom,boomwaiza/atom,dijs/atom,Ju2ender/atom,gisenberg/atom,hpham04/atom,n-riesco/atom,yangchenghu/atom,toqz/atom,kandros/atom,jeremyramin/atom,daxlab/atom,vcarrera/atom,jtrose2/atom,tanin47/atom,basarat/atom,sillvan/atom,abcP9110/atom,panuchart/atom,nvoron23/atom,champagnez/atom,sxgao3001/atom,Huaraz2/atom,nvoron23/atom,githubteacher/atom,brettle/atom,DiogoXRP/atom,Jdesk/atom,Ju2ender/atom,mnquintana/atom,beni55/atom,kjav/atom,champagnez/atom,lovesnow/atom,fredericksilva/atom,MjAbuz/atom,qiujuer/atom,florianb/atom,sxgao3001/atom,Locke23rus/atom,sekcheong/atom,yomybaby/atom,Abdillah/atom,Mokolea/atom,devmario/atom,einarmagnus/atom,pkdevbox/atom,CraZySacX/atom,ironbox360/atom,ReddTea/atom,h0dgep0dge/atom,avdg/atom,rookie125/atom,githubteacher/atom,execjosh/atom,crazyquark/atom,ivoadf/atom,t9md/atom,AlexxNica/atom,kittens/atom,alfredxing/atom,dkfiresky/atom,brumm/atom,paulcbetts/atom,ReddTea/atom,yamhon/atom,omarhuanca/atom,yangchenghu/atom,kc8wxm/atom,Mokolea/atom,hakatashi/atom,john-kelly/atom,me6iaton/atom,mnquintana/atom,BogusCurry/atom,hakatashi/atom,amine7536/atom,fscherwi/atom,hakatashi/atom,paulcbetts/atom,me-benni/atom,jacekkopecky/atom,dkfiresky/atom,yamhon/atom,mnquintana/atom,rookie125/atom,BogusCurry/atom,t9md/atom,mdumrauf/atom,scv119/atom,john-kelly/atom,einarmagnus/atom,RobinTec/atom,bcoe/atom,ezeoleaf/atom,kaicataldo/atom,bradgearon/atom,vjeux/atom,Sangaroonaom/atom,niklabh/atom,crazyquark/atom,boomwaiza/atom,t9md/atom,SlimeQ/atom,oggy/atom,elkingtonmcb/atom,BogusCurry/atom,svanharmelen/atom,ykeisuke/atom,florianb/atom,mnquintana/atom,Abdillah/atom,YunchengLiao/atom,Austen-G/BlockBuilder,elkingtonmcb/atom,efatsi/atom,g2p/atom,stuartquin/atom,MjAbuz/atom,pengshp/atom,FoldingText/atom,execjosh/atom,mostafaeweda/atom,jacekkopecky/atom,russlescai/atom,ObviouslyGreen/atom,0x73/atom,NunoEdgarGub1/atom,einarmagnus/atom,jlord/atom,hagb4rd/atom,YunchengLiao/atom,ralphtheninja/atom,brumm/atom,Arcanemagus/atom,oggy/atom,gontadu/atom,john-kelly/atom,tjkr/atom,AdrianVovk/substance-ide,omarhuanca/atom,daxlab/atom,avdg/atom,kjav/atom,woss/atom,dannyflax/atom,rmartin/atom,g2p/atom,ObviouslyGreen/atom,bradgearon/atom,liuxiong332/atom,beni55/atom,matthewclendening/atom,kevinrenaers/atom,yomybaby/atom,tony612/atom,rmartin/atom,jjz/atom,florianb/atom,hagb4rd/atom,dkfiresky/atom,qskycolor/atom,tisu2tisu/atom,Jonekee/atom,hagb4rd/atom,yalexx/atom,nrodriguez13/atom,basarat/atom,helber/atom,deoxilix/atom,Jandersolutions/atom,FIT-CSE2410-A-Bombs/atom,hpham04/atom,fedorov/atom,decaffeinate-examples/atom,ezeoleaf/atom,palita01/atom,bolinfest/atom,GHackAnonymous/atom,ykeisuke/atom,mertkahyaoglu/atom,kc8wxm/atom,constanzaurzua/atom,devoncarew/atom,codex8/atom,GHackAnonymous/atom,folpindo/atom,hakatashi/atom,erikhakansson/atom,transcranial/atom,qiujuer/atom,kittens/atom,splodingsocks/atom,Jandersoft/atom,alexandergmann/atom,Neron-X5/atom,phord/atom,sotayamashita/atom,kittens/atom,Ingramz/atom,kaicataldo/atom,synaptek/atom,elkingtonmcb/atom,fredericksilva/atom,fscherwi/atom,Austen-G/BlockBuilder,isghe/atom,stuartquin/atom,jeremyramin/atom,andrewleverette/atom,omarhuanca/atom,gabrielPeart/atom,PKRoma/atom,matthewclendening/atom,originye/atom,dsandstrom/atom,jjz/atom,yomybaby/atom,Jdesk/atom,fedorov/atom,Jandersoft/atom,amine7536/atom,ilovezy/atom,sillvan/atom,Neron-X5/atom,rsvip/aTom,targeter21/atom,johnrizzo1/atom,harshdattani/atom,synaptek/atom |
659ed2b5e77eedaaac12f8e061786b0d010b16ab | src/cache/instance.coffee | src/cache/instance.coffee | Impromptu = require '../impromptu'
class Instance extends Impromptu.Cache
run: (fn) ->
return get fn if @_cached
@set (err, results) =>
if err then fn err else @get fn
get: (fn) ->
fn null, @_cached ? @options.fallback
set: (fn) ->
@options.update.call @options.context, (err, value) =>
unless err
@_cached = value
fn err, !err
unset: (fn) ->
@_cached = null
fn null, true
# Expose `Instance`.
exports = module.exports = Instance
| Impromptu = require '../impromptu'
class Instance extends Impromptu.Cache
run: (fn) ->
return @get fn if @_cached
@set (err, results) =>
if err then fn err else @get fn
get: (fn) ->
fn null, @_cached ? @options.fallback
set: (fn) ->
@options.update.call @options.context, (err, value) =>
unless err
@_cached = value
fn err, !err
unset: (fn) ->
@_cached = null
fn null, true
# Expose `Instance`.
exports = module.exports = Instance
| Add missing reference to this. | Add missing reference to this.
| CoffeeScript | mit | impromptu/impromptu,impromptu/impromptu |
e49d54c701fb597351a866f58b58a02ad641b82f | lib/update.coffee | lib/update.coffee | Promise = require 'bluebird'
async = Promise.coroutine
request = Promise.promisifyAll require 'request'
requestAsync = Promise.promisify request, multiArgs: true
{SERVER_HOSTNAME, POI_VERSION, ROOT} = global
{log, warn, error} = require './utils'
module.exports =
checkUpdate: async (callback) ->
try
[response, body] = yield requestAsync "http://#{SERVER_HOSTNAME}/update/latest.json",
method: 'GET'
json: true
headers:
'User-Agent': "poi v#{POI_VERSION}"
if response.statusCode == 200
callback body
else
callback 'error'
catch e
error e
callback 'error'
| Promise = require 'bluebird'
async = Promise.coroutine
request = Promise.promisifyAll require 'request'
requestAsync = Promise.promisify request, multiArgs: true
{POI_VERSION, ROOT} = global
{log, warn, error} = require './utils'
module.exports =
checkUpdate: async (callback) ->
try
[response, body] = yield requestAsync "http://#{global.SERVER_HOSTNAME}/update/latest.json",
method: 'GET'
json: true
headers:
'User-Agent': "poi v#{POI_VERSION}"
if response.statusCode == 200
callback body
else
callback 'error'
catch e
error e
callback 'error'
| Fix an error that may lead to [ERROR] Error: getaddrinfo ENOTFOUND undefined undefined:80 | Fix an error that may lead to [ERROR] Error: getaddrinfo ENOTFOUND undefined undefined:80
| CoffeeScript | mit | PHELiOX/poi,yudachi/poi,PHELiOX/poi,dushi792/poi,syncsyncsynchalt/poi,KagamiChan/poi,KagamiChan/poi,dushi792/poi,yudachi/poi,syncsyncsynchalt/poi,poooi/poi,syncsyncsynchalt/poi,poooi/poi,poooi/poi,dushi792/poi,nagatoyk/poi,yudachi/poi,gnattu/poi,gnattu/poi,nagatoyk/poi,syncsyncsynchalt/poi,poooi/poi |
9b84cffb1f772c159cc30c3c38f30643a1a39b5d | spec/core/core_spec.coffee | spec/core/core_spec.coffee | describe 'Test of core.coffee', ->
| describe 'Test of core.coffee', ->
elements = null
beforeEach ->
elements = [null, null, null]
for i,_ of elements
elements[i] = window.document.createElement('section')
elements[i].innerHTML = '''
<animation>
<keyframe target='h1'>
<keyframe target='h2'>
</animation>
'''
window.document.body.appendChild(elements[i])
afterEach ->
for i,_ of elements
window.document.body.removeChild(elements[i])
elements = null
it "initializes a object", ->
core = new Scena.Core
expect(window.Scena.core).toBe(core)
core.initialize()
expect(core.pages.length).toBe(3)
it "skips to aspecified page", ->
core = new Scena.Core
core.initialize()
core.skipToPage(2)
expect(core.getCurrentIndex()).toBe(2)
it "fires a keyframe if the page has keyframes", ->
core = new Scena.Core
core.initialize()
core.skipToPage(0)
expect(core.currentAnimation.keyframes.length).toBe(2)
core.nextStep()
expect(core.currentAnimation.keyframes.length).toBe(1)
core.nextStep()
expect(core.currentAnimation.keyframes.length).toBe(0)
it "moves to a next page if the page has no-keyframes", ->
core = new Scena.Core
core.initialize()
core.skipToPage(0)
core.nextStep()
core.nextStep()
core.nextStep()
expect(core.currentAnimation.keyframes.length).toBe(2)
expect(core.getCurrentIndex()).toBe(1)
it "skips to aspecified page and remove a keyframe if keyframes remain", ->
core = new Scena.Core
core.initialize()
core.skipToPage(0)
core.nextStep() # of remaining keyframes is 1
core.skipToPage(2)
expect(core.getCurrentIndex()).toBe(2)
expect(core.currentAnimation.keyframes.length).toBe(2)
xit "animates to aspecified page", ->
it "skips to aspecified page", ->
core = new Scena.Core
core.initialize()
core.skipToPage(2)
expect(core.getCurrentIndex()).toBe(2)
it "skips to next page", ->
core = new Scena.Core
core.initialize()
core.skipToPage(1)
core.skipToNextPage()
expect(core.getCurrentIndex()).toBe(2)
it "skips to previous page", ->
core = new Scena.Core
core.initialize()
core.skipToPage(1)
core.skipToPrevPage()
expect(core.getCurrentIndex()).toBe(0)
it "skips to first page", ->
core = new Scena.Core
core.initialize()
core.skipToFirstPage()
expect(core.getCurrentIndex()).toBe(0)
it "skips to last page", ->
core = new Scena.Core
core.initialize()
core.skipToLastPage()
expect(core.getCurrentIndex()).toBe(2)
| Append a test of the core.coffee | Append a test of the core.coffee
| CoffeeScript | mit | iBenza/Libretto.js,iBenza/Libretto.js,ueokande/Libretto.js,ueokande/Libretto.js |
2e5bc46563a46e978a2a754cd4b273d44ae97497 | src/coffee/cilantro/ui/workflows/workspace.coffee | src/coffee/cilantro/ui/workflows/workspace.coffee | define [
'underscore'
'marionette'
'../core'
'../base'
'../query'
'tpl!templates/workflows/workspace.html'
], (_, Marionette, c, base, query, templates...) ->
templates = _.object ['workspace'], templates
class WorkspaceWorkflow extends Marionette.Layout
className: 'workspace-workflow'
template: templates.workspace
regions:
queries: '.query-region'
queryModal: '.create-query-modal'
regionViews:
queries: query.QueryList
initialize: ->
@data = {}
if (@data.queries = @options.queries)
throw new Error 'queries collection required'
onRender: ->
@queries.show new @regionViews.queries
collection: @data.queries
queryModalRegion: @queryModal
{ WorkspaceWorkflow }
| define [
'underscore'
'marionette'
'../core'
'../base'
'../query'
'tpl!templates/workflows/workspace.html'
], (_, Marionette, c, base, query, templates...) ->
templates = _.object ['workspace'], templates
class WorkspaceWorkflow extends Marionette.Layout
className: 'workspace-workflow'
template: templates.workspace
regions:
queries: '.query-region'
queryModal: '.create-query-modal'
regionViews:
queries: query.QueryList
initialize: ->
@data = {}
if not (@data.queries = @options.queries)
throw new Error 'queries collection required'
onRender: ->
@queries.show new @regionViews.queries
collection: @data.queries
queryModalRegion: @queryModal
{ WorkspaceWorkflow }
| Add missing negation to data assertion in WorkspaceWorkflow | Add missing negation to data assertion in WorkspaceWorkflow | CoffeeScript | bsd-2-clause | chop-dbhi/cilantro,chop-dbhi/cilantro,chop-dbhi/cilantro |
b7f8ed53d3094ca2ac0e51f86d80986bdf3fca3c | lib/d-struct.coffee | lib/d-struct.coffee | # Grab a few objects that we'll need
popen = require('child_process').exec
path = require('path')
platform = require('os').platform
# Open a terminal and run dub
dub_build = ->
# Run the terminal app
cmdline = "osascript -e \'tell application \"Terminal\" to do script \"cd #{atom.project.path}; dub build\"\'"
popen cmdline
# Open a terminal and run the app with dub
dub_run = ->
# Run the terminal app
cmdline = "osascript -e \'tell application \"Terminal\" to do script \"cd #{atom.project.path}; dub run\"\'"
popen cmdline
module.exports =
# Bind workspace command to run_dub
activate: (state) ->
atom.workspaceView.command "d-struct:dub-build", => @dubbuild()
atom.workspaceView.command "d-struct:dub-run", => @dubrun()
dubbuild: ->
dub_build()
dubrun: ->
dub_run()
| # Grab a few objects that we'll need
popen = require('child_process').exec
platform = require('os').platform
# TODO: linux support still needs to be added
commands =
build:
win32: "start cmd /k \"cd #{atom.project.getPaths().shift()} && dub run\""
darwin: "osascript -e \'tell application \"Terminal\" to do script \"cd #{atom.project.getPaths().shift()}; dub run\"\'"
run:
win32: "start cmd /k \"cd \"#{atom.project.getPaths().shift()}\" && dub build\""
darwin: "osascript -e \'tell application \"Terminal\" to do script \"cd #{atom.project.getPaths().shift()}; dub build\"\'"
# Open a terminal and run dub
dub_build = ->
# Run the terminal app
popen commands.build[platform()] if platform() of commands.build
# Open a terminal and run the app with dub
dub_run = ->
# Run the terminal app
popen commands.run[platform()] if platform() of commands.run
module.exports =
# Bind workspace command to run_dub
activate: (state) ->
atom.workspaceView.command "d-struct:dub-build", => @dubbuild()
atom.workspaceView.command "d-struct:dub-run", => @dubrun()
dubbuild: ->
dub_build()
dubrun: ->
dub_run()
| Make the dub commands play nice with Windows. | Make the dub commands play nice with Windows.
* The dub build/run commands are now compatible with Windows as well as OS X.
* Fix code to get project path.
* Remove the path import since it's not needed. | CoffeeScript | mit | ysgard/d-struct |
f41797110e84d74512e61419e00885db9613fe22 | menus/symbols-view.cson | menus/symbols-view.cson | 'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Symbols'
'submenu': [
{ 'label': 'File Symbols', 'command': 'symbols-view:toggle-file-symbols' }
{ 'label': 'Project Symbols', 'command': 'symbols-view:toggle-project-symbols' }
]
]
}
]
'context-menu':
'.overlayer': [
{ 'label': 'Go to Declaration', 'command': 'symbols-view:go-to-declaration' }
]
| 'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Symbols'
'submenu': [
{ 'label': 'File Symbols', 'command': 'symbols-view:toggle-file-symbols' }
{ 'label': 'Project Symbols', 'command': 'symbols-view:toggle-project-symbols' }
]
]
}
]
'context-menu':
'atom-text-editor': [
{ 'label': 'Go to Declaration', 'command': 'symbols-view:go-to-declaration' }
]
| Add context menu to atom-text-editor selector | Add context menu to atom-text-editor selector
| CoffeeScript | mit | changjej/symbols-view,rodumani/symbols-view,atom/symbols-view,harai/atom-gnu-global,spencerlyon2/symbols-view,harai/atom-gnu-global,changjej/symbols-view,kainwinterheart/symbols-view,spencerlyon2/symbols-view,rodumani/symbols-view |
cf58703c5ba336ae484eabcba7a6847320f2f3eb | client/app/lib/util/sortEnvironmentStacks.coffee | client/app/lib/util/sortEnvironmentStacks.coffee | MANAGED_VMS = 'Managed VMs'
module.exports = (stacks = []) ->
stacks.sort (a, b) ->
return 1 if a.title is MANAGED_VMS
return -1 if b.title is MANAGED_VMS
return new Date(a.meta.createdAt) - new Date(b.meta.createdAt)
| isManagedVMStack = require './isManagedVMStack'
module.exports = (stacks = []) ->
stacks.sort (a, b) ->
return 1 if isManagedVMStack a
return -1 if isManagedVMStack b
return new Date(a.meta.createdAt) - new Date(b.meta.createdAt)
| Refactor sort environment stacks utility | Refactor sort environment stacks utility
| CoffeeScript | agpl-3.0 | rjeczalik/koding,jack89129/koding,mertaytore/koding,drewsetski/koding,acbodine/koding,rjeczalik/koding,mertaytore/koding,szkl/koding,mertaytore/koding,andrewjcasal/koding,drewsetski/koding,kwagdy/koding-1,acbodine/koding,sinan/koding,andrewjcasal/koding,drewsetski/koding,gokmen/koding,acbodine/koding,koding/koding,cihangir/koding,acbodine/koding,cihangir/koding,sinan/koding,sinan/koding,andrewjcasal/koding,acbodine/koding,usirin/koding,drewsetski/koding,drewsetski/koding,szkl/koding,gokmen/koding,usirin/koding,koding/koding,alex-ionochkin/koding,mertaytore/koding,cihangir/koding,szkl/koding,koding/koding,usirin/koding,gokmen/koding,sinan/koding,andrewjcasal/koding,kwagdy/koding-1,kwagdy/koding-1,rjeczalik/koding,kwagdy/koding-1,kwagdy/koding-1,jack89129/koding,rjeczalik/koding,cihangir/koding,andrewjcasal/koding,jack89129/koding,koding/koding,andrewjcasal/koding,usirin/koding,alex-ionochkin/koding,mertaytore/koding,usirin/koding,acbodine/koding,gokmen/koding,alex-ionochkin/koding,drewsetski/koding,mertaytore/koding,drewsetski/koding,sinan/koding,kwagdy/koding-1,rjeczalik/koding,andrewjcasal/koding,usirin/koding,drewsetski/koding,jack89129/koding,koding/koding,acbodine/koding,mertaytore/koding,koding/koding,kwagdy/koding-1,jack89129/koding,szkl/koding,cihangir/koding,sinan/koding,usirin/koding,szkl/koding,szkl/koding,szkl/koding,rjeczalik/koding,jack89129/koding,gokmen/koding,alex-ionochkin/koding,szkl/koding,andrewjcasal/koding,cihangir/koding,usirin/koding,rjeczalik/koding,alex-ionochkin/koding,acbodine/koding,jack89129/koding,gokmen/koding,alex-ionochkin/koding,rjeczalik/koding,gokmen/koding,koding/koding,alex-ionochkin/koding,koding/koding,sinan/koding,jack89129/koding,cihangir/koding,mertaytore/koding,gokmen/koding,cihangir/koding,alex-ionochkin/koding,kwagdy/koding-1,sinan/koding |
27184ec776930553b5d9e319b8f3f89071ed8767 | lib/tracker.coffee | lib/tracker.coffee | ua = require('universal-analytics')
visitor = ua('UA-49535937-3')
module.exports = (req, res, next) ->
eventParams =
ec: 'API Request' # category
ea: req.get('Referrer') || 'no referrer' # action
el: req.ip # label
dp: req.url # page path
visitor.event(eventParams).send()
next()
| ua = require('universal-analytics')
module.exports = (req, res, next) ->
visitor = ua('UA-49535937-3')
eventParams =
ec: 'API Request' # category
ea: req.get('Referrer') || 'no referrer' # action
el: req.ip # label
dp: req.url # page path
visitor.event(eventParams).send()
next()
| Use different visitor per event | Use different visitor per event
Instantiate a 'visitor' on every API request, since GA only tracks 500 events per visitor/session per day.
| CoffeeScript | mit | adorableio/avatars-api,mojects/avatars-api,gitblit/avatars-api,gitblit/avatars-api,mojects/avatars-api |
ff1f9b98d2eb5f4554dcd7ed92c72272bf282b42 | src/app/package.coffee | src/app/package.coffee | fsUtils = require 'fs-utils'
### Internal ###
module.exports =
class Package
@build: (path) ->
TextMatePackage = require 'text-mate-package'
AtomPackage = require 'atom-package'
if TextMatePackage.testName(path)
new TextMatePackage(path)
else
new AtomPackage(path)
@load: (path, options) ->
pack = @build(path)
pack.load(options)
pack
name: null
path: null
constructor: (@path) ->
@name = fsUtils.base(@path)
| {basename} = require 'path'
### Internal ###
module.exports =
class Package
@build: (path) ->
TextMatePackage = require 'text-mate-package'
AtomPackage = require 'atom-package'
if TextMatePackage.testName(path)
new TextMatePackage(path)
else
new AtomPackage(path)
@load: (path, options) ->
pack = @build(path)
pack.load(options)
pack
name: null
path: null
constructor: (@path) ->
@name = basename(@path)
| Use path.basename() instead of fsUtils.base() | Use path.basename() instead of fsUtils.base()
| CoffeeScript | mit | batjko/atom,bolinfest/atom,bsmr-x-script/atom,helber/atom,ObviouslyGreen/atom,einarmagnus/atom,G-Baby/atom,SlimeQ/atom,yangchenghu/atom,dannyflax/atom,yangchenghu/atom,liuderchi/atom,Jdesk/atom,jeremyramin/atom,ppamorim/atom,rmartin/atom,sebmck/atom,dkfiresky/atom,acontreras89/atom,wiggzz/atom,qskycolor/atom,ironbox360/atom,NunoEdgarGub1/atom,Mokolea/atom,crazyquark/atom,mrodalgaard/atom,Abdillah/atom,kandros/atom,brumm/atom,Locke23rus/atom,ykeisuke/atom,Galactix/atom,kc8wxm/atom,CraZySacX/atom,abcP9110/atom,bradgearon/atom,Hasimir/atom,0x73/atom,scippio/atom,gabrielPeart/atom,gisenberg/atom,elkingtonmcb/atom,deepfox/atom,dijs/atom,jjz/atom,hagb4rd/atom,AlbertoBarrago/atom,deoxilix/atom,brettle/atom,russlescai/atom,qskycolor/atom,DiogoXRP/atom,tisu2tisu/atom,russlescai/atom,YunchengLiao/atom,transcranial/atom,basarat/atom,synaptek/atom,ralphtheninja/atom,chengky/atom,alexandergmann/atom,n-riesco/atom,boomwaiza/atom,Dennis1978/atom,Abdillah/atom,hagb4rd/atom,kevinrenaers/atom,gisenberg/atom,001szymon/atom,florianb/atom,GHackAnonymous/atom,liuxiong332/atom,YunchengLiao/atom,bolinfest/atom,gontadu/atom,originye/atom,acontreras89/atom,john-kelly/atom,matthewclendening/atom,kdheepak89/atom,yalexx/atom,rmartin/atom,rlugojr/atom,splodingsocks/atom,ezeoleaf/atom,oggy/atom,execjosh/atom,FoldingText/atom,me-benni/atom,jlord/atom,targeter21/atom,ykeisuke/atom,Klozz/atom,kittens/atom,rlugojr/atom,lpommers/atom,seedtigo/atom,johnrizzo1/atom,john-kelly/atom,stinsonga/atom,seedtigo/atom,sxgao3001/atom,Hasimir/atom,boomwaiza/atom,fedorov/atom,kc8wxm/atom,Andrey-Pavlov/atom,beni55/atom,champagnez/atom,rsvip/aTom,harshdattani/atom,PKRoma/atom,amine7536/atom,ardeshirj/atom,woss/atom,SlimeQ/atom,jacekkopecky/atom,Jandersolutions/atom,panuchart/atom,erikhakansson/atom,execjosh/atom,hharchani/atom,codex8/atom,harshdattani/atom,einarmagnus/atom,bryonwinger/atom,toqz/atom,liuderchi/atom,nucked/atom,vjeux/atom,sotayamashita/atom,kittens/atom,mrodalgaard/atom,abcP9110/atom,originye/atom,deepfox/atom,yamhon/atom,yangchenghu/atom,acontreras89/atom,dannyflax/atom,omarhuanca/atom,Abdillah/atom,hellendag/atom,pengshp/atom,boomwaiza/atom,medovob/atom,ReddTea/atom,MjAbuz/atom,constanzaurzua/atom,pombredanne/atom,deoxilix/atom,Jandersoft/atom,bcoe/atom,efatsi/atom,sillvan/atom,hharchani/atom,gontadu/atom,AlexxNica/atom,ali/atom,dannyflax/atom,harshdattani/atom,yalexx/atom,RuiDGoncalves/atom,AlisaKiatkongkumthon/atom,dannyflax/atom,davideg/atom,nucked/atom,paulcbetts/atom,tisu2tisu/atom,targeter21/atom,stinsonga/atom,fedorov/atom,jtrose2/atom,russlescai/atom,gabrielPeart/atom,me6iaton/atom,lisonma/atom,Locke23rus/atom,bcoe/atom,brettle/atom,nvoron23/atom,dannyflax/atom,gisenberg/atom,ppamorim/atom,scv119/atom,scv119/atom,vcarrera/atom,davideg/atom,dkfiresky/atom,vjeux/atom,Galactix/atom,ali/atom,qskycolor/atom,sekcheong/atom,Ju2ender/atom,gisenberg/atom,rsvip/aTom,erikhakansson/atom,hakatashi/atom,Jonekee/atom,isghe/atom,sxgao3001/atom,me6iaton/atom,FIT-CSE2410-A-Bombs/atom,constanzaurzua/atom,ivoadf/atom,kevinrenaers/atom,001szymon/atom,ivoadf/atom,matthewclendening/atom,vinodpanicker/atom,phord/atom,abe33/atom,Shekharrajak/atom,rxkit/atom,Jandersoft/atom,sekcheong/atom,rsvip/aTom,MjAbuz/atom,deoxilix/atom,tmunro/atom,crazyquark/atom,fang-yufeng/atom,basarat/atom,sillvan/atom,johnrizzo1/atom,gzzhanghao/atom,ReddTea/atom,transcranial/atom,Andrey-Pavlov/atom,stuartquin/atom,abe33/atom,johnhaley81/atom,Jandersoft/atom,alfredxing/atom,gabrielPeart/atom,AdrianVovk/substance-ide,Jdesk/atom,kjav/atom,h0dgep0dge/atom,rmartin/atom,russlescai/atom,pkdevbox/atom,paulcbetts/atom,johnhaley81/atom,devoncarew/atom,kaicataldo/atom,amine7536/atom,devoncarew/atom,nvoron23/atom,anuwat121/atom,beni55/atom,rjattrill/atom,Rychard/atom,matthewclendening/atom,prembasumatary/atom,pkdevbox/atom,AlisaKiatkongkumthon/atom,Shekharrajak/atom,davideg/atom,lovesnow/atom,darwin/atom,vjeux/atom,AlexxNica/atom,h0dgep0dge/atom,GHackAnonymous/atom,phord/atom,BogusCurry/atom,dkfiresky/atom,FoldingText/atom,hharchani/atom,jjz/atom,githubteacher/atom,sxgao3001/atom,hpham04/atom,kjav/atom,kjav/atom,avdg/atom,mostafaeweda/atom,Ju2ender/atom,darwin/atom,vinodpanicker/atom,jlord/atom,Mokolea/atom,AlexxNica/atom,transcranial/atom,isghe/atom,florianb/atom,dkfiresky/atom,devmario/atom,kandros/atom,dijs/atom,constanzaurzua/atom,Dennis1978/atom,basarat/atom,fscherwi/atom,hharchani/atom,darwin/atom,Neron-X5/atom,t9md/atom,rookie125/atom,tony612/atom,vjeux/atom,Austen-G/BlockBuilder,matthewclendening/atom,liuxiong332/atom,bradgearon/atom,rjattrill/atom,vhutheesing/atom,Jonekee/atom,johnhaley81/atom,Jdesk/atom,Austen-G/BlockBuilder,jjz/atom,tony612/atom,Andrey-Pavlov/atom,crazyquark/atom,woss/atom,matthewclendening/atom,helber/atom,alfredxing/atom,rlugojr/atom,avdg/atom,burodepeper/atom,prembasumatary/atom,omarhuanca/atom,KENJU/atom,prembasumatary/atom,pengshp/atom,ezeoleaf/atom,folpindo/atom,abcP9110/atom,YunchengLiao/atom,vcarrera/atom,Austen-G/BlockBuilder,splodingsocks/atom,champagnez/atom,cyzn/atom,hagb4rd/atom,hpham04/atom,FoldingText/atom,tjkr/atom,bryonwinger/atom,h0dgep0dge/atom,tjkr/atom,gzzhanghao/atom,cyzn/atom,g2p/atom,tisu2tisu/atom,nvoron23/atom,burodepeper/atom,vcarrera/atom,ezeoleaf/atom,medovob/atom,gisenberg/atom,fang-yufeng/atom,pengshp/atom,fredericksilva/atom,Huaraz2/atom,niklabh/atom,splodingsocks/atom,Klozz/atom,Jandersolutions/atom,jordanbtucker/atom,Neron-X5/atom,toqz/atom,ilovezy/atom,Neron-X5/atom,lovesnow/atom,qiujuer/atom,sillvan/atom,Sangaroonaom/atom,originye/atom,acontreras89/atom,crazyquark/atom,Ju2ender/atom,einarmagnus/atom,me6iaton/atom,Jandersolutions/atom,florianb/atom,rsvip/aTom,SlimeQ/atom,erikhakansson/atom,RobinTec/atom,ironbox360/atom,bencolon/atom,ashneo76/atom,Huaraz2/atom,gzzhanghao/atom,targeter21/atom,fang-yufeng/atom,beni55/atom,atom/atom,vinodpanicker/atom,AdrianVovk/substance-ide,kjav/atom,charleswhchan/atom,yamhon/atom,rxkit/atom,Galactix/atom,sekcheong/atom,mnquintana/atom,ilovezy/atom,yomybaby/atom,alfredxing/atom,mostafaeweda/atom,yomybaby/atom,scv119/atom,deepfox/atom,sillvan/atom,pombredanne/atom,atom/atom,ezeoleaf/atom,lisonma/atom,devmario/atom,ivoadf/atom,ykeisuke/atom,Shekharrajak/atom,devoncarew/atom,tony612/atom,ReddTea/atom,yomybaby/atom,lisonma/atom,bj7/atom,paulcbetts/atom,FoldingText/atom,stuartquin/atom,dsandstrom/atom,rmartin/atom,nvoron23/atom,avdg/atom,medovob/atom,yalexx/atom,sekcheong/atom,elkingtonmcb/atom,Ingramz/atom,fredericksilva/atom,decaffeinate-examples/atom,jtrose2/atom,qskycolor/atom,phord/atom,t9md/atom,G-Baby/atom,mostafaeweda/atom,toqz/atom,chfritz/atom,ilovezy/atom,Rychard/atom,ali/atom,me-benni/atom,mertkahyaoglu/atom,daxlab/atom,constanzaurzua/atom,mdumrauf/atom,jacekkopecky/atom,nrodriguez13/atom,fredericksilva/atom,kaicataldo/atom,john-kelly/atom,ppamorim/atom,sebmck/atom,Jandersolutions/atom,lovesnow/atom,tony612/atom,execjosh/atom,BogusCurry/atom,liuxiong332/atom,seedtigo/atom,prembasumatary/atom,FIT-CSE2410-A-Bombs/atom,KENJU/atom,jtrose2/atom,einarmagnus/atom,bj7/atom,ironbox360/atom,pombredanne/atom,Klozz/atom,RobinTec/atom,Austen-G/BlockBuilder,BogusCurry/atom,fedorov/atom,mertkahyaoglu/atom,jtrose2/atom,svanharmelen/atom,decaffeinate-examples/atom,batjko/atom,andrewleverette/atom,SlimeQ/atom,omarhuanca/atom,githubteacher/atom,SlimeQ/atom,sxgao3001/atom,kittens/atom,AlisaKiatkongkumthon/atom,0x73/atom,ralphtheninja/atom,bryonwinger/atom,jordanbtucker/atom,PKRoma/atom,githubteacher/atom,amine7536/atom,Arcanemagus/atom,niklabh/atom,sotayamashita/atom,daxlab/atom,pombredanne/atom,woss/atom,hakatashi/atom,isghe/atom,vjeux/atom,chengky/atom,n-riesco/atom,abcP9110/atom,fedorov/atom,stuartquin/atom,qiujuer/atom,ashneo76/atom,jjz/atom,dkfiresky/atom,AdrianVovk/substance-ide,lisonma/atom,folpindo/atom,KENJU/atom,dsandstrom/atom,kaicataldo/atom,NunoEdgarGub1/atom,decaffeinate-examples/atom,liuderchi/atom,yomybaby/atom,CraZySacX/atom,batjko/atom,Huaraz2/atom,lisonma/atom,me-benni/atom,0x73/atom,Jandersoft/atom,Shekharrajak/atom,ashneo76/atom,folpindo/atom,Galactix/atom,kjav/atom,GHackAnonymous/atom,codex8/atom,Austen-G/BlockBuilder,mertkahyaoglu/atom,tanin47/atom,chengky/atom,mostafaeweda/atom,niklabh/atom,scippio/atom,mdumrauf/atom,sebmck/atom,ObviouslyGreen/atom,isghe/atom,xream/atom,hagb4rd/atom,sebmck/atom,john-kelly/atom,FIT-CSE2410-A-Bombs/atom,PKRoma/atom,yamhon/atom,bcoe/atom,RobinTec/atom,YunchengLiao/atom,bsmr-x-script/atom,charleswhchan/atom,batjko/atom,synaptek/atom,oggy/atom,Hasimir/atom,jeremyramin/atom,tanin47/atom,sxgao3001/atom,kittens/atom,jacekkopecky/atom,n-riesco/atom,paulcbetts/atom,g2p/atom,kc8wxm/atom,Jandersolutions/atom,panuchart/atom,targeter21/atom,jacekkopecky/atom,bsmr-x-script/atom,KENJU/atom,andrewleverette/atom,oggy/atom,kc8wxm/atom,jeremyramin/atom,crazyquark/atom,sotayamashita/atom,Andrey-Pavlov/atom,hakatashi/atom,scv119/atom,ppamorim/atom,Ingramz/atom,nucked/atom,bj7/atom,hpham04/atom,Jonekee/atom,isghe/atom,wiggzz/atom,AlbertoBarrago/atom,fredericksilva/atom,fang-yufeng/atom,abe33/atom,florianb/atom,deepfox/atom,YunchengLiao/atom,andrewleverette/atom,Ju2ender/atom,mnquintana/atom,charleswhchan/atom,Hasimir/atom,RuiDGoncalves/atom,qiujuer/atom,nrodriguez13/atom,mrodalgaard/atom,pombredanne/atom,amine7536/atom,efatsi/atom,NunoEdgarGub1/atom,tmunro/atom,kittens/atom,basarat/atom,mertkahyaoglu/atom,Arcanemagus/atom,Mokolea/atom,hagb4rd/atom,fscherwi/atom,chfritz/atom,hharchani/atom,Jdesk/atom,rookie125/atom,lpommers/atom,palita01/atom,bcoe/atom,vinodpanicker/atom,woss/atom,fredericksilva/atom,G-Baby/atom,n-riesco/atom,daxlab/atom,qiujuer/atom,vhutheesing/atom,kandros/atom,codex8/atom,charleswhchan/atom,mnquintana/atom,RobinTec/atom,GHackAnonymous/atom,qskycolor/atom,mnquintana/atom,jlord/atom,sillvan/atom,deepfox/atom,elkingtonmcb/atom,vcarrera/atom,stinsonga/atom,davideg/atom,liuderchi/atom,Rychard/atom,woss/atom,kevinrenaers/atom,rmartin/atom,fang-yufeng/atom,constanzaurzua/atom,AlbertoBarrago/atom,Neron-X5/atom,cyzn/atom,charleswhchan/atom,t9md/atom,kdheepak89/atom,Ingramz/atom,hellendag/atom,tjkr/atom,codex8/atom,KENJU/atom,MjAbuz/atom,mostafaeweda/atom,sekcheong/atom,DiogoXRP/atom,anuwat121/atom,h0dgep0dge/atom,decaffeinate-examples/atom,RobinTec/atom,lovesnow/atom,NunoEdgarGub1/atom,davideg/atom,sebmck/atom,jlord/atom,Jdesk/atom,synaptek/atom,bryonwinger/atom,panuchart/atom,svanharmelen/atom,svanharmelen/atom,lpommers/atom,Arcanemagus/atom,liuxiong332/atom,kdheepak89/atom,CraZySacX/atom,bencolon/atom,champagnez/atom,splodingsocks/atom,helber/atom,bolinfest/atom,rjattrill/atom,nrodriguez13/atom,rjattrill/atom,fedorov/atom,einarmagnus/atom,dijs/atom,alexandergmann/atom,fscherwi/atom,hpham04/atom,toqz/atom,efatsi/atom,hellendag/atom,synaptek/atom,pkdevbox/atom,ali/atom,0x73/atom,florianb/atom,ali/atom,omarhuanca/atom,Sangaroonaom/atom,RuiDGoncalves/atom,lovesnow/atom,chengky/atom,kdheepak89/atom,liuxiong332/atom,yomybaby/atom,me6iaton/atom,Locke23rus/atom,jtrose2/atom,ReddTea/atom,amine7536/atom,Sangaroonaom/atom,yalexx/atom,Hasimir/atom,vhutheesing/atom,rookie125/atom,rxkit/atom,hakatashi/atom,ardeshirj/atom,Austen-G/BlockBuilder,yalexx/atom,dannyflax/atom,Rodjana/atom,palita01/atom,brumm/atom,oggy/atom,atom/atom,mertkahyaoglu/atom,dsandstrom/atom,prembasumatary/atom,ReddTea/atom,Neron-X5/atom,anuwat121/atom,n-riesco/atom,tmunro/atom,xream/atom,tanin47/atom,tony612/atom,Abdillah/atom,MjAbuz/atom,devmario/atom,codex8/atom,mnquintana/atom,FoldingText/atom,john-kelly/atom,burodepeper/atom,Abdillah/atom,bencolon/atom,xream/atom,synaptek/atom,ardeshirj/atom,basarat/atom,Andrey-Pavlov/atom,russlescai/atom,mdumrauf/atom,jlord/atom,ppamorim/atom,gontadu/atom,devmario/atom,Shekharrajak/atom,Dennis1978/atom,vcarrera/atom,targeter21/atom,kc8wxm/atom,stinsonga/atom,chfritz/atom,oggy/atom,jacekkopecky/atom,hpham04/atom,basarat/atom,bcoe/atom,dsandstrom/atom,me6iaton/atom,MjAbuz/atom,toqz/atom,ilovezy/atom,bradgearon/atom,palita01/atom,johnrizzo1/atom,nvoron23/atom,DiogoXRP/atom,alexandergmann/atom,GHackAnonymous/atom,rsvip/aTom,scippio/atom,Rodjana/atom,devoncarew/atom,ralphtheninja/atom,devmario/atom,jordanbtucker/atom,omarhuanca/atom,dsandstrom/atom,Ju2ender/atom,Galactix/atom,FoldingText/atom,chengky/atom,Jandersoft/atom,001szymon/atom,vinodpanicker/atom,abcP9110/atom,jacekkopecky/atom,qiujuer/atom,acontreras89/atom,kdheepak89/atom,batjko/atom,brumm/atom,devoncarew/atom,ilovezy/atom,g2p/atom,wiggzz/atom,jjz/atom,NunoEdgarGub1/atom,Rodjana/atom,brettle/atom,ObviouslyGreen/atom |
0751f501525a5afa424fbdd00f7780f8ade48fdf | coffee/controllers/posts_controller.coffee | coffee/controllers/posts_controller.coffee | define [
"chaplin"
"models/posts"
"views/posts"
], (Chaplin, Posts, PostsView) ->
"use strict"
class PostsController extends Chaplin.Controller
show: (params) ->
# Unescape matched parts of url.
# Why the hell chaplin doesn't do it by himself?
# XXX: Seems like what we should use encodeURIComponent
# and then decode it for each url parameter like user or id
# but we hope that they will not contain "bad" characters
# in future.
params.tag = decodeURIComponent params.tag if params.tag?
params.club = decodeURIComponent params.club if params.club?
query = use_bl: 1
if params.user?
query.user = params.user
query.tag = params.tag if params.tag?
params.title = "@#{params.user}"
else if params.club?
query.club = params.club
params.title = "!#{params.club}"
else if params.tag?
query.tag = params.tag
params.title = "*#{params.tag}"
@collection = new Posts [], id: params.id, query: query
@view = new PostsView collection: @collection, pageble: params.pageble
@adjustTitle params.title
| define [
"chaplin"
"models/posts"
"views/posts"
], (Chaplin, Posts, PostsView) ->
"use strict"
class PostsController extends Chaplin.Controller
show: (params) ->
# Unescape matched parts of url.
# Why the hell chaplin doesn't do it by himself?
# XXX: Seems like what we should use encodeURIComponent
# and then decode it for each url parameter like user or id
# but we hope that they will not contain "bad" characters
# in future.
params.tag = decodeURIComponent params.tag if params.tag?
params.club = decodeURIComponent params.club if params.club?
query = use_bl: 1
if params.user?
query.user = params.user
query.tag = params.tag if params.tag?
params.title = "@#{params.user}"
else if params.club?
query.club = params.club
params.title = "!#{params.club}"
else if params.tag?
query.tag = params.tag
params.title = "*#{params.tag}"
else
query = {}
@collection = new Posts [], id: params.id, query: query
@view = new PostsView collection: @collection, pageble: params.pageble
@adjustTitle params.title
| Disable use_bl for /top request | Disable use_bl for /top request
| CoffeeScript | cc0-1.0 | Kagami/bnw-meow,border-radius/meow-anon,border-radius/meow-anon |
e0701dc26a7e5e244d0a4ddbdba548a8a19dc00c | test/configfile.coffee | test/configfile.coffee | should = require 'should'
environment = require './shared/environment'
Impromptu = require '../lib/impromptu'
path = require 'path'
exec = require('child_process').exec
describe 'Config File', ->
impromptu = new Impromptu
after (done) ->
tempDir = path.dirname Impromptu::compiledPrompt
exec "rm -rf #{tempDir}", ->
done()
tu = null
it 'should create an instance of Impromptu', ->
tu = new Impromptu()
should.exist tu
it 'should load the config file', ->
impromptu.load()
impromptu.prompt._orderedSections.length.should.be.ok
it 'should build the prompt', (done) ->
impromptu.prompt.build (err, prompt) ->
prompt.should.equal '\u001b[42m\u001b[37m user@host \u001b[0m\u001b[44m\u001b[37m ~/path/to/impromptu \u001b[0m'
done() | should = require 'should'
environment = require './shared/environment'
Impromptu = require '../lib/impromptu'
path = require 'path'
exec = require('child_process').exec
describe 'Config File', ->
impromptu = new Impromptu
after (done) ->
tempDir = path.dirname impromptu.path.compiled
exec "rm -rf #{tempDir}", ->
done()
tu = null
it 'should create an instance of Impromptu', ->
tu = new Impromptu()
should.exist tu
it 'should load the config file', ->
impromptu.load()
impromptu.prompt._orderedSections.length.should.be.ok
it 'should build the prompt', (done) ->
impromptu.prompt.build (err, prompt) ->
prompt.should.equal '\u001b[42m\u001b[37m user@host \u001b[0m\u001b[44m\u001b[37m ~/path/to/impromptu \u001b[0m'
done() | Update compiled prompt path to use new variable name. | Update compiled prompt path to use new variable name.
| CoffeeScript | mit | impromptu/impromptu,impromptu/impromptu |
136ebacf7d2c05aa3b2d37ae59cbb404115fe9f7 | test/test_thing.coffee | test/test_thing.coffee | should = chai.should()
describe 'MyThing', ->
it 'should do stuff', ->
'this thing'.should.not.equal('this thing')
| should = chai.should()
describe 'MyThing', ->
it 'should do stuff', ->
'this thing'.should.equal('this thing')
| Revert "Purposefully fail test - TravisCI integration test" | Revert "Purposefully fail test - TravisCI integration test"
This reverts commit c0d68c398d40c19d2dee9fb7aa50626ee2d79545.
| CoffeeScript | mit | sroze/ngInfiniteScroll,maksimr/ngInfiniteScroll,hlsolutions/ngInfiniteScroll,uzen/angular-infinitescroll,itkin/ngInfiniteScroll,timesqueezer/ngInfiniteScroll,emmafaye/ngInfiniteScroll-PureJS,aisharagheb/ngInfiniteScroll,msbit/ngInfiniteScroll,seawenzhu/ngInfiniteScroll,Tradiio/ngInfiniteScroll,maxamillion32/ngInfiniteScroll,uzen/angular-infinitescroll,yesmeck/ngInfiniteScroll,solomon87/ngInfiniteScroll,suryasingh/ngInfiniteScroll,Manumental32/ngInfiniteScroll,sroze/ngInfiniteScroll,Masadow/ngInfiniteScroll,tianyawy/ngInfiniteScroll,cloudnode-app/ngInfiniteScroll,xuwupeng2000/ngInfiniteScroll,AmitThakkar/ngInfiniteScroll,just-boris/ngInfiniteScroll |
b68ea2fa4705687be9d83030a741a80b0eefe467 | index.coffee | index.coffee | _ = require 'underscore'
module.exports = class BunyanMongo
queue: []
collection: null
options:
collection_name: 'logs'
capped: true
size: 32 * 1024 * 1024
constructor: (options = {}) ->
_.extend @, options
setDB: (db) ->
options = _.pick @options, 'capped', 'size'
db.createCollection @options.collection_name, options, (err, collection) =>
throw err if err
@collection = collection
@dequeueRecords()
dequeueRecords: ->
while @queue.length
@write @queue.shift()
write: (data) ->
if @collection
@collection.insert data, (err) ->
console.error err if err
else
@queue.push data
| _ = require 'underscore'
module.exports = class BunyanMongo
queue: []
collection: null
options:
collection_name: 'logs'
capped: true
size: 32 * 1024 * 1024
constructor: (options = {}) ->
_.extend @options, options
setDB: (db) ->
options = _.pick @options, 'capped', 'size'
db.createCollection @options.collection_name, options, (err, collection) =>
throw err if err
@collection = collection
@dequeueRecords()
dequeueRecords: ->
while @queue.length
@write @queue.shift()
write: (data) ->
if @collection
@collection.insert data, (err) ->
console.error err if err
else
@queue.push data
| Use options passed in constructor | Use options passed in constructor
| CoffeeScript | mit | BlackPearSw/bunyan-mongo |
d7204b2246e3c6c2d07bd8d32e16532586e2ab7a | atom/keymaps/import-js.cson | atom/keymaps/import-js.cson | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://atom.io/docs/latest/behind-atom-keymaps-in-depth
'atom-workspace':
'cmd-shift-j': 'import-js:import'
'cmd-shift-k': 'import-js:goto'
'cmd-shift-i': 'import-js:fix-imports'
# TODO(Joe): I have no idea if these keybindings are any good and didn't give
# them much thought at all, so we should definitely improve this before
# shipping.
| # https://atom.io/docs/latest/behind-atom-keymaps-in-depth
'atom-workspace':
'cmd-shift-j': 'import-js:import'
'cmd-shift-k': 'import-js:goto'
'cmd-shift-i': 'import-js:fix-imports'
| Clean up atom keymaps file | Clean up atom keymaps file
This had a bunch of comments in it that are no longer needed.
| CoffeeScript | mit | trotzig/import-js,trotzig/import-js,Galooshi/import-js,trotzig/import-js |
94092345fa635dac6680a5f490b5bdc0c29eac14 | app/assets/javascripts/application-coffee.js.coffee | app/assets/javascripts/application-coffee.js.coffee | jQuery ->
$('.modal .validate').on 'click', ->
$modal = $(this).closest('.modal')
$form = $modal.find('form')
if $form.length > 0
$form.first().submit()
else
$modal.modal('hide')
#display 'loading...' before some data-remote=true links
$('#top-menu [data-remote="true"], .postit-link [data-remote="true"]').on 'click', ->
$('#loading').fadeIn(150)
#and hide it..
$('.modal').on 'shown', ->
$('#loading').fadeOut(150)
| jQuery ->
$('.modal .validate').on 'click', ->
$modal = $(this).closest('.modal')
$form = $modal.find('form')
if $form.length > 0
$form.first().submit()
else
$modal.modal('hide')
#display 'loading...' before some data-remote=true links
$('#top-menu [data-remote="true"], .postit-link[data-remote="true"]').on 'click', ->
$('#loading').fadeIn(150)
#and hide it..
$('.modal').on 'shown', ->
$('#loading').fadeOut(150)
| Fix typo in previous commit | Fix typo in previous commit
| CoffeeScript | mit | cartoque/cartoque,skylost/cartoque,cartoque/cartoque,jbbarth/cartoque,jbbarth/cartoque,jbbarth/cartoque,skylost/cartoque,cartoque/cartoque |
28b8407db4ae03d93a8e5bf3707cd9792d8c30e4 | src/rate_limiter.coffee | src/rate_limiter.coffee |
class RateLimiter
constructor: (@expiry=10*60)->
@data = {}
okay: (key)=>
check_time = Math.round(new Date().getTime() / 1000)
@clearExpiredKeys(check_time) # Calling here so we don't leak ram by holding expired keys forever
check = @data[key]
if @data[key]
return false
else
@data[key] = check_time + @expiry
return true
clearExpiredKeys: (check_time)=>
for key, time of @data
if time < check_time
console.log "removing #{key} since #{time} < #{check_time}"
#delete @data[key]
module.exports = RateLimiter |
class RateLimiter
constructor: (@expiry=10*60)->
@data = {}
okay: (key)=>
check_time = Math.round(new Date().getTime() / 1000)
@clearExpiredKeys(check_time) # Calling here so we don't leak ram by holding expired keys forever
check = @data[key]
if @data[key]
return false
else
@data[key] = check_time + @expiry
return true
clearExpiredKeys: (check_time)=>
for key, time of @data
if time < check_time
#console.log "removing #{key} since #{time} < #{check_time}"
delete @data[key]
module.exports = RateLimiter
| Fix bug with rate limiter not clearing keys properly. | Fix bug with rate limiter not clearing keys properly. | CoffeeScript | bsd-3-clause | epochwolf/pious-plum |
1c18aac57cade291198556cea8ac74d017911273 | server/redis.coffee | server/redis.coffee | redis = require 'redis'
# Connect to redis
if process.env.REDIS_DB_URL
parts = require("url").parse(process.env.REDIS_DB_URL)
db = redis.createClient(parts.port, parts.hostname)
db.auth(parts.auth.split(":")[1]) if parts.auth
else
db = redis.createClient()
if process.env.NODE_ENV == 'test'
# Select test database
db.select(1)
determineShardSize = (next) ->
return next(determineShardSize.SHARD_SIZE) if determineShardSize.SHARD_SIZE
db.config 'get', 'hash-max-zipmap-entries', (err, results) ->
throw err if err
[key, size] = results if results
determineShardSize.SHARD_SIZE = (if size then Number(size) else 512)
next(determineShardSize.SHARD_SIZE)
determineShardSize.SHARD_SIZE = null
db.shard = (command, key, id, args...) ->
if command[0] != 'h'
throw new Error('Sharding does not work with non-hashes.')
id = Number(id)
determineShardSize (size) ->
[division, remainder] = [ Math.floor(id / size), (id % size) ]
key = [ key, division ].join(':')
db[command](key, remainder, args...)
# Export database variable
module.exports = db
| redis = require 'redis'
# Connect to redis
if process.env.REDIS_DB_URL
parts = require("url").parse(process.env.REDIS_DB_URL)
db = redis.createClient(parts.port, parts.hostname)
db.auth(parts.auth.split(":")[1]) if parts.auth
else
db = redis.createClient()
if process.env.NODE_ENV == 'test'
# Select test database
db.select(1)
db.shard = (command, key, id, args...) ->
if command[0] != 'h'
throw new Error('Sharding does not work with non-hashes.')
[id, size] = [Number(id), 512]
[division, remainder] = [ Math.floor(id / size), (id % size) ]
key = [ key, division ].join(':')
db[command](key, remainder, args...)
# Export database variable
module.exports = db
| Use hardcoded number for shards. | Use hardcoded number for shards.
| CoffeeScript | mit | sarenji/pokebattle-sim,sarenji/pokebattle-sim,sarenji/pokebattle-sim |
d8c0de748508723c10e3e01e9ac5f1a200364e92 | atom/snippets.cson | 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'
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-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'
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson
'.source.elm':
'Doc Comment':
'prefix': 'doc'
'body': """
{-| $1
-}
"""
| Add Elm Doc Comment Snippet | Add Elm Doc Comment Snippet
| CoffeeScript | unlicense | mattdb/dotfiles,mattdb/dotfiles |
44bb81ddf5b22c98787f51974f8c2e303979c2cf | Gulpfile.coffee | Gulpfile.coffee | gulp = require('gulp')
gutil = require('gulp-util')
coffee = require('gulp-coffee')
gulp.task 'coffee', ->
gulp.src('src/*.coffee')
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest('./dist/'))
webserver = require('gulp-webserver')
gulp.task 'serve', ->
gulp.src([
'bower_components'
'demo'
'dist'
])
.pipe webserver
livereload: true
open: true
gulp.task('default', ['coffee'])
| gulp = require('gulp')
gutil = require('gulp-util')
coffee = require('gulp-coffee')
gulp.task 'coffee', ->
gulp.src('src/*.coffee')
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest('./dist/'))
webserver = require('gulp-webserver')
gulp.task 'serve', ->
gulp.src([
'bower_components'
'demo'
'dist'
])
.pipe webserver
livereload: true
open: true
gulp.task 'watch', ->
gulp.watch('src/*.coffee', ['coffee'])
gulp.task('default', ['coffee', 'serve', 'watch']);
| Add source file watch task | Add source file watch task
| CoffeeScript | mit | Sinetheta/angular-multiselect |
320730f712f9fb9b639712f932188f4099a09d6e | assets/js/client.coffee | assets/js/client.coffee | #= require templates/index
#= require_tree templates
#= require_tree models
#= require_tree collections
#= require_tree views
socket = io.connect('http://localhost')
socket.on 'connect', ->
socket.emit 'adduser', prompt("What's your name?"), ->
socket.on 'updatechat', (username, data) ->
$("#messages").append("<p>#{username}: #{data}</p>")
# Attach events to DOM
$(document).on 'keyup', '#chat', (e) ->
if e.which == 13
socket.emit 'sendchat', $(this).val()
$(this).val('')
socket.on 'start battle', (battleId) ->
$(document).on 'click', 'button', ->
socket.emit 'send move', battleId, $(this).text()
$ ->
$builder = $('.builder')
pokemon = new Team(({name: "Bulbasaur"} for x in [0...6]))
builderView = new TeamBuilderView(el: $builder, collection: pokemon)
builderView.render()
| #= require templates/index
#= require_tree templates
#= require_tree models
#= require_tree collections
#= require_tree views
socket = io.connect(window.location.origin)
socket.on 'connect', ->
socket.emit 'adduser', prompt("What's your name?"), ->
socket.on 'updatechat', (username, data) ->
$("#messages").append("<p>#{username}: #{data}</p>")
# Attach events to DOM
$(document).on 'keyup', '#chat', (e) ->
if e.which == 13
socket.emit 'sendchat', $(this).val()
$(this).val('')
socket.on 'start battle', (battleId) ->
$(document).on 'click', 'button', ->
socket.emit 'send move', battleId, $(this).text()
$ ->
$builder = $('.builder')
pokemon = new Team(({name: "Bulbasaur"} for x in [0...6]))
builderView = new TeamBuilderView(el: $builder, collection: pokemon)
builderView.render()
| Use window's origin for connecting socket.io. | Use window's origin for connecting socket.io.
| CoffeeScript | mit | sarenji/pokebattle-sim,sarenji/pokebattle-sim,askii93/battletower,6/battletower,pepijndevos/battletower,sarenji/pokebattle-sim |
f31c102c3cb51e2411d57793f8f52b9786df8f9b | app/assets/javascripts/components/team-table.js.coffee | app/assets/javascripts/components/team-table.js.coffee | {div, table, thead, tbody, tr, th, td} = React.DOM
table_headers = [
"Team"
"Win %"
"Wins"
"Losses"
"Ties"
]
@TeamTable = React.createClass
propTypes:
teams: React.PropTypes.array
calculateWinPercentage: (team) ->
"#{Math.round((team.wins.value / (team.wins.value + team.losses.value + team.ties.value)) * 10000) / 100} %"
render: ->
div className: "league--table-container",
table className: "league--table",
thead className: "league--table-head",
tr className: "league--table-headers",
for header in table_headers
th
key: header
className: "league--table-header"
header
tbody className: "league--table-body",
for team in @props.teams
tr
key: team["name"]
className: "league--table-row"
td className: "league--table-cell", team["name"]
td className: "league--table-cell",
@calculateWinPercentage(team)
td className: "league--table-cell", team["wins"]["value"]
td className: "league--table-cell", team["losses"]["value"]
td className: "league--table-cell", team["ties"]["value"]
| {div, table, thead, tbody, tr, th, td, p} = React.DOM
table_headers = [
"Team"
"Win %"
"Wins"
"Losses"
"Ties"
]
@TeamTable = React.createClass
propTypes:
teams: React.PropTypes.array
calculateWinPercentage: (team) ->
"#{Math.round((team.wins.value / (team.wins.value + team.losses.value + team.ties.value)) * 10000) / 100} %"
render: ->
div className: "league--table-container",
p className: "league--table-disclaimer",
"Standings from 2011 through 2015."
table className: "league--table",
thead className: "league--table-head",
tr className: "league--table-headers",
for header in table_headers
th
key: header
className: "league--table-header"
header
tbody className: "league--table-body",
for team in @props.teams
tr
key: team["name"]
className: "league--table-row"
td className: "league--table-cell", team["name"]
td className: "league--table-cell",
@calculateWinPercentage(team)
td className: "league--table-cell", team["wins"]["value"]
td className: "league--table-cell", team["losses"]["value"]
td className: "league--table-cell", team["ties"]["value"]
| Add seasons accounted for disclaimer above team table | Add seasons accounted for disclaimer above team table
| CoffeeScript | mit | maxkohl88/fantasy_tracker,maxkohl88/fantasy_tracker,maxkohl88/fantasy_tracker |
59dd05b9cc55525c1901d2c414ca1dab40400521 | src/projects.coffee | src/projects.coffee | exports.findMainGraph = (project) ->
return null unless project.graphs.length
if project.main
# Ensure currently set main graph exists
for graph in project.graphs
return project.main if graph.properties.id is project.main
# No 'main' graph sent, see if we can make a smart choice
for graph in project.graphs
return graph.properties.id if graph.name is 'main'
return graph.properties.id if graph.properties.main
return null
exports.getProjectHash = (project, callback) ->
unless project.graphs.length
if project.components.length
# No graphs in this project, but there are components
callback null, [
'project'
project.id
'component'
project.components[0].name
]
return
setTimeout ->
# Wait for graphs to be populated
if not project.graphs.length and not project.components.length
return callback new Error "Project #{project.id} has no graphs or components"
exports.getProjectHash project, callback
, 100
return
# Open main graph, or the first graph
main = project.main or project.graphs[0].properties.id
unless main
return callback new Error "Unable find a main graph for project #{project.id}"
callback null, [
'project'
project.id
main
]
return
| exports.findMainGraph = (project) ->
return null unless project.graphs.length
if project.main
# Ensure currently set main graph exists
for graph in project.graphs
return project.main if graph.properties.id is project.main
# No 'main' graph sent, see if we can make a smart choice
for graph in project.graphs
return graph.properties.id if graph.name is 'main'
return graph.properties.id if graph.properties.main
# No suitable graph found, use first
return project.graphs[0].properties.id
exports.getProjectHash = (project, callback) ->
unless project.graphs.length
if project.components.length
# No graphs in this project, but there are components
callback null, [
'project'
project.id
'component'
project.components[0].name
]
return
setTimeout ->
# Wait for graphs to be populated
if not project.graphs.length and not project.components.length
return callback new Error "Project #{project.id} has no graphs or components"
exports.getProjectHash project, callback
, 100
return
# Open main graph, or the first graph
main = project.main or project.graphs[0].properties.id
unless main
return callback new Error "Unable find a main graph for project #{project.id}"
callback null, [
'project'
project.id
main
]
return
| Set first graph as main if no other suitable is found | Set first graph as main if no other suitable is found
| CoffeeScript | mit | noflo/noflo-ui,noflo/noflo-ui |
44b8550d04e6de43004f2951c455f6567c61e3d4 | app/static/coffee/index.coffee | app/static/coffee/index.coffee | window.coviolations ?=
views: {}
models: {}
$ ->
NProgress.start()
NProgress.inc()
app = window.coviolations
waitRendering = 2
renderFinished = =>
NProgress.inc()
waitRendering -= 1
if waitRendering == 0
NProgress.done()
renderProjects = =>
projectCollection = new app.models.UserProjectCollection
projectCollection.fetch
data:
limit: 0
success: (collection) =>
if collection.meta.total_count
projectView = new app.views.ManageProjectsView
el: $('.js-enabled-projects')
collection: collection
projectView.on 'renderFinished', $.proxy renderFinished, @
projectView.render()
else
$('.js-enabled-projects td').html 'No projects found'
renderProjects()
window.push.on 'project', =>
renderProjects()
renderTasks = =>
taskCollection = new app.models.TaskCollection()
taskCollection.fetch
data:
limit: 20
with_violations: true
self: true
success: (collection) ->
taskView = new app.views.TaskLineListView
el: $('.js-last-tasks')
collection: collection
showProjectName: true
taskView.on 'renderFinished', $.proxy renderFinished, @
taskView.render()
renderTasks()
window.push.on 'task', =>
renderTasks()
prettyPrint()
| window.coviolations ?=
views: {}
models: {}
$ ->
NProgress.start()
NProgress.inc()
app = window.coviolations
waitRendering = 2
renderFinished = =>
NProgress.inc()
waitRendering -= 1
if waitRendering <= 0
NProgress.done()
renderProjects = =>
projectCollection = new app.models.UserProjectCollection
projectCollection.fetch
data:
limit: 0
success: (collection) =>
if collection.meta.total_count
projectView = new app.views.ManageProjectsView
el: $('.js-enabled-projects')
collection: collection
projectView.on 'renderFinished', $.proxy renderFinished, @
projectView.render()
else
$('.js-enabled-projects td').html 'No projects found'
renderProjects()
window.push.on 'project', =>
renderProjects()
renderTasks = =>
taskCollection = new app.models.TaskCollection()
taskCollection.fetch
data:
limit: 20
with_violations: true
self: true
success: (collection) ->
taskView = new app.views.TaskLineListView
el: $('.js-last-tasks')
collection: collection
showProjectName: true
taskView.on 'renderFinished', $.proxy renderFinished, @
taskView.render()
renderTasks()
window.push.on 'task', =>
renderTasks()
prettyPrint()
| Fix progress bar with push | Fix progress bar with push
| CoffeeScript | mit | nvbn/coviolations_web,nvbn/coviolations_web |
909421129238a996e56e7c6ddff23ef00e4a9821 | src/tools/Eraser.coffee | src/tools/Eraser.coffee | Pencil = require './pencil'
{createShape} = require '../core/shapes'
module.exports = class Eraser extends Pencil
name: 'Eraser'
iconName: 'eraser'
constructor: () ->
@strokeWidth = 10
makePoint: (x, y, lc) ->
createShape('Point', {x, y, size: @strokeWidth, color: '#000'})
makeShape: -> createShape('ErasedLinePath')
| Pencil = require './Pencil'
{createShape} = require '../core/shapes'
module.exports = class Eraser extends Pencil
name: 'Eraser'
iconName: 'eraser'
constructor: () ->
@strokeWidth = 10
makePoint: (x, y, lc) ->
createShape('Point', {x, y, size: @strokeWidth, color: '#000'})
makeShape: -> createShape('ErasedLinePath')
| Fix Pencil import on case sensitive filesystems | Fix Pencil import on case sensitive filesystems
| CoffeeScript | bsd-2-clause | ivanisidrowu/literallycanvas,irskep/literallycanvas,ivanisidrowu/literallycanvas,irskep/lc-demo,shawinder/literallycanvas,irskep/lc-demo,178620086/literallycanvas,aiwenlg007/literallycanvas,178620086/literallycanvas,shawinder/literallycanvas,bartuspan/literallycanvas,literallycanvas/literallycanvas,bartuspan/literallycanvas,aiwenlg007/literallycanvas |
0fb417b86cae0fae5e63de00857c57acb5815f2c | src/main/webapp/coffeescripts-hidden/landing.coffee | src/main/webapp/coffeescripts-hidden/landing.coffee | # use the first element that is "scrollable"
# http://css-tricks.com/snippets/jquery/smooth-scrolling/
scrollableElement = (els) ->
for el in arguments
$scrollElement = $(el)
if $scrollElement.scrollTop() > 0
return el
else
$scrollElement.scrollTop(1)
isScrollable = $scrollElement.scrollTop() > 0
$scrollElement.scrollTop(0)
if isScrollable
return el
return [];
$(document).ready ->
$('.footer-navigation a').tipsy
gravity: 'w'
fade: true
opacity: 0.9
$('body').on 'click', '.get-started-now', ->
$targetElem = $("section.plans-and-pricing")
targetTop = $targetElem.offset().top
scrollableElem = scrollableElement('html', 'body')
$(scrollableElem).animate({scrollTop: targetTop}, 600)
| # use the first element that is "scrollable"
# http://css-tricks.com/snippets/jquery/smooth-scrolling/
scrollableElement = (els) ->
for el in arguments
$scrollElement = $(el)
if $scrollElement.scrollTop() > 0
return el
else
$scrollElement.scrollTop(1)
isScrollable = $scrollElement.scrollTop() > 0
$scrollElement.scrollTop(0)
if isScrollable
return el
return [];
$(document).ready ->
$('.footer-navigation a')
.click(false)
.tipsy
gravity: 'w'
fade: true
opacity: 0.9
$('body').on 'click', '.get-started-now', ->
$targetElem = $("section.plans-and-pricing")
targetTop = $targetElem.offset().top
scrollableElem = scrollableElement('html', 'body')
$(scrollableElem).animate({scrollTop: targetTop}, 600)
| Disable footer links that don't work. | Disable footer links that don't work.
| CoffeeScript | apache-2.0 | farmdawgnation/anchortab,farmdawgnation/anchortab,farmdawgnation/anchortab,farmdawgnation/anchortab |
14676dfb9c0278eef82942c74dcd20d093650c7a | core/app/backbone/factlink/local_storage_text_model.coffee | core/app/backbone/factlink/local_storage_text_model.coffee | Backbone.Factlink ||= {}
class Backbone.Factlink.LocalStorageTextModel extends Backbone.Model
constructor: (attributes, options) ->
super
@set 'text', localStorage?[options.key] ? ''
@on 'change:text', (model, value) ->
localStorage[options.key] = value if localStorage?
| Backbone.Factlink ||= {}
class Backbone.Factlink.LocalStorageTextModel extends Backbone.Model
constructor: (attributes, options) ->
super
@set 'text', sessionStorage?[options.key] ? ''
@on 'change:text', (model, value) ->
sessionStorage[options.key] = value if sessionStorage?
| Use session storage instead of local storage | Use session storage instead of local storage
untested
| CoffeeScript | mit | Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core |
d07f52c5211166e9eb6eb3583bd87b61ea72f051 | client/app/lib/datadogmetrics.coffee | client/app/lib/datadogmetrics.coffee | kd = require 'kd'
KDObject = kd.Object
remote = require('app/remote').getInstance()
module.exports = class DatadogMetrics extends KDObject
@buffer = kd.utils.dict()
@collect = (name, state, count = 1) ->
key = "#{name}:#{state}"
@buffer[key] ?= 0
@buffer[key] += count
@send = ->
return if @inProgress
keys = Object.keys @buffer
return unless keys.length
@inProgress = yes
metrics = kd.utils.dict()
data = []
for key in keys when (count = @buffer[key]) > 0
metrics[key] = count
data.push "#{key}:#{count}"
return unless data.length
remote.api.DataDog.sendMetrics data, (err) =>
return console.error 'Metrics:', err if err
for key in Object.keys metrics
@buffer[key] -= metrics[key]
@inProgress = no
remote.once 'ready', ->
do ->
kd.utils.repeat 5 * 1000, -> DatadogMetrics.send()
| kd = require 'kd'
KDObject = kd.Object
remote = require('app/remote').getInstance()
module.exports = class DatadogMetrics extends KDObject
@buffer = kd.utils.dict()
@collect = (name, state, count = 1) ->
key = "#{name}:#{state}"
@buffer[key] ?= 0
@buffer[key] += count
@send = ->
return if @inProgress
keys = Object.keys @buffer
return unless keys.length
@inProgress = yes
metrics = kd.utils.dict()
data = []
for key in keys when (count = @buffer[key]) > 0
metrics[key] = count
data.push "#{key}:#{count}"
return unless data.length
remote.api.DataDog.sendMetrics data, (err) =>
return console.error 'Metrics:', err if err
for key in Object.keys metrics
@buffer[key] -= metrics[key]
@inProgress = no
interval = null
startInterval = ->
return if interval
interval = kd.utils.repeat 5 * 1000, -> DatadogMetrics.send()
stopInterval = ->
kd.utils.killRepeat interval
interval = null
remote.on 'connected', ->
return if interval
{ mainController } = kd.singletons
mainController.on 'AccountChanged', (account) ->
if account.type is 'registered'
then startInterval()
else stopInterval()
remote.on 'disconnected', stopInterval
| Send metric data once client is logged in | Send metric data once client is logged in
| CoffeeScript | agpl-3.0 | gokmen/koding,szkl/koding,acbodine/koding,drewsetski/koding,cihangir/koding,mertaytore/koding,gokmen/koding,gokmen/koding,acbodine/koding,koding/koding,jack89129/koding,usirin/koding,acbodine/koding,usirin/koding,drewsetski/koding,gokmen/koding,andrewjcasal/koding,rjeczalik/koding,cihangir/koding,sinan/koding,sinan/koding,mertaytore/koding,sinan/koding,alex-ionochkin/koding,kwagdy/koding-1,jack89129/koding,szkl/koding,jack89129/koding,usirin/koding,kwagdy/koding-1,drewsetski/koding,mertaytore/koding,andrewjcasal/koding,usirin/koding,usirin/koding,usirin/koding,andrewjcasal/koding,andrewjcasal/koding,koding/koding,szkl/koding,alex-ionochkin/koding,jack89129/koding,jack89129/koding,rjeczalik/koding,andrewjcasal/koding,szkl/koding,gokmen/koding,alex-ionochkin/koding,kwagdy/koding-1,acbodine/koding,acbodine/koding,szkl/koding,sinan/koding,drewsetski/koding,szkl/koding,rjeczalik/koding,drewsetski/koding,koding/koding,rjeczalik/koding,jack89129/koding,koding/koding,kwagdy/koding-1,andrewjcasal/koding,acbodine/koding,cihangir/koding,alex-ionochkin/koding,usirin/koding,andrewjcasal/koding,rjeczalik/koding,alex-ionochkin/koding,gokmen/koding,mertaytore/koding,szkl/koding,gokmen/koding,andrewjcasal/koding,kwagdy/koding-1,koding/koding,alex-ionochkin/koding,acbodine/koding,rjeczalik/koding,cihangir/koding,koding/koding,kwagdy/koding-1,jack89129/koding,cihangir/koding,rjeczalik/koding,sinan/koding,usirin/koding,cihangir/koding,koding/koding,mertaytore/koding,mertaytore/koding,kwagdy/koding-1,alex-ionochkin/koding,sinan/koding,mertaytore/koding,acbodine/koding,koding/koding,cihangir/koding,drewsetski/koding,rjeczalik/koding,alex-ionochkin/koding,cihangir/koding,sinan/koding,drewsetski/koding,jack89129/koding,szkl/koding,kwagdy/koding-1,gokmen/koding,sinan/koding,mertaytore/koding,drewsetski/koding |
32a6e865f6dfb6f269ab8511d64bc5b77c7e50d3 | client/src/scripts/frame-view.coffee | client/src/scripts/frame-view.coffee | Steam.FrameView = (_, _frame) ->
createCompatibleModelItem = (model) ->
key: model.key
algorithm: model.model_algorithm
category: model.model_category
responseColumnName: model.response_column_name
createColumnItem = (name) -> name: name
loadCompatibleModels = ->
_.switchToModels type: 'compatibleWithFrame', frameKey: _frame.key
data: _frame
key: _frame.key
timestamp: _frame.creation_epoch_time_millis
title: _frame.key
columns: map _frame.column_names, createColumnItem
columnCount: "(#{_frame.column_names.length})"
compatibleModels: map _frame.compatible_models, createCompatibleModelItem
compatibleModelsCount: _frame.compatible_models.length
hasCompatibleModels: _frame.compatible_models.length > 0
loadCompatibleModels: loadCompatibleModels
isRawFrame: _frame.is_raw_frame
parseUrl: "/2/Parse2.query?source_key=#{encodeURIComponent _frame.key}"
dispose: ->
template: 'frame-view'
| Steam.FrameView = (_, _frame) ->
createCompatibleModelItem = (model) ->
key: model.key
algorithm: model.model_algorithm
category: model.model_category
responseColumnName: model.response_column_name
createColumnItem = (name) -> name: name
loadCompatibleModels = ->
_.switchToModels type: 'compatibleWithFrame', frameKey: _frame.key
data: _frame
key: _frame.key
timestamp: _frame.creation_epoch_time_millis
title: _frame.key
columns: map _frame.column_names, createColumnItem
columnCount: "(#{_frame.column_names.length})"
compatibleModels: map _frame.compatible_models, createCompatibleModelItem
compatibleModelsCount: "(#{_frame.compatible_models.length})"
hasCompatibleModels: _frame.compatible_models.length > 0
loadCompatibleModels: loadCompatibleModels
isRawFrame: _frame.is_raw_frame
parseUrl: "/2/Parse2.query?source_key=#{encodeURIComponent _frame.key}"
dispose: ->
template: 'frame-view'
| Add parens for model counts | Add parens for model counts
| CoffeeScript | apache-2.0 | h2oai/h2o-2,eg-zhang/h2o-2,111t8e/h2o-2,111t8e/h2o-2,eg-zhang/h2o-2,111t8e/h2o-2,eg-zhang/h2o-2,calvingit21/h2o-2,eg-zhang/h2o-2,100star/h2o,100star/h2o,111t8e/h2o-2,rowhit/h2o-2,vbelakov/h2o,calvingit21/h2o-2,rowhit/h2o-2,111t8e/h2o-2,vbelakov/h2o,h2oai/h2o-2,111t8e/h2o-2,h2oai/h2o-2,100star/h2o,h2oai/h2o,h2oai/h2o,vbelakov/h2o,elkingtonmcb/h2o-2,elkingtonmcb/h2o-2,rowhit/h2o-2,elkingtonmcb/h2o-2,elkingtonmcb/h2o-2,vbelakov/h2o,100star/h2o,calvingit21/h2o-2,elkingtonmcb/h2o-2,vbelakov/h2o,h2oai/h2o,vbelakov/h2o,calvingit21/h2o-2,h2oai/h2o,calvingit21/h2o-2,elkingtonmcb/h2o-2,100star/h2o,rowhit/h2o-2,elkingtonmcb/h2o-2,100star/h2o,elkingtonmcb/h2o-2,eg-zhang/h2o-2,eg-zhang/h2o-2,h2oai/h2o,vbelakov/h2o,calvingit21/h2o-2,rowhit/h2o-2,111t8e/h2o-2,calvingit21/h2o-2,h2oai/h2o-2,111t8e/h2o-2,elkingtonmcb/h2o-2,rowhit/h2o-2,elkingtonmcb/h2o-2,111t8e/h2o-2,rowhit/h2o-2,h2oai/h2o-2,100star/h2o,rowhit/h2o-2,calvingit21/h2o-2,vbelakov/h2o,rowhit/h2o-2,100star/h2o,calvingit21/h2o-2,h2oai/h2o,h2oai/h2o,111t8e/h2o-2,h2oai/h2o-2,h2oai/h2o-2,h2oai/h2o-2,vbelakov/h2o,eg-zhang/h2o-2,h2oai/h2o,vbelakov/h2o,eg-zhang/h2o-2,100star/h2o,eg-zhang/h2o-2,h2oai/h2o-2,eg-zhang/h2o-2,rowhit/h2o-2,h2oai/h2o,h2oai/h2o,h2oai/h2o-2,calvingit21/h2o-2 |
3e3d70b3129a6f68cda773d033be746523e2a33e | ansible/roles/atom/config_files/config.cson | ansible/roles/atom/config_files/config.cson | "*":
"exception-reporting":
userId: "41cbedc9-3477-568d-cd05-8df535ad8564"
welcome:
showOnStartup: false
core:
projectHome: "/Users/joseangel/Workspace"
themes: [
"one-dark-ui"
"monokai"
]
editor:
invisibles: {}
tabLength: 4
"one-dark-ui": {}
"atom-beautify":
_analyticsUserId: "b64fba17-eb1c-422a-9a39-23a43a36c424"
emmet: {}
| "*":
"exception-reporting":
userId: "41cbedc9-3477-568d-cd05-8df535ad8564"
welcome:
showOnStartup: false
core:
projectHome: "/Users/joseangel/Workspace"
themes: [
"one-dark-ui"
"monokai"
]
editor:
invisibles: {}
tabLength: 4
"one-dark-ui": {}
"atom-beautify":
_analyticsUserId: "b64fba17-eb1c-422a-9a39-23a43a36c424"
emmet: {}
"tree-view":
hideIgnoredNames: true
| Add ignore files to tree view | Add ignore files to tree view
| CoffeeScript | mit | rrequero/dotfiles |
f92b584f7b3782976398000fd05913aff79f05c0 | app/assets/javascripts/download-menu.coffee | app/assets/javascripts/download-menu.coffee | show_download_menu = ->
$("#download-menu").slideDown duration: 200
setTimeout hide_download_menu, 20000
$("#download-link").html "cancel"
return
hide_download_menu = ->
$("#download-menu").slideUp duration: 200
$("#download-link").html "download"
return
toggle_download_menu = ->
if $("#download-link").html() is "download"
show_download_menu()
else
hide_download_menu()
return
| @show_download_menu = ->
$("#download-menu").slideDown duration: 200
setTimeout hide_download_menu, 20000
$("#download-link").html "cancel"
return
@hide_download_menu = ->
$("#download-menu").slideUp duration: 200
$("#download-link").html "download"
return
@toggle_download_menu = ->
if $("#download-link").html() is "download"
show_download_menu()
else
hide_download_menu()
return
| Fix a bug where the download menu wouldn't appear | Fix a bug where the download menu wouldn't appear
| CoffeeScript | agpl-3.0 | BatedUrGonnaDie/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,glacials/splits-io |
0c91fa2fa7d92ad996211a71650167cab445a6e5 | plugins/pivotal-tracker/index.coffee | plugins/pivotal-tracker/index.coffee | NotificationPlugin = require "../../notification-plugin"
class PivotalTracker extends NotificationPlugin
stacktraceLines = (stacktrace) ->
("#{line.file}:#{line.lineNumber} - #{line.method}" for line in stacktrace when line.inProject)
@receiveEvent: (config, event) ->
# Build the request
params =
"story[name]": "#{event.error.exceptionClass} in #{event.error.context}"
"story[story_type]": "bug"
"story[labels]": "bugsnag"
"story[description]":
"""
*#{event.error.exceptionClass}* in *#{event.error.context}*
#{event.error.message if event.error.message}
#{event.error.url}
*Stacktrace:*
#{stacktraceLines(event.error.stacktrace).join("\n")}
"""
# Send the request to the url
@request
.post("http://www.pivotaltracker.com/services/v3/projects/#{config.projectId}/stories")
.set("X-TrackerToken", config.apiToken)
.type("form")
.send(params)
.buffer(true)
.end((res) ->
if res?.text
console.log res.text
else
console.log "No response from pivotal! Status #{res.status}"
);
module.exports = PivotalTracker | NotificationPlugin = require "../../notification-plugin"
class PivotalTracker extends NotificationPlugin
stacktraceLines = (stacktrace) ->
("#{line.file}:#{line.lineNumber} - #{line.method}" for line in stacktrace when line.inProject)
@receiveEvent: (config, event) ->
# Build the request
params =
"story[name]": "#{event.error.exceptionClass} in #{event.error.context}"
"story[story_type]": "bug"
"story[labels]": "bugsnag"
"story[description]":
"""
*#{event.error.exceptionClass}* in *#{event.error.context}*
#{event.error.message if event.error.message}
#{event.error.url}
*Stacktrace:*
#{stacktraceLines(event.error.stacktrace).join("\n")}
"""
# Send the request to the url
@request
.post("https://www.pivotaltracker.com/services/v3/projects/#{config.projectId}/stories")
.set("X-TrackerToken", config.apiToken)
.type("form")
.send(params)
.buffer(true)
.end((res) ->
if res && res.status != 200
console.log "Status code: #{res.status}"
console.log res.text || "No response from pivotal!"
);
module.exports = PivotalTracker | Use https for pivotal plugin | Use https for pivotal plugin
| CoffeeScript | mit | cagedata/bugsnag-notification-plugins,jacobmarshall/bugsnag-notification-plugins,pushed/bugsnag-notification-plugins,6wunderkinder/bugsnag-notification-plugins,korealert/bugsnag-notification-plugins,korealert/bugsnag-notification-plugins,sharesight/bugsnag-notification-plugins,indirect/bugsnag-notification-plugins,6wunderkinder/bugsnag-notification-plugins,kstream001/bugsnag-notification-plugins |
b817fc4785afae05f8a4e336eedcc3397c121143 | src/kissmetrics-batch.coffee | src/kissmetrics-batch.coffee | # # Kissmetrics Batch
class BatchKissmetricsClient
@HOST: 'api.kissmetrics.com'
@HTTP_METHOD: 'POST'
constructor: (@options) ->
@queue = options.queue
@_validate_queue @queue
add: (timestamp, data) ->
data.timestamp = timestamp
@_transformData data
@queue.add data
get: ->
@queue.get()
process: ->
queue = @get()
_transformData: (data) ->
data.identity = data._p
delete data._p
if data.type is 'record'
data.event = data._n
delete data._n
if data.type is 'alias'
data.alias = data._n
delete data._n
delete data.type
_validate_queue: ->
for required_method in ['add', 'get']
unless typeof @queue[required_method] is 'function'
throw new Error "Missing method: #{required_method}"
module.exports = BatchKissmetricsClient
| # # Kissmetrics Batch
class BatchKissmetricsClient
@HOST: 'api.kissmetrics.com'
@HTTP_METHOD: 'POST'
@process: (apiKey) ->
queue = @get()
constructor: (@options) ->
@queue = options.queue
@_validate_queue @queue
add: (timestamp, data) ->
data.timestamp = timestamp
@_transformData data
@queue.add data
get: ->
@queue.get()
_transformData: (data) ->
data.identity = data._p
delete data._p
if data.type is 'record'
data.event = data._n
delete data._n
if data.type is 'alias'
data.alias = data._n
delete data._n
delete data.type
_validate_queue: ->
for required_method in ['add', 'get']
unless typeof @queue[required_method] is 'function'
throw new Error "Missing method: #{required_method}"
module.exports = BatchKissmetricsClient
| Make process() a static method on batch client | Make process() a static method on batch client
Accept api key argument
| CoffeeScript | mit | evansolomon/kissmetrics-js,evansolomon/kissmetrics-js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.