Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Use screen_name instead of name | # detect tweet URL and send tweet content
module.exports = (robot) ->
robot.hear /https?:\/\/(mobile\.)?twitter\.com\/.*?\/status\/([0-9]+)/i, (msg) ->
msg.http("https://api.twitter.com/1/statuses/show/#{msg.match[2]}.json").get() (err, res, body) ->
return if err or (res.statusCode != 200)
tweet = JSON.parse... | # detect tweet URL and send tweet content
module.exports = (robot) ->
robot.hear /https?:\/\/(mobile\.)?twitter\.com\/.*?\/status\/([0-9]+)/i, (msg) ->
msg.http("https://api.twitter.com/1/statuses/show/#{msg.match[2]}.json").get() (err, res, body) ->
return if err or (res.statusCode != 200)
tweet = JSON.parse... |
Make Homepage field clickable/a hyperlink | # Copyright (c) 2015 Markus Kohlhase <mail@markus-kohlhase.de>
React = require "react"
PureMixin = require "react-pure-render/mixin"
{ NAMES, CSS_CLASSES } = require "../constants/Categories"
{ div, p, h3, button, span, i } = React.DOM
module.exports = React.createClass
displayName: "EntryDetails"
mixins:... | # Copyright (c) 2015 Markus Kohlhase <mail@markus-kohlhase.de>
React = require "react"
PureMixin = require "react-pure-render/mixin"
{ NAMES, CSS_CLASSES } = require "../constants/Categories"
{ div, p, h3, button, span, i, a } = React.DOM
module.exports = React.createClass
displayName: "EntryDetails"
mixi... |
Decrease number of attemts to make sure to fin in browser timeout | import logger from '../log'
request = require('request-promise-native')
sleep = (milliseconds) ->
return new Promise((resolve) -> setTimeout(resolve, milliseconds))
export default download = (href, jar, options) ->
logger.debug "Downloading", href
if not jar
jar = request.jar()
delay = 5
f... | import logger from '../log'
request = require('request-promise-native')
sleep = (milliseconds) ->
return new Promise((resolve) -> setTimeout(resolve, milliseconds))
export default download = (href, jar, options) ->
logger.debug "Downloading", href
if not jar
jar = request.jar()
delay = 5
f... |
Update language to match default | AccountsEntry =
settings:
wrapLinks: true
homeRoute: '/home'
dashboardRoute: '/dashboard'
passwordSignupFields: 'EMAIL_ONLY'
config: (appConfig) ->
@settings = _.extend(@settings, appConfig)
i18n.setDefaultLanguage "en_US"
if appConfig.language
i18n.setLanguage appConfig.language... | AccountsEntry =
settings:
wrapLinks: true
homeRoute: '/home'
dashboardRoute: '/dashboard'
passwordSignupFields: 'EMAIL_ONLY'
config: (appConfig) ->
@settings = _.extend(@settings, appConfig)
i18n.setDefaultLanguage "en"
if appConfig.language
i18n.setLanguage appConfig.language
... |
Synchronize the fancy toggle its related form on load | ###
# Copyright 2015-2017 ppy Pty. Ltd.
#
# This file is part of osu!web. osu!web is distributed with the hope of
# attracting more community contributions to the core ecosystem of osu!.
#
# osu!web is free software: you can redistribute it and/or modify
# it under the terms of the Affero GNU General Pub... | ###
# Copyright 2015-2017 ppy Pty. Ltd.
#
# This file is part of osu!web. osu!web is distributed with the hope of
# attracting more community contributions to the core ecosystem of osu!.
#
# osu!web is free software: you can redistribute it and/or modify
# it under the terms of the Affero GNU General Pub... |
Add context menu items to open related files | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
'context-menu':
'atom-text-editor': [
{
'label': 'Toggle titanium'
'command': 'titanium:toggle'
}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'titanium'
'submenu': [
... | 'context-menu':
'atom-text-editor': [
{
'label': 'Alloy'
'submenu': [
{
'label': 'Open view'
'command': 'titanium:openView'
}
{
'label': 'Open style'
'command': 'titanium:openStyle'
}
{
'label': 'Open controller'... |
Add default sort and sets cookie when sort changes | Backbone = require 'backbone'
cookies = require 'cookies-js'
{ keys, each } = require 'underscore'
module.exports = class State extends Backbone.Model
defaults:
view_mode: 'grid'
lightbox: false
initialize: ->
# set values from cookies
each keys(@defaults), (key) =>
@set(key, val) if val = c... | Backbone = require 'backbone'
cookies = require 'cookies-js'
{ keys, each } = require 'underscore'
module.exports = class State extends Backbone.Model
defaults:
view_mode: 'grid'
lightbox: false
sort: 'updated_at'
initialize: ->
# set values from cookies
each keys(@defaults), (key) =>
@s... |
Return no when clicked to prevent node changing on sidebar. | class AddWorkspaceView extends KDCustomHTMLView
constructor: (options = {}, data) ->
options.cssClass = 'add-workpace-view'
super options, data
@addSubView new KDCustomHTMLView tagName: 'figure'
@addSubView @input = new KDInputView
type : 'text'
keydown : @bound 'handleKeyDown'
... | class AddWorkspaceView extends KDCustomHTMLView
constructor: (options = {}, data) ->
options.cssClass = 'add-workpace-view'
super options, data
@addSubView new KDCustomHTMLView tagName: 'figure'
@addSubView @input = new KDInputView
type : 'text'
keydown : @bound 'handleKeyDown'
... |
Send explicit parameters in channel subscription | App.todo = App.cable.subscriptions.create "TodoChannel",
connected: ->
# Called when the subscription is ready for use on the server
disconnected: ->
# Called when the subscription has been terminated by the server
| App.todo = App.cable.subscriptions.create {
channel: "TodoChannel"
},
connected: ->
# Called when the subscription is ready for use on the server
disconnected: ->
# Called when the subscription has been terminated by the server
|
Define views for Room management | App.UsersIndexView = Ember.View.extend
layoutName: "settings"
classNames: ["settings"]
App.UsersNewView = Ember.View.extend
layoutName: "settings"
classNames: ["settings"]
App.UserEditView = Ember.View.extend
layoutName: "settings"
classNames: ["settings"]
App.RoomsView = Ember.View.extend
layoutName: ... | App.UsersIndexView = Ember.View.extend
layoutName: "settings"
classNames: ["settings"]
App.UsersNewView = Ember.View.extend
layoutName: "settings"
classNames: ["settings"]
App.UserEditView = Ember.View.extend
layoutName: "settings"
classNames: ["settings"]
App.RoomsIndexView = Ember.View.extend
layoutN... |
Add comments to ipkg grammar | name: 'Idris Ipkg'
scopeName: 'source.ipkg'
fileTypes: ['ipkg']
patterns:
[
{
name: 'keyword.control.ipkg'
match: '\\b(package|opts|modules|sourcedir|makefile|objs|executable|main|libs|pkgs|tests)\\b'
}
{
name: 'string.quoted.double.ipkg'
begin: '"'
end: '"'
}
]
| name: 'Idris Ipkg'
scopeName: 'source.ipkg'
fileTypes: ['ipkg']
patterns:
[
{
name: 'comment.line.ipkg'
match: '(--).*$\n?'
comment: 'Line comment'
}
{
name: 'comment.block.ipkg'
begin: '\\{-'
end: '-\\}'
comment: 'Block comment'
}
{
name: 'keyword.c... |
Support content with '/' in the id | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!controllers/routing'
], ($, _, Backbone, Marionette, routerController) ->
return new (Marionette.AppRouter.extend
controller: routerController
appRoutes:
'': 'workspace' # Show the workspace list of content
'workspac... | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!controllers/routing'
], ($, _, Backbone, Marionette, routerController) ->
return new (Marionette.AppRouter.extend
controller: routerController
appRoutes:
'': 'workspace' # Show the workspace list of content
'workspac... |
Remove bower components from distro | "use strict"
pathUtils = require("path")
glob = require("glob")
fs = require("fs")
module.exports = (grunt) ->
grunt = (require 'grunt-utilities') grunt
grunt.initConfig
name: 'tree_search'
bower:
install:
options:
install: yes
targetDir: '.tmp'
cleanup: no
... | "use strict"
pathUtils = require("path")
glob = require("glob")
fs = require("fs")
module.exports = (grunt) ->
grunt = (require 'grunt-utilities') grunt
grunt.initConfig
name: 'tree_search'
bower:
install:
options:
install: yes
targetDir: '.tmp'
cleanup: no
... |
Set editorPane as default activeTabView. | class IDEAppController extends AppController
KD.registerAppClass this,
name : "IDE"
route : "/:name?/IDE"
behavior : "application"
preCondition :
condition : (options, cb)-> cb KD.isLoggedIn()
failure : (options, cb)->
KD.singletons.appManager.open 'IDE', co... | class IDEAppController extends AppController
KD.registerAppClass this,
name : "IDE"
route : "/:name?/IDE"
behavior : "application"
preCondition :
condition : (options, cb)-> cb KD.isLoggedIn()
failure : (options, cb)->
KD.singletons.appManager.open 'IDE', co... |
Move background argument closer to input arguments | path = require('path')
gm = require('gm')
imageMagick = gm.subClass({ imageMagick: true })
class Imager
minSize: 40
maxSize: 400
combine: (face, size, callback) ->
if callback?
size = @_parseSize(size)
else
callback = size
size = width: @maxSize, height: @maxSize
i... | path = require('path')
gm = require('gm')
imageMagick = gm.subClass({ imageMagick: true })
class Imager
minSize: 40
maxSize: 400
combine: (face, size, callback) ->
if callback?
size = @_parseSize(size)
else
callback = size
size = width: @maxSize, height: @maxSize
i... |
Deal with http requests using phantomjs | fs = require('fs')
url = require('url')
http = require('http')
https = require('https')
module.exports = class Reader
messages =
noSourceError: 'a valid source must be provided'
httpStatusError: 'http status'
source: null
sourceType: null
constructor: (@source) ->
return unless @source
... | fs = require('fs')
url = require('url')
through = require('through')
phantom = require('phantom')
module.exports = class Reader
messages =
noSourceError: 'a valid source must be provided'
httpStatusError: 'http status'
source: null
sourceType: null
constructor: (@source) ->
return unless... |
Remove migration of old config setting | {$} = require 'atom'
module.exports =
configDefaults:
enabled: false
activate: (state) ->
@migrateOldAutosaveConfig()
atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) =>
editor = event.targetView()?.getModel()
@autosave(editor)
atom.workspaceView.on 'pane:before-item-d... | {$} = require 'atom'
module.exports =
configDefaults:
enabled: false
activate: ->
atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) =>
editor = event.targetView()?.getModel()
@autosave(editor)
atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) =>
@au... |
Use fat arrow instead of .bind(@) | {CompositeDisposable} = require 'atom'
class Commands
constructor: (@linter) ->
@_subscriptions = new CompositeDisposable
@_subscriptions.add atom.commands.add 'atom-workspace',
'linter:next-error': @nextError.bind(@)
'linter:toggle': @toggleLinter.bind(@)
'linter:set-bubble-transparent': @... | {CompositeDisposable} = require 'atom'
class Commands
constructor: (@linter) ->
@_subscriptions = new CompositeDisposable
@_subscriptions.add atom.commands.add 'atom-workspace',
'linter:next-error': @nextError.bind(@)
'linter:toggle': @toggleLinter.bind(@)
'linter:set-bubble-transparent': @... |
Add Arnie emoji to the end of every quote. Update description. | # Description:
# Listens for words and sometimes replies with an Arnie quote
#
# Dependencies:
# None
#
# Commands:
# None
#
# Author:
# Casey Lawrence <casey.j.lawrence@gmail.com>
#
arnie_quotes = [
'GET TO THE CHOPPA!',
'Your clothes, give them to me, NOW!',
'Hasta La Vista, Baby!',
'DDDAAANN... | # Description:
# Listens for mentions of Arnie and replies with an Arnie quote
#
# Dependencies:
# None
#
# Commands:
# None
#
# Author:
# Casey Lawrence <casey.j.lawrence@gmail.com>
#
arnie_quotes = [
'GET TO THE CHOPPA!',
'Your clothes, give them to me, NOW!',
'Hasta La Vista, Baby!',
'DDDAAA... |
Add a slight animation for a nice effect | $(->
$('[data-typeahead]').on 'keyup', (e)->
$this = $(this)
pattern = $this.val().toLowerCase()
searchClass = $this.data("typeahead-search")
$($this.data("typeahead")).children().each (idx)->
if $(this).find("#{searchClass}").text().toLowerCase().search(pattern) == -1
$(this).hide()
... | $(->
$('[data-typeahead]').on 'keyup', (e)->
$this = $(this)
pattern = $this.val().toLowerCase()
searchClass = $this.data("typeahead-search")
$($this.data("typeahead")).children().each (idx)->
if $(this).find("#{searchClass}").text().toLowerCase().search(pattern) == -1
$(this).slideUp(20... |
Fix test for invalid argument error | require('chai').should()
fs = require 'fs'
exec = require('child_process').exec
opt = {cwd: __dirname}
fixclosure = '../bin/fixclosure.js'
describe 'Command line', ->
it 'exec without args', (done) ->
exec fixclosure, opt, (err, stdout, stderr) ->
done(err)
it 'exec with file', (done) ->
exec fixcl... | require('chai').should()
fs = require 'fs'
exec = require('child_process').exec
opt = {cwd: __dirname}
fixclosure = '../bin/fixclosure.js'
describe 'Command line', ->
it 'exec without args', (done) ->
exec fixclosure, opt, (err, stdout, stderr) ->
err.code.should.be.eql 1
done()
it 'exec with fil... |
Add test for ignoring name anchors | describe 'LinkGrabber', ->
describe 'with links', ->
it 'should find all links', ->
links = LinkGrabber.fromHTMLString('<p>Lorem <a href="http://foo/">ipsum</a> dolor <a href="http://bar/">lorem</a> ipsum</p>').allLinks()
links.should.have.lengthOf(2)
links[0].should.equal("http://foo/")
links[1].sh... | describe 'LinkGrabber', ->
describe 'with html input', ->
it 'should find all links', ->
links = LinkGrabber.fromHTMLString('<p>Lorem <a href="http://foo/">ipsum</a> dolor <a href="http://bar/">lorem</a> ipsum</p>').allLinks()
links.should.have.lengthOf(2)
links[0].should.equal("http://foo/")
links[... |
Sort arrivals by arrival time | Template.displayETA.arrivals = (direction)->
stop = Session.get 'etaStop'
if not stop
return
return Arrivals.find({ station: stop, direction: direction })
| Template.displayETA.arrivals = (direction)->
stop = Session.get 'etaStop'
if not stop
return
return Arrivals.find({ station: stop, direction: direction },{ sort: ['next_arr'] })
|
Add remove block XML snippet | # 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:
#... | # 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:
#... |
Add support for fetching one issue from project | BaseModel = require '../BaseModel'
Utils = require '../Utils'
class ProjectIssues extends BaseModel
list: (projectId, params = {}, fn = null) =>
@debug "ProjectIssues::issues()"
if 'function' is typeof params
fn = params
params = {}
params.page ?= 1
params.per_page ?= 100
do (->
... | BaseModel = require '../BaseModel'
Utils = require '../Utils'
class ProjectIssues extends BaseModel
list: (projectId, params = {}, fn = null) =>
@debug "ProjectIssues::issues()"
if 'function' is typeof params
fn = params
params = {}
params.page ?= 1
params.per_page ?= 100
do (->
... |
Update location hash when Foundation tabs change. | $(document).foundation()
hash = window.location.hash
if hash
# Open the Foundation tab whose URL matches the requested hash.
# http://foundation.zurb.com/sites/docs/tabs.html
$("[data-tabs] [href=\"#{hash}\"]").click()
| $(document).foundation()
$(document).on 'change.zf.tabs', (event) ->
if href = $('.is-active a', event.target).attr 'href'
if window.location.hash != href
window.history.pushState null, '', href
true
onHashChange = ->
hash = window.location.hash
if hash
# Open the Foundation tab whose URL matche... |
Use Buffer API instead of Editor API | {Subscriber} = require 'emissary'
module.exports =
class Whitespace
Subscriber.includeInto(this)
constructor: ->
atom.workspace.eachEditor (editor) =>
@handleEditorEvents(editor)
destroy: ->
@unsubscribe()
handleEditorEvents: (editor) ->
@subscribe editor, 'will-be-saved', =>
editor.... | {Subscriber} = require 'emissary'
module.exports =
class Whitespace
Subscriber.includeInto(this)
constructor: ->
atom.workspace.eachEditor (editor) =>
@handleBufferEvents(editor)
destroy: ->
@unsubscribe()
handleBufferEvents: (editor) ->
buffer = editor.getBuffer()
@subscribe buffer, '... |
Fix submitting will a new page | window.Messages = new Meteor.Collection('messages')
Template.chatTemplate.messages = ->
Messages.find()
$ ->
$('#enter').submit( ->
Meteor.subscribe('channel', $('#channel').val(), $('#user').val())
)
| window.Messages = new Meteor.Collection('messages')
Template.chatTemplate.messages = ->
Messages.find()
$ ->
$('#enter').submit( (e) ->
e.preventDefault()
Meteor.subscribe('channel', $('#channel').val(), $('#user').val())
)
|
Destroy select2 before cache happens to avoid duplication | window.Binco.Select2 =
load: (selector) ->
selector = if typeof selector == 'string' then selector else '.select2-rails'
$(selector).each((i,e) ->
$(e).select2('destroy') if $(e).hasClass("select2-hidden-accessible")
$(e).select2()
)
$(document).on 'turbolinks:load', window.Binco.Select2.load... | window.Binco.Select2 =
load: (selector) ->
selector = if typeof selector == 'string' then selector else '.select2-rails'
$(selector).select2()
destroy: (selector) ->
selector = if typeof selector == 'string' then selector else '.select2-rails'
$(selector).each((i,e) ->
$(e).select2('destroy')
... |
Append HomeView subviews in 1 operation | ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.HomeView extends Backbone.View
tagName: "ol"
className: "projects"
template: JST["backbone/templates/home"]
initialize: (options) ->
@_addTileView(tile) for tile in @collection.models
@collection.on 'reset', =>
@.tearDownRegisteredSubViews(... | ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.HomeView extends Backbone.View
tagName: "ol"
className: "projects"
template: JST["backbone/templates/home"]
initialize: (options) ->
@_addTileView(tile) for tile in @collection.models
@collection.on 'reset', =>
@.tearDownRegisteredSubViews(... |
Fix persisting reference to pigments after package deactivation | {CompositeDisposable} = require 'event-kit'
MinimapPigmentsBinding = require './minimap-pigments-binding'
module.exports =
active: false
bindings: {}
isActive: -> @active
activate: (state) ->
@subscriptions = new CompositeDisposable
consumeMinimapServiceV1: (@minimap) ->
@minimap.registerPlugin 'p... | {CompositeDisposable} = require 'event-kit'
MinimapPigmentsBinding = require './minimap-pigments-binding'
module.exports =
active: false
bindings: {}
isActive: -> @active
activate: (state) ->
@subscriptions = new CompositeDisposable
consumeMinimapServiceV1: (@minimap) ->
@minimap.registerPlugin 'p... |
Stop converting arrays into objects | # Lookup table for compressing data
tableTo =
# User
email: "@"
password: "X"
has_pro: "$"
created_at: ":"
updated_at: "#"
data_Task: "dT"
data_List: "dL"
data_Time: "dX"
# Class names
Task: "T"
List: "L"
Time: "M"
# Properties
name: "n"
completed: "c"
id: "i"... | # Lookup table for compressing data
tableTo =
# User
email: "@"
password: "X"
has_pro: "$"
created_at: ":"
updated_at: "#"
data_Task: "dT"
data_List: "dL"
data_Time: "dX"
# Class names
Task: "T"
List: "L"
Time: "M"
# Properties
name: "n"
completed: "c"
id: "i"... |
Fix ERB tag syntax in the source | jQuery ->
$('.locales a:first').tab('show')
$('.accordion-body').on('hidden', ->
$(@).prev().find('i').first().removeClass().addClass('icon-chevron-right')
)
$('.accordion-body').on('shown', ->
$(@).prev().find('i').first().removeClass().addClass('icon-chevron-down'))
$('.toggle-... | jQuery ->
$('.locales a:first').tab('show')
$('.accordion-body').on('hidden', ->
$(@).prev().find('i').first().removeClass().addClass('icon-chevron-right')
)
$('.accordion-body').on('shown', ->
$(@).prev().find('i').first().removeClass().addClass('icon-chevron-down'))
$('.toggle-... |
Fix typo that prevented assets from being loaded | americano = require 'americano'
fs = require 'fs'
path = require 'path'
realtimer = require './utils/realtimer'
localizationManager = require './utils/localization_manager'
useBuildView = fs.existsSync path.resolve(__dirname, 'views', 'index.js')
config =
common:
set:
'view engine... | americano = require 'americano'
fs = require 'fs'
path = require 'path'
realtimer = require './utils/realtimer'
localizationManager = require './utils/localization_manager'
useBuildView = fs.existsSync path.resolve(__dirname, 'views', 'index.js')
config =
common:
set:
'view engine... |
Use select to create hashes for list comprehensions | _ = require 'underscore'
$ = jQuery
assign = (node, attribute, value) ->
if attribute
node.attr attribute, value
else
children = node.children().detach()
node.text value
node.append(children)
$.fn.render = (data) ->
data = [data] unless $.isArray(data)
context = this
template = this.clo... | _ = require 'underscore'
$ = jQuery
assign = (node, attribute, value) ->
if attribute
node.attr attribute, value
else
children = node.children().detach()
node.text value
node.append(children)
select = (hash, fn) ->
result = {}
for key, value of hash
(result[key] = value) if fn key, value
... |
Allow opening client controller in tests | window.ClientController =
showFact: (fact_id) ->
fact = new Fact id: fact_id
fact.on 'destroy', ->
parent.remote.hide()
parent.remote.stopHighlightingFactlink fact_id
fact.fetch success: ->
newClientModal = new DiscussionModalContainer
FactlinkApp.discussionModalRegion.show newCl... | window.ClientController =
showFact: (fact_id) ->
fact = new Fact id: fact_id
fact.on 'destroy', ->
parent.remote.hide()
parent.remote.stopHighlightingFactlink fact_id
fact.fetch success: ->
newClientModal = new DiscussionModalContainer
FactlinkApp.discussionModalRegion.show newCl... |
Use status code 403 forbidden instead of 401 unauthorized | class API extends Restivus
constructor: ->
@authMethods = []
super
addAuthMethod: (method) ->
@authMethods.push method
success: (result={}) ->
if _.isObject(result)
result.success = true
return {} =
statusCode: 200
body: result
failure: (result) ->
if _.isObject(result)
result.success = ... | class API extends Restivus
constructor: ->
@authMethods = []
super
addAuthMethod: (method) ->
@authMethods.push method
success: (result={}) ->
if _.isObject(result)
result.success = true
return {} =
statusCode: 200
body: result
failure: (result) ->
if _.isObject(result)
result.success = ... |
Make header.title as a separate object | class Pane extends JView
constructor: (options = {}, data) ->
options.cssClass = KD.utils.curry "ws-pane", options.cssClass
super options, data
@headerButtons = {}
@createHeader()
@createButtons() if options.buttons?.length
@on "PaneResized", @bound "handlePaneResized"
createHeader:... | class Pane extends JView
constructor: (options = {}, data) ->
options.cssClass = KD.utils.curry "ws-pane", options.cssClass
super options, data
@headerButtons = {}
@createHeader()
@createButtons() if options.buttons?.length
@on "PaneResized", @bound "handlePaneResized"
createHeader:... |
Set testnet BIP44 coin type to 1 | ledger.bitcoin ||= {}
ledger.bitcoin.Networks =
bitcoin:
name: 'bitcoin'
ticker: 'btc'
bip44_coin_type: '0'
version:
regular: 0
P2SH: 5
bitcoinjs: bitcoin.networks.bitcoin
ws_chain: 'bitcoin'
testnet:
name: 'testnet'
ticker: 'btctest'
bip44_coin_type: '0'
version:... | ledger.bitcoin ||= {}
ledger.bitcoin.Networks =
bitcoin:
name: 'bitcoin'
ticker: 'btc'
bip44_coin_type: '0'
version:
regular: 0
P2SH: 5
bitcoinjs: bitcoin.networks.bitcoin
ws_chain: 'bitcoin'
testnet:
name: 'testnet'
ticker: 'btctest'
bip44_coin_type: '1'
version:... |
Fix path encoding on server |
fs = require 'fs'
crypto = require 'crypto'
createHashID = ->
crypto.createHash('sha1').update("#{Math.random()}").digest('hex');
module.exports = (file, callback) ->
return callback("No `image` file. Make sure the `image` field is being set.") unless file
path = "#{global.image_path}#{createHashID()}_#{file.... |
fs = require 'fs'
crypto = require 'crypto'
path = require 'path'
createHashID = ->
crypto.createHash('sha1').update("#{Math.random()}").digest('hex');
module.exports = (file, callback) ->
return callback("No `image` file. Make sure the `image` field is being set.") unless file
path = path.normalize "#{global... |
Move custom level link to more conspicious place | #
# layout.coffee
#
# Role: configure the interface for a level
#
# Responsibility:
# * create dictionaries describing the interface elements
# * associate them as children of the level
{my} = require './my'
{vector} = require './god/vector'
{header} = require './layout/header'
{controls} = require './layout/controls... | #
# layout.coffee
#
# Role: configure the interface for a level
#
# Responsibility:
# * create dictionaries describing the interface elements
# * associate them as children of the level
{my} = require './my'
{vector} = require './god/vector'
{header} = require './layout/header'
{controls} = require './layout/controls... |
Revert "temorarily removed connect server gulp code" | browserify = require "browserify"
connect = require "gulp-connect"
error = require "./error.coffee"
gulp = require "gulp"
gutil = require "gulp-util"
notify = require "gulp-notify"
path = require "path"
source = require "vinyl-source-stream"
timer = require "gulp-duration"
watchify... | browserify = require "browserify"
connect = require "gulp-connect"
error = require "./error.coffee"
gulp = require "gulp"
gutil = require "gulp-util"
notify = require "gulp-notify"
path = require "path"
source = require "vinyl-source-stream"
timer = require "gulp-duration"
watchify... |
Change zoom level from 15 to 14 | mapboxgl.accessToken = 'pk.eyJ1IjoibWg2MTUwMzg5MSIsImEiOiJjaWhxbTJjOGMwNGt4dHBtMjczbzhieXZkIn0.J8-B8U-8nCtqiZ2CfxbV0g'
position = new mapboxgl.LngLat(133.842941, 35.375086).wrap()
map = new mapboxgl.Map {
container: 'map'
style: 'mapbox://styles/mapbox/streets-v8'
center: [position.lng, position.lat]
zoom: 8
}
... | mapboxgl.accessToken = 'pk.eyJ1IjoibWg2MTUwMzg5MSIsImEiOiJjaWhxbTJjOGMwNGt4dHBtMjczbzhieXZkIn0.J8-B8U-8nCtqiZ2CfxbV0g'
position = new mapboxgl.LngLat(133.842941, 35.375086).wrap()
map = new mapboxgl.Map {
container: 'map'
style: 'mapbox://styles/mapbox/streets-v8'
center: [position.lng, position.lat]
zoom: 8
}
... |
Remove deletion of node directory | path = require 'path'
module.exports = (grunt) ->
{rm} = require('./task-helpers')(grunt)
grunt.registerTask 'partial-clean', 'Delete some of the build files', ->
rm grunt.config.get('atom.buildDir')
rm '/tmp/atom-coffee-cache'
rm '/tmp/atom-cached-atom-shells'
rm 'node'
rm 'atom-shell'
gru... | path = require 'path'
module.exports = (grunt) ->
{rm} = require('./task-helpers')(grunt)
grunt.registerTask 'partial-clean', 'Delete some of the build files', ->
rm grunt.config.get('atom.buildDir')
rm '/tmp/atom-coffee-cache'
rm '/tmp/atom-cached-atom-shells'
rm 'atom-shell'
grunt.registerTas... |
Add asciidoc grammar to defaults | SpellCheckView = null
module.exports =
config:
grammars:
type: 'array'
default: [
'source.gfm'
'text.git-commit'
'text.plain'
'text.plain.null-grammar'
]
activate: ->
@disposable = atom.workspace.observeTextEditors(addViewToEditor)
deactivate: ->
@d... | SpellCheckView = null
module.exports =
config:
grammars:
type: 'array'
default: [
'source.asciidoc'
'source.gfm'
'text.git-commit'
'text.plain'
'text.plain.null-grammar'
]
activate: ->
@disposable = atom.workspace.observeTextEditors(addViewToEditor... |
Fix config, log a completion type | {BufferedProcess} = require 'atom'
class PscIde
constructor: ->
@pscIde = atom.config.get("linter-purescript.pscIdeExe")
@getModules()
.then (output) ->
console.log output
runCmd: (str) ->
return new Promise (resolve,reject) =>
command = @pscIde
args = []
stdout = (outp... | {BufferedProcess} = require 'atom'
class PscIde
constructor: ->
@pscIde = atom.config.get("ide-purescript.pscIdeExe")
@getModules()
.then (output) ->
console.log output
runCmd: (str) ->
return new Promise (resolve,reject) =>
command = @pscIde
args = []
stdout = (output)... |
Update deprecated selector in keymap | '.workspace, .workspace .editor':
'ctrl-M': 'markdown-preview:toggle'
'.platform-darwin .markdown-preview':
'cmd-+': 'markdown-preview:zoom-in'
'cmd-=': 'markdown-preview:zoom-in'
'cmd--': 'markdown-preview:zoom-out'
'cmd-_': 'markdown-preview:zoom-out'
'cmd-0': 'markdown-preview:reset-zoom'
'.platform-wi... | 'atom-workspace, atom-workspace atom-text-editor':
'ctrl-M': 'markdown-preview:toggle'
'.platform-darwin .markdown-preview':
'cmd-+': 'markdown-preview:zoom-in'
'cmd-=': 'markdown-preview:zoom-in'
'cmd--': 'markdown-preview:zoom-out'
'cmd-_': 'markdown-preview:zoom-out'
'cmd-0': 'markdown-preview:reset-zoo... |
Make indicator page show the page correctly | Indicator = require('../models/indicator').model
Theme = require('../models/theme').model
_ = require('underscore')
async = require('async')
csv = require('express-csv')
exports.index = (req, res) ->
Theme.getFatThemes( (err, themes) ->
if err?
console.error err
return res.render(500, "Error fetching... | Indicator = require('../models/indicator').model
Theme = require('../models/theme').model
_ = require('underscore')
async = require('async')
csv = require('express-csv')
exports.index = (req, res) ->
Theme.getFatThemes( (err, themes) ->
if err?
console.error err
return res.render(500, "Error fetching... |
Fix Configuration initialization in daemon tests | net = require "net"
{testCase} = require "nodeunit"
{Configuration, Daemon} = require ".."
{prepareFixtures, fixturePath} = require "./lib/test_helper"
module.exports = testCase
setUp: (proceed) ->
prepareFixtures proceed
"start and stop": (test) ->
test.expect 2
configuration = new Configuration hos... | net = require "net"
{testCase} = require "nodeunit"
{Configuration, Daemon} = require ".."
{prepareFixtures, fixturePath} = require "./lib/test_helper"
module.exports = testCase
setUp: (proceed) ->
prepareFixtures proceed
"start and stop": (test) ->
test.expect 2
configuration = new Configuration POW... |
Support dynamic segment in links when model is provided in pills by providing a "dynamicLink" boolean property. | Bootstrap.BsPill = Bootstrap.ItemView.extend(Bootstrap.NavItem, Bootstrap.ItemSelection,
template: Ember.Handlebars.compile '''
{{#if view.content.linkTo}}
{{#linkTo view.content.linkTo}}{{view.title}}{{/linkTo}}
{{else}}
{{view view.pillAsLinkView}}
{{/if}}
'''
... | Bootstrap.BsPill = Bootstrap.ItemView.extend(Bootstrap.NavItem, Bootstrap.ItemSelection,
template: Ember.Handlebars.compile '''
{{#if view.content.linkTo}}
{{#if view.parentView.dynamicLink}}
{{#link-to view.content.linkTo model}}{{view.title}}{{/link-to}}
{{else}}
... |
Fix returned promise wasn't deep enough. | Q = require 'q'
{Base} = require "#{__dirname}/base"
{Wrappers} = require "#{__dirname}/helpers/wrappers"
{BeanBuilder} = require "#{__dirname}/helpers/bean_builder"
class BaseTask extends Base
app: null
actions: null
actionBuilder: null
constructor: ->
@actions = []
@actionBuilder = new BeanBuild... | Q = require 'q'
{Base} = require "#{__dirname}/base"
{Wrappers} = require "#{__dirname}/helpers/wrappers"
{BeanBuilder} = require "#{__dirname}/helpers/bean_builder"
class BaseTask extends Base
app: null
actions: null
actionBuilder: null
constructor: ->
@actions = []
@actionBuilder = new BeanBuild... |
Sort requestHistory requestUpdates by createdAt (so new items are at the top) | Model = require './model'
class RequestHistory extends Model
url: -> "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/history/request/#{ @requestId }/requests"
initialize: (models, { @requestId }) =>
parse: (requestHistoryObjects) ->
requestHistory = {}
requestHistory.requestId = @reque... | Model = require './model'
class RequestHistory extends Model
url: -> "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/history/request/#{ @requestId }/requests"
initialize: (models, { @requestId }) =>
parse: (requestHistoryObjects) ->
requestHistory = {}
requestHistory.requestId = @reque... |
Fix syntax error in autosave coffeescript. | class @Autosave
constructor: (field, key) ->
@field = field
key = key.join("/") if key.join?
@key = "autosave/#{key}"
@field.data "autosave", this
@restore()
@field.on "input", => @save()
restore: ->
return unless window.localStorage?
try
text = window.localStorage.getIte... | class @Autosave
constructor: (field, key) ->
@field = field
key = key.join("/") if key.join?
@key = "autosave/#{key}"
@field.data "autosave", this
@restore()
@field.on "input", => @save()
restore: ->
return unless window.localStorage?
try
text = window.localStorage.getIte... |
Set manual error message for 500 responses | JSONAPIClient = {Resource} = require 'json-api-client'
config = require './config'
apiClient = new JSONAPIClient config.host + '/api',
'Content-Type': 'application/json'
'Accept': 'application/vnd.api+json; version=1'
apiClient.type('classifications').Resource = require './classification'
apiClient.handleError =... | JSONAPIClient = {Resource} = require 'json-api-client'
config = require './config'
apiClient = new JSONAPIClient config.host + '/api',
'Content-Type': 'application/json'
'Accept': 'application/vnd.api+json; version=1'
apiClient.type('classifications').Resource = require './classification'
apiClient.handleError =... |
Send cookie info on role updates | define (require) ->
Backbone = require('backbone')
settings = require('settings')
router = require('router')
AUTHORING = "#{location.protocol}//#{settings.cnxauthoring.host}:#{settings.cnxauthoring.port}"
return class RoleAcceptance extends Backbone.Model
id = window.location.pathname.match(/\/[^\/]+$/)... | define (require) ->
Backbone = require('backbone')
settings = require('settings')
router = require('router')
AUTHORING = "#{location.protocol}//#{settings.cnxauthoring.host}:#{settings.cnxauthoring.port}"
return class RoleAcceptance extends Backbone.Model
id = window.location.pathname.match(/\/[^\/]+$/)... |
Fix use of deprecated minimap API | MinimapSelectionView = require './minimap-selection-view'
module.exports =
active: false
views: {}
activate: (state) ->
try
atom.packages.activatePackage('minimap').then (minimapPackage) =>
@minimap = require minimapPackage.path
return @deactivate() unless @minimap.versionMatch('3.x')... | MinimapSelectionView = require './minimap-selection-view'
module.exports =
active: false
views: {}
activate: (state) ->
try
atom.packages.activatePackage('minimap').then (minimapPackage) =>
@minimap = require minimapPackage.path
return @deactivate() unless @minimap.versionMatch('3.x')... |
Add methods to get posts | angular.module 'ngtuvok'
.factory "BlogService", (DataFactory) ->
# $resource '/api/posts'
posts = DataFactory.query ->
console.log posts
return
getLastPost: ->
# return $resource.query ->
return posts
| angular.module 'ngtuvok'
.factory "BlogService", (DataFactory) ->
# $resource '/api/posts'
posts = DataFactory.query ->
# console.log posts
return
getLastPost: ->
# return $resource.query ->
return posts
getPostById: (id) ->
post = DataFactory.get({ id: id }, ->
... |
Make the javascript for new project work on channel new project | Neighborly.Projects = {} if Neighborly.Projects is undefined
Neighborly.Projects.New =
init: Backbone.View.extend
el: '.new-project-page'
initialize: ->
_.bindAll(this, 'changeCategoryImage')
this.$('#project_category_id').change this.changeCategoryImage
changeCategoryImage: (event)->
... | Neighborly.Projects ?= {}
Neighborly.Channels ?= {}
Neighborly.Channels.Projects ?= {}
Neighborly.Channels.Projects.New =
modules: -> [Neighborly.Projects.New]
Neighborly.Projects.New =
init: Backbone.View.extend
el: '.new-project-page'
initialize: ->
_.bindAll(this, 'changeCategoryImage')
th... |
Remove import of empty templates-common.js | #
# Use this module to define all third-party dependencies
# that are used in Doubtfire
#
angular.module('doubtfire.config.vendor-dependencies', [
# ng*
'ngCookies'
'ngCsv'
'ngSanitize'
# templates
'templates-app'
'templates-common'
# ui.*
'ui.router'
'ui.bootstrap'
'ui.codemirror'
# other li... | #
# Use this module to define all third-party dependencies
# that are used in Doubtfire
#
angular.module('doubtfire.config.vendor-dependencies', [
# ng*
'ngCookies'
'ngCsv'
'ngSanitize'
# templates
'templates-app'
# ui.*
'ui.router'
'ui.bootstrap'
'ui.codemirror'
# other libraries
'angularFil... |
Fix message keys in RevisionList | React = require 'react/addons'
Editable = require '../high_order/editable'
List = require '../common/list'
Revision = require './revision'
RevisionStore = require '../../stores/revision_store'
ServerActions = require '../../actions/server_actions'
getState = ->
rev... | React = require 'react/addons'
Editable = require '../high_order/editable'
List = require '../common/list'
Revision = require './revision'
RevisionStore = require '../../stores/revision_store'
ServerActions = require '../../actions/server_actions'
getState = ->
rev... |
Update chrome hack to use position: fixed | module.exports = (e, dataTransfer, iconAndSize) ->
image = iconAndSize[0]
if image instanceof Image && !image.complete
# Early exit; not loaded image will not work and more importantly it craches Safari 6
return
if dataTransfer.setDragImage
if image instanceof HTMLElement
# Chrome hack; positio... | module.exports = (e, dataTransfer, iconAndSize) ->
image = iconAndSize[0]
if image instanceof Image && !image.complete
# Early exit; not loaded image will not work and more importantly it craches Safari 6
return
if dataTransfer.setDragImage
if image instanceof HTMLElement
# Chrome hack; positio... |
Enable the reading of the OS release number | # Public: GrammarUtils.OperatingSystem - a module which exposes different
# platform related helper functions.
module.exports =
isDarwin: ->
@platform() is 'darwin'
isWindows: ->
@platform() is 'win32'
isLinux: ->
@platform() is 'linux'
platform: ->
process.platform
| # Public: GrammarUtils.OperatingSystem - a module which exposes different
# platform related helper functions.
module.exports =
isDarwin: ->
@platform() is 'darwin'
isWindows: ->
@platform() is 'win32'
isLinux: ->
@platform() is 'linux'
platform: ->
process.platform
release: ->
proce... |
Remove the unzip spec completely. | assert = require 'assert'
fs = require 'fs'
path = require 'path'
describe 'third-party module', ->
fixtures = path.join __dirname, 'fixtures'
xdescribe 'unzip', ->
unzip = require 'unzip'
it 'fires close event', (done) ->
fs.createReadStream(path.join(fixtures, 'zip', 'a.zip'))
.pipe... | assert = require 'assert'
fs = require 'fs'
path = require 'path'
describe 'third-party module', ->
fixtures = path.join __dirname, 'fixtures'
describe 'runas', ->
it 'can be required in renderer', ->
require 'runas'
it 'can be required in node binary', (done) ->
runas = path.join fixtu... |
Add clue parameter to validation | React = require 'react'
module.exports = React.PropTypes.shape(
title: React.PropTypes.string
children: React.PropTypes.array
chapter_section: React.PropTypes.array
current_level: React.PropTypes.number
questions_answered_count: React.PropTypes.number
)
| React = require 'react'
module.exports = React.PropTypes.shape(
title: React.PropTypes.string
children: React.PropTypes.array
chapter_section: React.PropTypes.array
clue: React.PropTypes.object
questions_answered_count: React.PropTypes.number
)
|
Insert subtitle to the content | class Article
constructor: ->
set_title: (@title) ->
set_content: (@content) ->
set_date: (@date) ->
set_section: (@section) ->
parse: (html) ->
page = $(html)
@set_title page.find("#articleContent h1").text()
raw_content = page.find("#masterContent .ArticleContent_Inner")
... | class Article
constructor: ->
set_title: (@title) ->
set_content: (@content) ->
set_date: (@date) ->
set_section: (@section) ->
parse: (html) ->
page = $(html)
@set_title page.find("#articleContent h1").text()
raw_content = page.find("#masterContent .ArticleContent_Inner")
... |
Implement 'recent' link on messages section | $(document).ready ->
$('#messages-kiitos li').on 'click', (event) ->
event.preventDefault()
id = $(@).data('id')
$.get "messages/#{id}" | $(document).ready ->
$('#messages-kiitos .list-group li').on 'click', (event) ->
event.preventDefault()
id = $(@).data('id')
$.get "messages/#{id}" |
Fix parameter asserting when the options passed through are undefined | #<< AppEngine/Helpers/Helpers
class StrictObject extends Backbone.Events
@expectedParameters: []
@applyParameters: []
@isAbstract: -> @ == StrictObject
constructor: (conf) ->
#check that this is not an abstract class
if @__proto__.constructor.isAbstract()
throw new Error "Unable to create instan... | #<< AppEngine/Helpers/Helpers
class StrictObject extends Backbone.Events
@expectedParameters: []
@applyParameters: []
@isAbstract: -> @ == StrictObject
constructor: (conf) ->
#check that this is not an abstract class
if @__proto__.constructor.isAbstract()
throw new Error "Unable to create instan... |
Tweak menu label for case insensitive sort | 'menu': [
{
'label': 'Edit'
'submenu': [
'label': 'Lines'
'submenu': [
{ 'label': 'Sort', 'command': 'sort-lines:sort' }
{ 'label': 'Reverse Sort', 'command': 'sort-lines:reverse-sort' }
{ 'label': 'Unique', 'command': 'sort-lines:unique' }
{ 'label': 'Case-insensit... | 'menu': [
{
'label': 'Edit'
'submenu': [
'label': 'Lines'
'submenu': [
{ 'label': 'Sort', 'command': 'sort-lines:sort' }
{ 'label': 'Reverse Sort', 'command': 'sort-lines:reverse-sort' }
{ 'label': 'Unique', 'command': 'sort-lines:unique' }
{ 'label': 'Sort (Case In... |
Load fixture instead of relying on exitisting var | #= require trix/views/text_view
#= require fixtures
module "Trix.TextView"
test "#createElementsForText", ->
text = fixture("plain")
elements = getElementsForText(text)
equal elements.length, 1, "one element for plain string"
el = elements[0]
equal el.tagName.toLowerCase(), "span", "container element is a... | #= require trix/views/text_view
#= require fixtures
module "Trix.TextView"
test "#createElementsForText", ->
text = fixture("plain")
elements = getElementsForText(text)
equal elements.length, 1, "one element for plain string"
el = elements[0]
equal el.tagName.toLowerCase(), "span", "container element is a... |
Change tab size for Ruby, Coffee and Sass | '*':
'editor':
'fontFamily': 'Fira Mono OT'
'showIndentGuide': true
'tabLength': 4
'softWrap': true
'invisibles': {}
'zoomFontWhenCtrlScrolling': false
'core':
'disabledPackages': [
'language-objective-c'
'archive-view'
'autosave'
'bookmarks'
'language-cloju... | '*':
'editor':
'fontFamily': 'Fira Mono OT'
'showIndentGuide': true
'tabLength': 4
'softWrap': true
'invisibles': {}
'zoomFontWhenCtrlScrolling': false
'core':
'disabledPackages': [
'language-objective-c'
'archive-view'
'autosave'
'bookmarks'
'language-cloju... |
Add jQuery notify back in | # 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.
#
... | # 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.
#
... |
Change method 'resetAvatar' to use RocketFile | Meteor.methods
setAvatarFromService: (dataURI, service) ->
if not Meteor.userId()
throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado'
user = Meteor.user()
{image, contentType} = RocketFile.dataURIParse dataURI
rs = RocketFile.bufferToStream new Buffer(image, 'base64')
ws = Rocket... | Meteor.methods
setAvatarFromService: (dataURI, service) ->
if not Meteor.userId()
throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado'
user = Meteor.user()
{image, contentType} = RocketFile.dataURIParse dataURI
rs = RocketFile.bufferToStream new Buffer(image, 'base64')
ws = Rocket... |
Destroy confirm dialog when user has confirmed | $ ->
$.rails.allowAction = (element) ->
message = element.data('confirm')
fire = $.rails.fire
if message and fire(element, 'confirm')
title = if $(document.body).hasClass('videos') then 'Delete this video' else 'Delete your account'
dialog = new Dialog(title, message, confirmLabel: '<i class="... | $ ->
$.rails.allowAction = (element) ->
message = element.data('confirm')
fire = $.rails.fire
if message and fire(element, 'confirm')
title = if $(document.body).hasClass('videos') then 'Delete this video' else 'Delete your account'
dialog = new Dialog(title, message, confirmLabel: '<i class="... |
Use splat instead of apply | _ = require 'underscore'
BufferedProcess = require 'buffered-process'
$ = require 'jquery'
module.exports =
class LoadPathsTask
constructor: (@callback) ->
start: ->
rootPath = project.getPath()
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
ignoredNames = ignoredNames.concat(config.get('c... | _ = require 'underscore'
BufferedProcess = require 'buffered-process'
$ = require 'jquery'
module.exports =
class LoadPathsTask
constructor: (@callback) ->
start: ->
rootPath = project.getPath()
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
ignoredNames = ignoredNames.concat(config.get('c... |
Remove location junk from panel creation | ViewRegistry = require '../src/view-registry'
Panel = require '../src/panel'
PanelContainer = require '../src/panel-container'
describe "PanelContainer", ->
[container] = []
class TestPanelItem
constructior: ->
beforeEach ->
viewRegistry = new ViewRegistry
container = new PanelContainer({viewRegist... | ViewRegistry = require '../src/view-registry'
Panel = require '../src/panel'
PanelContainer = require '../src/panel-container'
describe "PanelContainer", ->
[container] = []
class TestPanelItem
constructior: ->
beforeEach ->
viewRegistry = new ViewRegistry
container = new PanelContainer({viewRegist... |
Check available when creates a new instance | ###
HTML Renderer
@namespace Atoms.Core
@class Attributes
@author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
###
"use strict"
Atoms.Core.Attributes =
###
Set the parent instance to current instance.
@method setParent
###
scaffold: ->
# Assign Parrent
@parent = {}
if @attributes?.paren... | ###
HTML Renderer
@namespace Atoms.Core
@class Attributes
@author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
###
"use strict"
Atoms.Core.Attributes =
###
Set the parent instance to current instance.
@method setParent
###
scaffold: ->
# Assign Parrent
@parent = {}
if @attributes?.paren... |
Add spec for resolving compatible module paths | path = require 'path'
Module = require 'module'
ModuleCache = require '../src/module-cache'
describe 'ModuleCache', ->
beforeEach ->
spyOn(Module, '_findPath').andCallThrough()
it 'resolves atom shell module paths without hitting the filesystem', ->
require.resolve('shell')
expect(Module._findPath.cal... | path = require 'path'
Module = require 'module'
fs = require 'fs-plus'
temp = require 'temp'
ModuleCache = require '../src/module-cache'
describe 'ModuleCache', ->
beforeEach ->
spyOn(Module, '_findPath').andCallThrough()
it 'resolves atom shell module paths without hitting the filesystem', ->
require.res... |
Change site title and add collection function. | # Define the Configuration
docpadConfig = {
templateData:
site:
title: "Dorian Patterson"
getPreparedTitle: -> if @document.title then "#{@document.title} | #{@site.title}" else @site.title
}
# Export the Configuration
module.exports = docpadConfig
| # Define the Configuration
docpadConfig = {
templateData:
site:
title: "Curly Hair Coder"
getPreparedTitle: -> if @document.title then "#{@document.title} | #{@site.title}" else @site.title
collections:
pages: ->
@getCollection("html").findAllLive({isPage:true})
}
# Export the Configuration
module.... |
Add apm to public API | {Document, Point, Range, Site} = require 'telepath'
_ = require 'underscore-plus'
module.exports =
_: _
BufferedNodeProcess: require '../src/buffered-node-process'
BufferedProcess: require '../src/buffered-process'
Directory: require '../src/directory'
Document: Document
File: require '../src/file'
fs: r... | {Document, Point, Range, Site} = require 'telepath'
_ = require 'underscore-plus'
module.exports =
_: _
apm: require 'atom-package-manager'
BufferedNodeProcess: require '../src/buffered-node-process'
BufferedProcess: require '../src/buffered-process'
Directory: require '../src/directory'
Document: Document... |
Make an emojify global function | $ ->
$(".js-emoji").each ->
$(@).html(emojione.toImage($(@).text()))
| window.emojify = ->
$(".js-emoji").each ->
$(@).html(emojione.toImage($(@).text()))
$ -> emojify()
|
Fix button interaction logic: disable hoverstate on click. | class TourUserView extends ActionButtonView
template: 'tour/interesting_user'
className: 'tour-interesting-user'
templateHelpers: =>
disabled_label: Factlink.Global.t.follow_user.capitalize()
disable_label: Factlink.Global.t.unfollow.capitalize()
enabled_label: Factlink.Global.t.following.capitalize... | class TourUserView extends ActionButtonView
template: 'tour/interesting_user'
className: 'tour-interesting-user'
templateHelpers: =>
disabled_label: Factlink.Global.t.follow_user.capitalize()
disable_label: Factlink.Global.t.unfollow.capitalize()
enabled_label: Factlink.Global.t.following.capitalize... |
Fix add room route work | define [
"backbone"
"sp-utils-middleware"
"common"
"view/page"
"view/modal"
],(
Backbone
Middleware
common
Page
Modal
)->
showPage=(View,options={},callback)->
common.app.content.show View, options, callback
class MiddlewareRouter extends Middleware
auth:(async,args)->
async.reso... | define [
"backbone"
"sp-utils-middleware"
"common"
"view/page"
"view/modal"
],(
Backbone
Middleware
common
Page
Modal
)->
showPage=(View,options={},callback)->
common.app.content.show View, options, callback
class MiddlewareRouter extends Middleware
auth:(async,args)->
async.reso... |
Fix flash message dismiss bug | $(document).ready ->
$('#query').autocompleter {
source: '/autocomplete/keywords',
offset: 'results',
highlightMatches: true
}
$('#location').autocompleter {
source: '/autocomplete/places',
offset: 'results',
minLength: 4,
highlightMatches: true
}
$('#flash a.close').click(sweet... | $(document).ready ->
$('#query').autocompleter {
source: '/autocomplete/keywords',
offset: 'results',
highlightMatches: true
}
$('#location').autocompleter {
source: '/autocomplete/places',
offset: 'results',
minLength: 4,
highlightMatches: true
}
$('#flash a.close').click(sweet... |
Upgrade cherry pick select branch | {$$, BufferedProcess, SelectListView} = require 'atom'
git = require '../git'
StatusView = require './status-view'
CherryPickSelectCommits = require './cherry-pick-select-commits-view'
module.exports =
class CherryPickSelectBranch extends SelectListView
initialize: (items, @currentHead) ->
super
@addClass ... | {BufferedProcess} = require 'atom'
{$$, SelectListView} = require 'atom-space-pen-views'
git = require '../git'
StatusView = require './status-view'
CherryPickSelectCommits = require './cherry-pick-select-commits-view'
module.exports =
class CherryPickSelectBranch extends SelectListView
initialize: (items, @curren... |
Fix TerminalPane until we support for multiple vms | class TerminalPane extends Pane
constructor: (options = {}, data) ->
options.cssClass = "terminal-pane terminal"
options.delay ?= 0
super options, data
@createWebTermView()
@webterm.on "WebTermConnected", (@remote) =>
@emit "WebtermCreated"
@onWebTermConnected()
createWebTer... | class TerminalPane extends Pane
constructor: (options = {}, data) ->
options.cssClass = "terminal-pane terminal"
options.delay ?= 0
super options, data
@createWebTermView()
createWebTermView: ->
KD.singletons.vmController.fetchDefaultVm (err, vm)=>
@webterm = new WebTe... |
Add store and statechart to the App component | #= require ./top/navbar
#= require ./centre/main_area
###* @jsx React.DOM ###
window.App = React.createClass
render: ->
`<span>
<Navbar/>
<MainArea/>
</span>`
| #= require ../store
#= require ../statechart
#= require ./top/navbar
#= require ./centre/main_area
###* @jsx React.DOM ###
models = [
'corpora'
]
states =
start: {}
results: {}
window.App = React.createClass
getInitialState: ->
store: new Store(models, (store) => @setState(store: store))
statechart:... |
Add description for config setting | SpellCheckView = null
module.exports =
config:
grammars:
type: 'array'
default: [
'source.asciidoc'
'source.gfm'
'text.git-commit'
'text.plain'
'text.plain.null-grammar'
]
activate: ->
@disposable = atom.workspace.observeTextEditors(addViewToEditor... | SpellCheckView = null
module.exports =
config:
grammars:
type: 'array'
default: [
'source.asciidoc'
'source.gfm'
'text.git-commit'
'text.plain'
'text.plain.null-grammar'
]
description: 'List of scopes for languages which will be checked for misspell... |
Add askToTurnOn helper method to turn VM on globally | class VirtualizationController extends KDController
constructor:->
super
@kc = KD.singletons.kiteController
@lastState =
state : 'STOPPED'
run:(command, callback, emitStateChanged=yes)->
@kc.run
kiteName : 'os'
method : command
, @_cbWrapper callback, emitStateChanged
... | class VirtualizationController extends KDController
constructor:->
super
@kc = KD.singletons.kiteController
@lastState =
state : 'STOPPED'
run:(command, callback, emitStateChanged=yes)->
@kc.run
kiteName : 'os'
method : command
, @_cbWrapper callback, emitStateChanged
... |
Improve SQL Beautifier to support missing config options. | ###
Requires https://github.com/andialbrecht/sqlparse
###
getCmd = (inputPath, outputPath, options) ->
path = options.sqlformat_path
optionsStr = " --indent_width={0} --keywords={1} --identifiers={2} --reindent"
optionsStr = optionsStr.replace("{0}", options.indent_size)
.replace("{1}", opt... | ###
Requires https://github.com/andialbrecht/sqlparse
###
getCmd = (inputPath, outputPath, options) ->
path = options.sqlformat_path
optionsStr = "--reindent"
if options.indent_size?
optionsStr += " --indent_width=#{options.indent_size}"
if options.keywords?
optionsStr += " --keywords=#{options.keyword... |
Change description on tests of training. | Helper = require('hubot-test-helper')
chai = require 'chai'
expect = chai.expect
helper = new Helper('../scripts/hello.coffee')
describe 'Training 1', ->
beforeEach ->
@room = helper.createRoom()
afterEach ->
@room.destroy()
it 'start Training 1', ->
@room.user.say('miura', '@customer 三浦と申します。監視ソ... | Helper = require('hubot-test-helper')
chai = require 'chai'
expect = chai.expect
helper = new Helper('../scripts/training1st.coffee')
describe 'The 1st day of Training', ->
beforeEach ->
@room = helper.createRoom()
afterEach ->
@room.destroy()
it 'should reply greeting to trainee', ->
@room.user.... |
Check that req.route.path is set | os = require("os")
module.exports.monitor = (logger) ->
return (req, res, next) ->
Metrics = require("./metrics")
startTime = new Date()
end = res.end
res.end = () ->
end.apply(this, arguments)
responseTime = new Date() - startTime
routePath = req.route.path.toString().replace(/\//g, '_').replace(/\:... | os = require("os")
module.exports.monitor = (logger) ->
return (req, res, next) ->
Metrics = require("./metrics")
startTime = new Date()
end = res.end
res.end = () ->
end.apply(this, arguments)
responseTime = new Date() - startTime
if req.route?.path?
routePath = req.route.path.toString().replace... |
Add user_identifier to UserCredential Model | BaseModel = require './base'
crypto = require 'crypto'
uuid = require 'uuid'
_ = require 'underscore'
class UserCredential extends BaseModel
constructor: (options) ->
super options
@required = ['userid', 'secret']
if not @secret
@genSecret()
genSecret: () ->
sha = crypto.createHash 'sha256... | BaseModel = require './base'
crypto = require 'crypto'
uuid = require 'uuid'
_ = require 'underscore'
class UserCredential extends BaseModel
constructor: (options) ->
super options
@required = ['userid', 'secret', 'user_identifier']
if not @secret
@genSecret()
if not @user_identifier
@... |
Switch to using new subject selection URL | Reflux = require 'reflux'
{api} = require '../api/client'
classifierActions = require '../actions/classifier-actions'
workflowStore = require './workflow-store'
module.exports = Reflux.createStore
subjects: []
subject: null
init: ->
@listenTo workflowStore, @changeWorkflow
@listenTo classifierActions.mo... | Reflux = require 'reflux'
{api} = require '../api/client'
classifierActions = require '../actions/classifier-actions'
workflowStore = require './workflow-store'
module.exports = Reflux.createStore
subjects: []
subject: null
init: ->
@listenTo workflowStore, @changeWorkflow
@listenTo classifierActions.mo... |
Remove selection when added a discussion | FactlinkJailRoot.createFactFromSelection = (current_user_opinion) ->
success = ->
FactlinkJailRoot.createButton.hide()
FactlinkJailRoot.off 'modalOpened', success
selInfo =
text: window.document.getSelection().toString()
title: window.document.title
text = selInfo.text
siteUrl = FactlinkJailRo... | FactlinkJailRoot.createFactFromSelection = (current_user_opinion) ->
success = ->
window.document.getSelection().removeAllRanges()
FactlinkJailRoot.createButton.hide()
FactlinkJailRoot.off 'modalOpened', success
selInfo =
text: window.document.getSelection().toString()
title: window.document.ti... |
Use actual bootstrap javascript, not some weird homebrew version? :3 | #= require jquery
#= require bootstrap-fix
#= require jquery_ujs
#= require jquery-ui.js
#= require jquery.cookie
#= require jquery.titlealert
#= require jquery.mousewheel
#= require jquery.expanding
#= require jquery.iframe-transport
#= require simply-scroll
# require jquery.purr
#= require hamlcoffee
#= require date
... | #= require jquery
#= require bootstrap
#= require jquery_ujs
#= require jquery-ui.js
#= require jquery.cookie
#= require jquery.titlealert
#= require jquery.mousewheel
#= require jquery.expanding
#= require jquery.iframe-transport
#= require simply-scroll
# require jquery.purr
#= require hamlcoffee
#= require date
#= r... |
Fix bug list display issue | # Copyright 2013 Square Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | # Copyright 2013 Square Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
Move the poller into the lib and mix it with the other classmixer stuffs. Update the test. | #= require dashboard
#= require mock-ajax
describe "Dashboard - getData()", ->
beforeEach ->
jasmine.Ajax.useMock()
@dashboard = Dashboard
describe "when the report is ready on the first iteration", ->
it "should return the dashboard data", ->
that = this
@dashboard.getData 'lesson_leader... | #= require lib/dashboard_poller
#= require mock-ajax
describe "Dashboard - getData()", ->
beforeEach ->
jasmine.Ajax.useMock()
@dashboard = ttm.lib.DashboardPoller.build()
describe "when the report is ready on the first iteration", ->
it "should return the dashboard data", ->
that = this
... |
Make a difference between minutes and months. They both used to have an "m" as indicator | window.TimeAgo = React.createClass
mixins: [SetIntervalMixin]
getInitialState: ->
now: Date.now()
componentDidMount: ->
@setInterval(@update_time, 1000)
update_time: ->
@setState now: Date.now()
seconds_lapsed: ->
(@state.now - Date.parse(@props.time)) / 1000
showNr: (nr, unit) ->
"... | window.TimeAgo = React.createClass
mixins: [SetIntervalMixin]
getInitialState: ->
now: Date.now()
componentDidMount: ->
@setInterval(@update_time, 1000)
update_time: ->
@setState now: Date.now()
seconds_lapsed: ->
(@state.now - Date.parse(@props.time)) / 1000
showNr: (nr, unit) ->
"... |
Test fix: corrected use of should to assert typeof | should = require 'should'
fixtures = require './fixtures'
git = require '../src'
Blob = require '../src/blob'
describe "Blob", ->
describe "constructor", ->
repo = fixtures.branched
blob = new Blob repo, {name: "X", mode: "Y", id: "abc"}
it "assigns @name", ->
blob.name.should.eql "X"
... | should = require 'should'
fixtures = require './fixtures'
git = require '../src'
Blob = require '../src/blob'
describe "Blob", ->
describe "constructor", ->
repo = fixtures.branched
blob = new Blob repo, {name: "X", mode: "Y", id: "abc"}
it "assigns @name", ->
blob.name.should.eql "X"
... |
Refactor ui watcher to use packageWatcher | ThemeWatcher = require './theme-watcher'
BaseThemeWatcher = require './base-theme-watcher'
module.exports =
class UIWatcher
constructor: ({@themeManager}) ->
@baseTheme = new BaseThemeWatcher()
for theme in @themeManager.getActiveThemes()
@createThemeWatcher(theme)
@themeManager.on 'theme-activated... | BaseThemeWatcher = require './base-theme-watcher'
ThemeWatcher = require './theme-watcher'
PackageWatcher = require './package-watcher'
module.exports =
class UIWatcher
constructor: ({@themeManager}) ->
@watchers = []
@baseTheme = @createWatcher(BaseThemeWatcher)
@watchThemes()
@watchPackages()
wa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.