Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Set visible_id to use like query | class Skr.Extension extends Lanes.Extensions.Base
identifier: "skr"
# Data that is provided by lib/skr/extension.rb's
# client_bootstrap_data method ends up here
setBootstrapData: (data) ->
Skr.Models.GlAccount.initialize(
accounts: data.gl_accounts
default_ids: data.de... | class Skr.Extension extends Lanes.Extensions.Base
identifier: "skr"
# Data that is provided by lib/skr/extension.rb's
# client_bootstrap_data method ends up here
setBootstrapData: (data) ->
Lanes.Models.Query.LIKE_QUERY_TYPES.push 'visible_id'
Skr.Models.GlAccount.initialize(
... |
Add language-patch package to Atom | packages: [
"advanced-open-file"
"atom-alignment"
"atom-handlebars"
"auto-update-packages"
"docblockr"
"editorconfig"
"emmet"
"expand-region"
"language-apache"
"language-applescript"
"language-awk"
"language-env"
"language-gitattributes"
"language-gitignore"
"language-hosts"
"language-in... | packages: [
"advanced-open-file"
"atom-alignment"
"atom-handlebars"
"auto-update-packages"
"docblockr"
"editorconfig"
"emmet"
"expand-region"
"language-apache"
"language-applescript"
"language-awk"
"language-env"
"language-gitattributes"
"language-gitignore"
"language-hosts"
"language-in... |
Add a snippet for Octopress code blocks | # 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:
#... |
Remove more naughty whitespace :lipstick: | path = require "path"
latexmk = require "./latexmk"
ProgressIndicatorView = require "./progress-indicator-view"
module.exports =
configDefaults:
texPath: "$PATH:/usr/texbin"
outputDirectory: ""
enableShellEscape: false
activate: ->
atom.workspaceView.command "latex:build", => @build()
build: -... | path = require "path"
latexmk = require "./latexmk"
ProgressIndicatorView = require "./progress-indicator-view"
module.exports =
configDefaults:
texPath: "$PATH:/usr/texbin"
outputDirectory: ""
enableShellEscape: false
activate: ->
atom.workspaceView.command "latex:build", => @build()
build: -... |
Drop ie support from ribbon | 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-ghfo... | React = require 'react'
Nav = React.createFactory require 'antwar-default-theme/Nav'
Paths = require('antwar-core/PathsMixin')
require 'antwar-default-theme/scss/main.scss'
# XXX: this can get compiled before latter... figure out how to force order
#require 'react-ghfork/gh-fork-ribbon.ie.css' # ie support
require 're... |
Arrange brush strokes around a sphere | fs = require 'fs'
three = require 'three'
module.exports = class StrokeMesh
constructor: (scene) ->
@nStrokes =
1000
uniforms =
bright:
type: 'f'
value: 0
strokeTexture:
type: 't'
value: three.ImageUtils.loadTexture 'texture/stroke.png'
attributes =
strokeColor:
type: 'c'
v... | fs = require 'fs'
three = require 'three'
module.exports = class StrokeMesh
constructor: (scene) ->
@nStrokes =
10000
uniforms =
bright:
type: 'f'
value: 0
strokeTexture:
type: 't'
value: three.ImageUtils.loadTexture 'texture/stroke.png'
attributes =
strokeColor:
type: 'c'
... |
Add dynamic sortable placeholder height | taxons_template = null
get_taxonomy = ->
Spree.ajax
url: "#{Spree.routes.taxonomy_path}?set=nested"
draw_tree = (taxonomy) ->
$('#taxonomy_tree')
.html( taxons_template({ taxons: [taxonomy.root] }) )
.find('ul')
.sortable
connectWith: '#taxonomy_tree ul'
placeholder: 'sortable-placehol... | taxons_template = null
get_taxonomy = ->
Spree.ajax
url: "#{Spree.routes.taxonomy_path}?set=nested"
draw_tree = (taxonomy) ->
$('#taxonomy_tree')
.html( taxons_template({ taxons: [taxonomy.root] }) )
.find('ul')
.sortable
connectWith: '#taxonomy_tree ul'
placeholder: 'sortable-placehol... |
Update Templating component to public Jade API | noflo = require "noflo"
class Template extends noflo.Component
description: "This component receives a templating engine name, a string containing the template, and variables for the template. Then it runs the chosen template engine and sends resulting templated content to the output port"
constructor: ->
... | noflo = require "noflo"
class Template extends noflo.Component
description: "This component receives a templating engine name, a string containing the template, and variables for the template. Then it runs the chosen template engine and sends resulting templated content to the output port"
constructor: ->
... |
Update .workspace class with custom element | # Your keymap
#
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
# to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an exa... | # Your keymap
#
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
# to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an exa... |
Set clickable class if onClick is given | React = require 'react'
BS = require 'react-bootstrap'
classnames = require 'classnames'
_ = require 'underscore'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
type: React.PropTypes.string.isRequired
spin: React.PropTypes.bool
className: React.PropTypes.string
tooltip: ... | React = require 'react'
BS = require 'react-bootstrap'
classnames = require 'classnames'
_ = require 'underscore'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
type: React.PropTypes.string.isRequired
spin: React.PropTypes.bool
className: React.PropTypes.string
tooltip: ... |
Make base stylesheet loading work again | {fs} = require 'atom'
path = require 'path'
Watcher = require './watcher'
module.exports =
class BaseThemeWatcher extends Watcher
constructor: ->
super()
@stylesheetsPath = path.dirname(window.resolveStylesheet('../static/atom.less'))
@watch()
watch: ->
filePaths = fs.readdirSync(@stylesheetsPath)... | {fs} = require 'atom'
path = require 'path'
Watcher = require './watcher'
module.exports =
class BaseThemeWatcher extends Watcher
constructor: ->
super()
@stylesheetsPath = path.dirname(window.resolveStylesheet('../static/atom.less'))
@watch()
watch: ->
filePaths = fs.readdirSync(@stylesheetsPath)... |
Add new gulp files to tests | path = require 'path'
helpers = require('yeoman-generator').test
describe 'app', ->
beforeEach (done) ->
helpers.testDirectory path.join(__dirname, 'app.tmp'), (err) =>
return done(err) if err
@app = helpers.createGenerator 'coffee-module:app', ['../../app']
done()
it 'creates expected files... | path = require 'path'
helpers = require('yeoman-generator').test
describe 'app', ->
beforeEach (done) ->
helpers.testDirectory path.join(__dirname, 'app.tmp'), (err) =>
return done(err) if err
@app = helpers.createGenerator 'coffee-module:app', ['../../app']
done()
it 'creates expected files... |
Use octicon for README files | {View} = require 'space-pen'
$ = require 'jquery'
Git = require 'git'
fs = require 'fs'
module.exports =
class FileView extends View
@content: ({file} = {}) ->
@li class: 'file entry', =>
@span file.getBaseName(), class: 'name', outlet: 'fileName'
@span '', class: 'highlight'
file: null
initia... | {View} = require 'space-pen'
$ = require 'jquery'
Git = require 'git'
fs = require 'fs'
module.exports =
class FileView extends View
@content: ({file} = {}) ->
@li class: 'file entry', =>
@span file.getBaseName(), class: 'name', outlet: 'fileName'
@span '', class: 'highlight'
file: null
initia... |
Adjust query for fetchStocks to be more performant. | Promise = require 'bluebird'
{SphereClient} = require 'sphere-node-sdk'
class FetchStocks
constructor: (@logger, options = {}, @channelKey) ->
@client = new SphereClient options
run: ->
if @channelKey
@_getChannelId()
.then (id) =>
queryString = 'supplyChannel(id="' + id + '")'
... | Promise = require 'bluebird'
{SphereClient} = require 'sphere-node-sdk'
class FetchStocks
constructor: (@logger, options = {}, @channelKey) ->
@client = new SphereClient options
run: ->
query = @client.inventoryEntries.all().sort('sku').expand('supplyChannel')
if @channelKey
@_getChannelId()
... |
Fix in reply to link for tent.is | _.extend TentStatus.Helpers,
postUrl: (post) ->
return unless post and post.get
entity = post.get('entity')
if (new HTTP.URI entity).hostname == TentStatus.config.domain_entity.hostname
"/posts/#{post.get('id')}"
else if entity.match /\.tent\.is/
"#{entity}/posts/#{post.get 'id'}"
els... | _.extend TentStatus.Helpers,
postUrl: (post) ->
return unless post and post.get
entity = post.get('entity')
if (new HTTP.URI entity).hostname == TentStatus.config.domain_entity.hostname
"/posts/#{post.get('id')}"
else if entity.match /\.tent\.is/
"#{entity}/posts/#{post.get 'id'}"
els... |
Fix child process helper (specs) | gutil = require 'gulp-util'
child_process = require 'child_process'
module.exports = (name, command, next = ->) ->
child_process.exec(
command
(error, stdout, stderr) ->
if error and error.code
customError =
message: "Failed: #{name}"
gutil.log stdout
gutil.lo... | gutil = require 'gulp-util'
child_process = require 'child_process'
module.exports = (name, command, callback = ->) ->
child_process.exec(
command
(error, stdout, stderr) ->
if error and error.code
customError =
message: "Failed: #{name}"
gutil.log stdout
guti... |
Make some fixes to the autocompleter. | {filter} = require 'fuzzaldrin'
AutoCompletePlusProvider =
selector: '.source.dart'
disableForSelector: '.source.dart .comment'
inclusionPriority: 1
excludeLowerPriority: true
# Our analysis API service object
analysisApi: null
# Required: Return a promise, an array of suggestions, or null.
getSugge... | {filter} = require 'fuzzaldrin'
{_} = require 'lodash'
AutoCompletePlusProvider =
selector: '.source.dart'
disableForSelector: '.source.dart .comment'
inclusionPriority: 1
excludeLowerPriority: true
# Our analysis API service object
analysisApi: null
# Required: Return a promise, an array of suggestio... |
Update for Blade API changes | #= require ./vendor/qunit
QUnit.config.hidepassed = true
QUnit.config.testTimeout = 5000
QUnit.begin (suiteDetails) ->
Blade.suiteBegin(total: suiteDetails.totalTests)
failedAssertions = []
QUnit.testStart (testDetails) ->
failedAssertions = []
QUnit.log (assertionDetails) ->
unless assertionDetails.result
... | #= require ./vendor/qunit
QUnit.config.hidepassed = true
QUnit.config.testTimeout = 5000
QUnit.begin (suiteDetails) ->
Blade.suiteDidBegin(suiteDetails)
failedAssertions = []
QUnit.testStart (testDetails) ->
failedAssertions = []
QUnit.log (assertionDetails) ->
unless assertionDetails.result
failedAssert... |
Disable pandoc citation autocompletion by default | LabelView = require './label-view'
CiteView = require './cite-view'
LatexerHook = require './latexer-hook'
{CompositeDisposable} = require 'atom'
module.exports = Latexer =
config:
parameters_to_search_citations_by:
type: "array"
default: ["title", "author"]
items:
type: "string"
... | LabelView = require './label-view'
CiteView = require './cite-view'
LatexerHook = require './latexer-hook'
{CompositeDisposable} = require 'atom'
module.exports = Latexer =
config:
parameters_to_search_citations_by:
type: "array"
default: ["title", "author"]
items:
type: "string"
... |
Add fetch and a to z lib to SearchBlocks | #
# Collection for a group of Blocks (could be users and channels as well) fetched by a search
#
Blocks = require("./blocks.coffee")
sd = require("sharify").data
_ = require 'underscore'
Block = require("../models/block.coffee")
params = require 'query-params'
module.exports = class SearchBlocks extends Blocks
defa... | #
# Collection for a group of Blocks (could be users and channels as well) fetched by a search
#
Blocks = require("./blocks.coffee")
sd = require("sharify").data
_ = require 'underscore'
Block = require("../models/block.coffee")
params = require 'query-params'
Fetch = require '../lib/fetch.coffee'
AtoZ = require '../l... |
Add test for using format option in git show command | fs = require 'fs-plus'
Path = require 'flavored-path'
Os = require 'os'
git = require '../../lib/git'
{repo, pathToRepoFile} = require '../fixtures'
GitShow = require '../../lib/models/git-show'
describe "GitShow", ->
beforeEach ->
spyOn(git, 'cmd').andReturn Promise.resolve 'foobar'
it "calls git.cmd with 's... | fs = require 'fs-plus'
Path = require 'flavored-path'
Os = require 'os'
git = require '../../lib/git'
{repo, pathToRepoFile} = require '../fixtures'
GitShow = require '../../lib/models/git-show'
describe "GitShow", ->
beforeEach ->
spyOn(git, 'cmd').andReturn Promise.resolve 'foobar'
it "calls git.cmd with 's... |
Fix ESLint errors on save | "*":
core:
disabledPackages: [
"minimap"
]
telemetryConsent: "limited"
editor:
fontSize: 13
scrollPastEnd: true
zoomFontWhenCtrlScrolling: false
linter: {}
"linter-eslint":
lintHtmlFiles: true
welcome:
showOnStartup: false
| "*":
core:
disabledPackages: [
"minimap"
]
telemetryConsent: "limited"
editor:
fontSize: 13
scrollPastEnd: true
zoomFontWhenCtrlScrolling: false
linter: {}
"linter-eslint":
fixOnSave: true
lintHtmlFiles: true
welcome:
showOnStartup: false
|
Send the preferred line length to the analysis_server during formatting |
module.exports =
class EditAPI
constructor: (@api) ->
format: (file, offset, length) =>
@api.perform 'edit.format',
file: file
selectionOffset: offset
selectionLength: length
|
module.exports =
class EditAPI
constructor: (@api) ->
format: (file, offset, length) =>
@api.perform 'edit.format',
file: file
selectionOffset: offset
selectionLength: length
lineLength: atom.config.get('editor.preferredLineLength')
|
Fix prev method when repeat is on | class Storage
images: {}
counter: 0
constructor: (repeat) ->
@repeat = not not repeat
add: (image) ->
return false unless image.orig
cid = @counter++
fragments = image.orig.split '/'
image.hashbang = fragments[fragments.length-1]
image.thumb = image.orig unless image.thumb
@ima... | class Storage
images: {}
counter: 0
constructor: (repeat) ->
@repeat = not not repeat
add: (image) ->
return false unless image.orig
cid = @counter++
fragments = image.orig.split '/'
image.hashbang = fragments[fragments.length-1]
image.thumb = image.orig unless image.thumb
@ima... |
Remove useless revision property on document. Compute it from the operations list. | OT = require './'
module.exports = class Document
constructor: ->
@text = ""
@revision = 0
@operations = []
apply: (newOperation, revision) ->
# Should't happened
throw new Error "The operation base revision is greater than the document revision" if revision > @revision
if ... | OT = require './'
module.exports = class Document
constructor: ->
@text = ""
@operations = []
apply: (newOperation, revision) ->
# Should't happened
throw new Error "The operation base revision is greater than the document revision" if revision > @operations.length
if revision ... |
Add login route copy for /works-for-you | module.exports =
templateMap:
signup: -> require('./templates/signup.jade') arguments...
login: -> require('./templates/login.jade') arguments...
register: -> require('./templates/register.jade') arguments...
forgot: -> require('./templates/forgot.jade') arguments...
reset: -> require('./templates... | module.exports =
templateMap:
signup: -> require('./templates/signup.jade') arguments...
login: -> require('./templates/login.jade') arguments...
register: -> require('./templates/register.jade') arguments...
forgot: -> require('./templates/forgot.jade') arguments...
reset: -> require('./templates... |
Make it so we're not creating a redundant wrapper function. | Promise = require 'bluebird'
fs = Promise.promisifyAll require 'fs'
_ = require 'lodash'
module.exports = () ->
# For performance reasons, we'll do this asynchronously.
fs.readdirAsync('./controllers/').then (controllers) ->
#This probably isn't necessary: I wanted to parse t... | Promise = require 'bluebird'
fs = Promise.promisifyAll require 'fs'
_ = require 'lodash'
module.exports = () ->
# For performance reasons, we'll do this asynchronously.
fs.readdirAsync('./controllers/').then (controllers) ->
#This probably isn't necessary: I wanted to parse t... |
Fix new view tool wait | should = require 'should'
{wd40, browser, login_url, home_url, prepIntegration} = require './helper'
describe 'New view tool', ->
prepIntegration()
before (done) ->
wd40.fill '#username', 'ehg', ->
wd40.fill '#password', 'testing', ->
wd40.click '#login', done
context 'when I click on an Apri... | should = require 'should'
{wd40, browser, login_url, home_url, prepIntegration} = require './helper'
describe 'New view tool', ->
prepIntegration()
before (done) ->
wd40.fill '#username', 'ehg', ->
wd40.fill '#password', 'testing', ->
wd40.click '#login', done
context 'when I click on an Apri... |
Change the route preview colour to white. | document.addEventListener "turbolinks:load", ->
$(".img-check").click ->
$(this).toggleClass("checked")
routePreviewBoards = $('.route-preview.board')
if routePreviewBoards.length > 0
routeSVGId = routePreviewBoards.data('routesvgid')
route = $('#svg_' + routeSVGId)
route.attr('filter', 'url(#gl... | document.addEventListener "turbolinks:load", ->
$(".img-check").click ->
$(this).toggleClass("checked")
routePreviewBoards = $('.route-preview.board')
if routePreviewBoards.length > 0
routeSVGId = routePreviewBoards.data('routesvgid')
route = $('#svg_' + routeSVGId)
route.attr('filter', 'url(#gl... |
Fix issue where partial matches of email address are returned from the JIRA api | Config = require "../config"
Utils = require "../utils"
class User
@withEmail: (email) ->
Utils.fetch("#{Config.jira.url}/rest/api/2/user/search?username=#{email}")
.then (user) ->
jiraUser = user[0] if user and user.length is 1
throw "Cannot find jira user with #{email}, trying myself" unless j... | _ = require "underscore"
Config = require "../config"
Utils = require "../utils"
class User
@withEmail: (email) ->
Utils.fetch("#{Config.jira.url}/rest/api/2/user/search?username=#{email}")
.then (users) ->
jiraUser = _(users).findWhere emailAddress: email if users and users.length > 0
throw "... |
Allow about page to be access w/o login | 'use strict'
angular.module 'flickrSimpleReorder'
.config [
'$stateProvider'
'$urlRouterProvider'
(
$stateProvider
$urlRouterProvider
) ->
$urlRouterProvider.otherwise '/photosets'
$stateProvider
.state 'login',
url: '/login?frob&isFrobInvalid'
controller: 'LoginCtrl'
te... | 'use strict'
angular.module 'flickrSimpleReorder'
.config [
'$stateProvider'
'$urlRouterProvider'
(
$stateProvider
$urlRouterProvider
) ->
$urlRouterProvider.otherwise '/photosets'
$stateProvider
.state 'login',
url: '/login?frob&isFrobInvalid'
controller: 'LoginCtrl'
te... |
Move report form error to getInitialState | React = {findDOMNode} = require 'react'
Feedback = require './mixins/feedback'
talkClient = require '../api/talk'
module?.exports = React.createClass
displayName: 'TalkCommentReportForm'
mixins: [Feedback]
propTypes:
comment: React.PropTypes.object
error: ''
onSubmit: (e) ->
e.preventDefault()
... | React = {findDOMNode} = require 'react'
Feedback = require './mixins/feedback'
talkClient = require '../api/talk'
module?.exports = React.createClass
displayName: 'TalkCommentReportForm'
mixins: [Feedback]
propTypes:
comment: React.PropTypes.object
getInitialState: ->
error: ''
onSubmit: (e) ->
... |
Handle case where stopword file !exists | path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
module.exports = stopwords = (content, language = 'en') ->
filePath = path.join(__dirname, "..", "data", "sto... | path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
getFilePath = (language) ->
path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
mod... |
Use template instance's version of autorun | Template.blogLatest.rendered = ->
num = if @data?.num then @data.num else 3
Deps.autorun ->
Meteor.subscribe 'posts', num
Template.blogLatest.helpers
latest: ->
Post.all()
date: (date) ->
if date
date = new Date(date)
moment(date).format('MMMM Do, YYYY')
| Template.blogLatest.rendered = ->
num = if @data?.num then @data.num else 3
@autorun ->
Meteor.subscribe 'posts', num
Template.blogLatest.helpers
latest: ->
Post.all()
date: (date) ->
if date
date = new Date(date)
moment(date).format('MMMM Do, YYYY')
|
Fix missing username and add ref | setup500px = () ->
_500px.init {
sdk_key: 'fdcaea5c35561158c89cf39bf30efc827d7d88cd'
}
_500px.on 'authorization_obtained', () ->
$('#not_logged_in').hide()
$('#logged_in').show()
_500px.api '/users', (response) ->
me = response.data.user;
$('#username').html(username)
_500px.on 'l... | # Taken from https://github.com/500px/500px-js-sdk/blob/master/examples/example1.html
setup500px = () ->
_500px.init {
sdk_key: 'fdcaea5c35561158c89cf39bf30efc827d7d88cd'
}
_500px.on 'authorization_obtained', () ->
$('#not_logged_in').hide()
$('#logged_in').show()
_500px.api '/users', (response)... |
Disable documentation generation in id-project | (require "id-project")
browserify: enabled: false
copy: enabled: false
less: enabled: false
livereload: enabled: false
nodemon: enabled: false
forever: enabled: false
documentation: enabled: true
clean: enabled: true
watch: enabled: true
tests: enabl... | (require "id-project")
browserify: enabled: false
copy: enabled: false
less: enabled: false
livereload: enabled: false
nodemon: enabled: false
forever: enabled: false
documentation: enabled: false
clean: enabled: true
watch: enabled: true
tests: enab... |
Use Mocha Landing Strip reporter to prevent long lists | path = require('path')
gulp = require('gulp')
mocha = require('gulp-mocha')
coffeelint = require('gulp-coffeelint')
mochaNotifierReporter = require('mocha-notifier-reporter')
OPTIONS =
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
tests: 'li... | path = require('path')
gulp = require('gulp')
mocha = require('gulp-mocha')
coffeelint = require('gulp-coffeelint')
mochaNotifierReporter = require('mocha-notifier-reporter')
OPTIONS =
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
tests: 'li... |
Add initScript field which is valid for every JMachines | { Module } = require 'jraphical'
module.exports = class JMachine extends Module
{ ObjectId } = require 'bongo'
@set
indexes :
kiteId : 'unique'
sharedEvents :
static : [ ]
instance : [ ]
schema :
kiteId ... | { Module } = require 'jraphical'
module.exports = class JMachine extends Module
{ ObjectId } = require 'bongo'
@set
indexes :
kiteId : 'unique'
sharedEvents :
static : [ ]
instance : [ ]
schema :
kiteId ... |
Fix colorForState for repos list | `import Ember from 'ember'`
`import colorForState from 'travis/utils/helpers'`
View = Ember.CollectionView.extend
elementId: 'repos'
tagName: 'ul'
emptyView: Ember.View.extend
templateName: 'repos-list/empty'
itemViewClass: Ember.View.extend
repoBinding: 'content'
classNames: ['repo']
classNa... | `import Ember from 'ember'`
`import { colorForState } from 'travis/utils/helpers'`
View = Ember.CollectionView.extend
elementId: 'repos'
tagName: 'ul'
emptyView: Ember.View.extend
templateName: 'repos-list/empty'
itemViewClass: Ember.View.extend
repoBinding: 'content'
classNames: ['repo']
cla... |
Add /requests/new route to RequestCreateCtrl | 'use strict'
angular
.module('taarifaWaterpointsApp', [
'ngResource',
'ngRoute',
'leaflet-directive',
'dynform',
'angular-flash.service',
'angular-flash.flash-alert-directive'
])
.config ($routeProvider, flashProvider) ->
$routeProvider
.when '/',
templateUrl: 'views/mai... | 'use strict'
angular
.module('taarifaWaterpointsApp', [
'ngResource',
'ngRoute',
'leaflet-directive',
'dynform',
'angular-flash.service',
'angular-flash.flash-alert-directive'
])
.config ($routeProvider, flashProvider) ->
$routeProvider
.when '/',
templateUrl: 'views/mai... |
Add ctrl-h and ctrl-d bindings | window.keymap.bindKeys '.editor',
'ctrl-f': 'move-right'
'ctrl-b': 'move-left'
'ctrl-p': 'move-up'
'ctrl-n': 'move-down'
'alt-f': 'move-to-next-word'
'alt-b': 'move-to-previous-word'
'ctrl-a': 'move-to-first-character-of-line'
'ctrl-e': 'move-to-end-of-line'
| window.keymap.bindKeys '.editor',
'ctrl-f': 'move-right'
'ctrl-b': 'move-left'
'ctrl-p': 'move-up'
'ctrl-n': 'move-down'
'alt-f': 'move-to-next-word'
'alt-b': 'move-to-previous-word'
'ctrl-a': 'move-to-first-character-of-line'
'ctrl-e': 'move-to-end-of-line'
'ctrl-h': 'backspace'
'ctrl-d': 'delete'
|
Disable some core atom packages | "*":
Zen:
softWrap: true
tabs: "multiple"
"block-cursor":
global:
blinkOn: {}
core:
disabledPackages: [
"language-c"
"language-clojure"
"language-coffee-script"
"language-csharp"
"language-go"
"language-java"
"language-mustache"
"language-make"... | "*":
Zen:
softWrap: true
tabs: "multiple"
"block-cursor":
global:
blinkOn: {}
core:
disabledPackages: [
"language-c"
"language-clojure"
"language-coffee-script"
"language-csharp"
"language-go"
"language-java"
"language-mustache"
"language-make"... |
Add image and scroll view | {Layer} = require "./Layer"
compatProperty = (name) ->
exportable: false
get: -> @[name]
set: (value) -> @[name] = value
class CompatView extends Layer
constructor: (options={}) ->
console.debug "CompatView.constructor: Views are now called Layers"
if options.hasOwnProperty "superView"
options.superLaye... | {Layer} = require "./Layer"
compatProperty = (name) ->
exportable: false
get: -> @[name]
set: (value) -> @[name] = value
class CompatView extends Layer
constructor: (options={}) ->
console.debug "CompatView.constructor: Views are now called Layers"
if options.hasOwnProperty "superView"
options.superLaye... |
Use locally running redis for tests. | redis = switch process.env.NODE_ENV
when 'test' then require 'redis-mock'
else 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... | 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()
# Export database variable
module.exports = db
|
Support for literal author names | module.exports =
parse: (cp) =>
if not Array.isArray(cp)
cp = [cp]
# Convert citeproc to internal format
cp_references = []
for ref in cp
cp_object = {}
cp_object.citationKey = ref.id
cp_object.entryType = ref.type
tags = {}
# Title
tags.title = ref.title
... | module.exports =
parse: (cp) =>
if not Array.isArray(cp)
cp = [cp]
# Convert citeproc to internal format
cp_references = []
for ref in cp
cp_object = {}
cp_object.citationKey = ref.id
cp_object.entryType = ref.type
tags = {}
# Title
tags.title = ref.title
... |
Update transfer modifier color to be red | RelationFactory = require "../models/relation-factory"
linkColors = module.exports =
default :'#777'
defaultFaded : "rgba(120,120,120,0)"
increase : "rgba(232,93,100,1)"
decrease : "rgba(142,162,225,1)"
transferModifier : "rgba(182,182,182,1)"
transferPipe ... | RelationFactory = require "../models/relation-factory"
linkColors = module.exports =
default :'#777'
defaultFaded : "rgba(120,120,120,0)"
increase : "rgba(232,93,100,1)"
decrease : "rgba(142,162,225,1)"
transferModifier : "rgba(232,93,100,1)"
transferPipe ... |
Add turbolinks 5 event name | window.Binco.Select2 =
load: (selector) ->
selector = if typeof selector == 'string' then selector else '.select2-rails'
$(selector).select2()
$(document).on 'ready page:load', window.Binco.Select2.load
| window.Binco.Select2 =
load: (selector) ->
selector = if typeof selector == 'string' then selector else '.select2-rails'
$(selector).select2()
$(document).on 'ready turbolinks:load', window.Binco.Select2.load
|
Add support for installation of a specific package to installPackage() | npmi = require 'npmi'
module.exports = (packagePath, callback) ->
npmi path: packagePath, (err, result) ->
callback err if err
callback null, result
| npmi = require 'npmi'
module.exports = (packageName, packageVersion, targetPath, callback) ->
# (packagePath, callback) → `npm install` in targetPath
if arguments.length is 2
targetPath = packageName
callback = packageVersion
npmiOptions = path: targetPath
else
npmiOptions =
name: packageName
version... |
Increase time-out to 5 seconds. | exports.config =
# Note: the debug and logLevel options are set in the grunt
# protractor task based on whether the grunt command is
# executed with the --debug option.
# Run under the mocha framework rather than the default jasmine.
framework: 'mocha'
# If the selenium address is not specified, then prot... | exports.config =
# Note: the debug and logLevel options are set in the grunt
# protractor task based on whether the grunt command is
# executed with the --debug option.
# Run under the mocha framework rather than the default jasmine.
framework: 'mocha'
# If the selenium address is not specified, then prot... |
Remove file and project from bottom views | Views = {
currentFile:(linter) ->
root = document.createElement 'div'
root.innerHTML = 'Current File'
root.classList.add 'linter-tab'
root.classList.add 'active'
root.addEventListener 'click', ->
linter.bottom.barProject.root.classList.remove 'active'
root.classList.add 'active'
... | Views = {
status: ->
root = document.createElement 'div'
root.classList.add 'linter-success'
root.classList.add 'inline-block'
child = document.createElement 'span'
child.classList.add 'icon'
root.appendChild child
return {root, child}
}
module.exports = Views
|
Remove obsolete(?) defaultLevel, replace with formatMessage | linterPath = atom.packages.getLoadedPackage('linter').path
Linter = require "#{linterPath}/lib/linter"
{CompositeDisposable} = require 'atom'
class LinterGovet extends Linter
@syntax: ['source.go']
cmd: ['go', 'tool', 'vet', '-v']
errorStream: 'stderr'
defaultLevel: 'warning'
linterName: 'govet'
regex... | linterPath = atom.packages.getLoadedPackage('linter').path
Linter = require "#{linterPath}/lib/linter"
class LinterGovet extends Linter
@syntax: ['source.go']
cmd: ['go', 'tool', 'vet', '-v']
errorStream: 'stderr'
linterName: 'govet'
regex: '.+?:(?<line>\\d+):((?<col>\\d+):)? (?<warning>.+)'
options: ... |
Fix broken client side validation. | define [
'chaplin'
'models/base/model'
'models/tags'
], (Chaplin, Model, Tags) ->
'use strict'
class User extends Model
validation:
username:
required: true
email:
pattern: 'email',
required: true
email_confirmed:
fn: 'emailConfirmed'
required: t... | define [
'chaplin'
'models/base/model'
'models/tags'
], (Chaplin, Model, Tags) ->
'use strict'
class User extends Model
validation:
username:
required: true
email:
pattern: 'email',
required: true
email_confirmation:
fn: 'emailConfirmed'
password: ... |
Remove left over console logs | fs = require('fs')
path = require('path')
_ = require('underscore')
APP_CONFIG = null
exports.get = (key) ->
unless APP_CONFIG?
console.log 'no app config'
APP_CONFIG = readConfigFile()
_.clone(APP_CONFIG[key])
getEnv = ->
process.env.NODE_ENV || 'development'
readConfigFile = ->
env = getEnv()
... | fs = require('fs')
path = require('path')
_ = require('underscore')
APP_CONFIG = null
exports.get = (key) ->
unless APP_CONFIG?
console.log 'no app config'
APP_CONFIG = readConfigFile()
_.clone(APP_CONFIG[key])
getEnv = ->
process.env.NODE_ENV || 'development'
readConfigFile = ->
env = getEnv()
... |
Remove a temporary kludge that is no longer needed | # Copyright 2012 The Apache Software Foundation
#
# 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 agre... | # Copyright 2012 The Apache Software Foundation
#
# 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 agre... |
Add ctrl-shift-w to close all tabs | '.platform-win32, .platform-linux':
'alt-\\': 'unset!' # tree-view:toggle-focus default
'ctrl-|': 'unset!' # tree-view:reveal-active-file default
'ctrl-\\': 'unset!' # tree-view:toggle default
'ctrl-0': 'tree-view:reveal-active-file'
'ctrl-h': 'find-and-replace:show'
'ctrl-\\': 'pane:split-right'
'atom-wor... | '.platform-win32, .platform-linux':
'alt-\\': 'unset!' # tree-view:toggle-focus default
'ctrl-|': 'unset!' # tree-view:reveal-active-file default
'ctrl-\\': 'unset!' # tree-view:toggle default
'ctrl-0': 'tree-view:reveal-active-file'
'ctrl-h': 'find-and-replace:show'
'ctrl-\\': 'pane:split-right'
'atom-wor... |
Add a placeholder name for new timelets. | # Collection view of timelets.
#
# The @collection will render as an index of timelets which can be
# loaded into the clock.
#
class Essence.Views.Timelets extends Backbone.Marionette.CompositeView
template: 'modules/timelet/templates/timelets'
itemViewContainer: 'ul'
itemView: Essence.Views.Timelet
emptyView... | # Collection view of timelets.
#
# The @collection will render as an index of timelets which can be
# loaded into the clock.
#
class Essence.Views.Timelets extends Backbone.Marionette.CompositeView
template: 'modules/timelet/templates/timelets'
itemViewContainer: 'ul'
itemView: Essence.Views.Timelet
emptyView... |
Fix error with device not defined | if Meteor.isCordova
if device.platform.toLowerCase() isnt 'android'
document.addEventListener 'deviceready', ->
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
window.addEventListener 'native.keyboardshow', ->
$('.main-content').css 'height', window.... | if Meteor.isCordova
document.addEventListener 'deviceready', ->
if device?.platform.toLowerCase() isnt 'android'
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
window.addEventListener 'native.keyboardshow', ->
if device?.platform.toLowerCase() isnt 'a... |
Add Atom Configuration Variables for Commands | module.exports =
configDefaults:
clangExecutablePath: null
clangIncludePath: '.'
clangSuppressWarnings: false
clangDefaultCFlags: '-Wall'
clangDefaultCppFlags: '-Wall'
activate: ->
console.log 'activate linter-clang'
| module.exports =
configDefaults:
clangCommand: 'clang'
clangPlusPlusCommand: 'clang++'
clangExecutablePath: null
clangIncludePath: '.'
clangSuppressWarnings: false
clangDefaultCFlags: '-Wall'
clangDefaultCppFlags: '-Wall'
activate: ->
console.log 'activate linter-clang'
|
Remove second copy of knockout from build | module.exports =
module:
loaders: [{test: /\.coffee$/, loader: 'coffee'}]
resolve:
root: '.'
extensions: ['', '.coffee', '.js']
moduleDirectories: ['node_modules']
| module.exports =
module:
loaders: [
{test: /\.coffee$/, loader: 'coffee'}
{test: /knockout.build.output.knockout-latest\.js/, loader: 'imports?require=>false'}
]
resolve:
root: '.'
extensions: ['', '.coffee', '.js']
moduleDirectories: ['node_modules']
|
Fix for moving to a new location. | LOI = LandsOfIllusions
AM = Artificial.Mummification
Nodes = LOI.Adventure.Script.Nodes
class LOI.Memory.Actions.Move extends LOI.Memory.Action
# content:
# landmark: the named point or object that can be looked up to get its coordinates
# coordinates: direct location coordinates, if landmark is not specifi... | LOI = LandsOfIllusions
AM = Artificial.Mummification
Nodes = LOI.Adventure.Script.Nodes
class LOI.Memory.Actions.Move extends LOI.Memory.Action
# content:
# landmark: the named point or object that can be looked up to get its coordinates
# coordinates: direct location coordinates, if landmark is not specifi... |
Increase specificity of toggle-preview keybinding | '.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-win32 .markdow... | '.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... |
Add bankhead to terminal stations list | Template.displayETA.arrivals = (direction)->
stop = Session.get 'etaStop'
if not stop
return
return Arrivals.find({ station: stop, direction: direction },{ sort: ['next_arr'] })
Template.displayETA.hasDirection = (direction)->
stop = Session.get 'etaStop'
if not stop
return false
return Arrivals.fi... | Template.displayETA.arrivals = (direction)->
stop = Session.get 'etaStop'
if not stop
return
return Arrivals.find({ station: stop, direction: direction },{ sort: ['next_arr'] })
Template.displayETA.hasDirection = (direction)->
stop = Session.get 'etaStop'
if not stop
return false
return Arrivals.fi... |
Append comment replies to the replies div now that we have one | $ ->
$("[data-flyover-comments-reply-link='true']").click (e)->
e.preventDefault()
parentId = $(@).data("parent-id")
appendToId = $(@).data("append-to")
container = $(@).attr("href")
if $(container).children(".flyover-comment-reply-form").length
$(container).children(".flyover-comment-reply... | $ ->
$("[data-flyover-comments-reply-link='true']").click (e)->
e.preventDefault()
parentId = $(@).data("parent-id")
container = $(@).attr("href")
if $(container).children(".flyover-comment-reply-form").length
$(container).children(".flyover-comment-reply-form").remove()
else
$f = $("... |
Make keymaps consistent with nteract and jupyter notebook | # 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://ato... | # 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://ato... |
Fix bugs in scaffolding causing overlay not to appear. | BreakView = require './break-view'
module.exports =
breakView: null
# In miliseconds
breakInterval: 300000 # 5 minute default
breakLength: 60000 # 1 minute defualt
activate: (state) ->
# Start Timer
@timer()
deactivate: ->
@breakView.destroy()
serialize: ->
breakViewState: @breakView.... | BreakView = require './break-view'
module.exports =
breakView: null
# In miliseconds
breakInterval: 300000 # 5 minute default
breakLength: 60000 # 1 minute defualt
activate: (@state) ->
# Start Timer
@timer()
deactivate: ->
@breakView.destroy()
serialize: ->
breakViewState: @breakView... |
Set the correct require path in the command store tests | require ["/extension/command-store.js"], ->
describe "CommandStore", ->
describe "#mergeCommands", ->
beforeEach ->
command = gistID: 1, name: "Test"
CommandStore.commands = [command]
CommandStore.commandIndex = 1: command
it "adds commands", ->
expect(-> CommandStore... | require ["/extension/scripts/command-store.js"], ->
describe "CommandStore", ->
describe "#mergeCommands", ->
beforeEach ->
command = gistID: 1, name: "Test"
CommandStore.commands = [command]
CommandStore.commandIndex = 1: command
it "adds commands", ->
expect(-> Comm... |
Add argument for master/retailer mode. Add argument descriptions. | CSV = require('csv')
Q = require('q')
argv = require('optimist')
.usage('Usage: $0 --types product-types.csv --attributes product-types-attributes.csv --target ./')
.demand(['types', 'attributes', 'target'])
.argv
ProductTypeGenerator = require('../main').ProductTypeGenerator
options =
target: argv.target
#... | CSV = require('csv')
Q = require('q')
argv = require('optimist')
.usage('Usage: $0 --types [CSV] --attributes [CSV] --target [folder] --retailer [boolean]')
.alias('types', 't')
.alias('attributes', 'a')
.alias('target', 't')
.alias('retailer', 'r')
.default('retailer', false)
.describe('types', 'Path to... |
Add log to fix last failing test | {WorkspaceView} = require 'atom'
Minimap = require '../lib/minimap'
editorView = null
describe "MinimapView", ->
beforeEach ->
runs ->
# atom.config.set 'minimap', Minimap.configDefaults
atom.workspaceView = new WorkspaceView
waitsForPromise ->
atom.workspaceView.open('sample.js')
... | {WorkspaceView} = require 'atom'
Minimap = require '../lib/minimap'
editorView = null
describe "MinimapView", ->
beforeEach ->
runs ->
atom.config.set 'minimap', Minimap.configDefaults
atom.workspaceView = new WorkspaceView
waitsForPromise ->
atom.workspaceView.open('sample.js')
ru... |
Clean up radio bindings and properly set node string values. | #= require ./abstract_binding
class Batman.DOM.RadioBinding extends Batman.DOM.AbstractBinding
isInputBinding: true
dataChange: (value) ->
# don't overwrite `checked` attributes in the HTML unless a bound
# value is defined in the context. if no bound value is found, bind
# to the key if the node is ch... | #= require ./abstract_binding
class Batman.DOM.RadioBinding extends Batman.DOM.AbstractBinding
constructor: (node) ->
super
@set 'filteredValue', node.value if node.checked
dataChange: (value) ->
boundValue = @get 'filteredValue'
@node.checked = (boundValue is Batman.DOM.attrReaders._parseAttribut... |
Update description of "Poet Mode" | twoParensTogether = (api) ->
prior = api.peek -1
prior[0] is 'CALL_START' and prior[1] is '('
closingParenWasExplicit = (token) ->
not token.generated
closingParenAtEndOfLine = (api) ->
next = api.peek 1
next[0] is 'TERMINATOR' and next[1] is '\n'
module.exports = class PreferPoetMode
rule:
name: 'pr... | twoParensTogether = (api) ->
prior = api.peek -1
prior[0] is 'CALL_START' and prior[1] is '('
closingParenWasExplicit = (token) ->
not token.generated
closingParenAtEndOfLine = (api) ->
next = api.peek 1
next[0] is 'TERMINATOR' and next[1] is '\n'
module.exports = class PreferPoetMode
rule:
name: 'pr... |
Remove transferPropsTo from markdown editor | React = require 'react'
Markdown = require './markdown'
module.exports = React.createClass
displayName: 'MarkdownEditor'
getInitialState: ->
previewing: false
value: @props.defaultValue ? ''
render: ->
previewing = @props.previewing ? @state.previewing
<div className={['markdown-editor', @prop... | React = require 'react'
Markdown = require './markdown'
module.exports = React.createClass
displayName: 'MarkdownEditor'
getInitialState: ->
previewing: false
value: @props.defaultValue ? ''
getDefaultProps: ->
rows: '5'
render: ->
previewing = @props.previewing ? @state.previewing
<div... |
Allow to optionally load widgets in node.js package | path = require "path"
assert = require "assert"
rootRequire = require("root-require")
root = rootRequire.packpath.parent()
pkg = rootRequire("./package.json")
module.constructor.prototype.require = (modulePath) ->
assert(modulePath, 'missing path')
assert(typeof modulePath == 'string', 'path must be a string')
... | path = require "path"
assert = require "assert"
rootRequire = require("root-require")
root = rootRequire.packpath.parent()
pkg = rootRequire("./package.json")
module.constructor.prototype.require = (modulePath) ->
assert(modulePath, 'missing path')
assert(typeof modulePath == 'string', 'path must be a string')
... |
Rebuild native modules when atom-shell is upgraded | module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'update-atom-shell', 'Update atom-shell', ->
done = @async()
spawn cmd: 'script/update-atom-shell', (error) -> done(error)
| path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
getAtomShellVersion = ->
versionPath = path.join('atom-shell', 'version')
if grunt.file.isFile(versionPath)
grunt.file.read(versionPath).trim()
else
null
grunt.registerTask 'update-atom-shell', ... |
Move from 4 to 2 spaces in coffeescript | express = require("express")
path = require("path")
http = require("http")
app = express()
app.set "port", process.env.PORT || 3000
# Log requests to the console
app.use express.logger "dev"
# Allow the app to read JSON from the body in POSTs and PUTs
app.use express.bodyParser()
# OS-agnostic way of going up two dire... | express = require("express")
path = require("path")
http = require("http")
app = express()
app.set "port", process.env.PORT || 3000
# Log requests to the console
app.use express.logger "dev"
# Allow the app to read JSON from the body in POSTs and PUTs
app.use express.bodyParser()
# OS-agnostic way of going up two d... |
Read config.toml by using a stream | path = require 'path'
async = require 'async'
topl = require 'topl'
fs = undefined
try
fs = require 'graceful-fs'
catch error
fs = require 'fs'
fileExists = fs.exists or path.exists
# Read and parse a TOML file.
#
# filename - The String path to a TOML file.
# callback - The Function called after parsing.
#
# R... | path = require 'path'
async = require 'async'
topl = require 'topl'
fs = undefined
try
fs = require 'graceful-fs'
catch error
fs = require 'fs'
fileExists = fs.exists or path.exists
# Read and parse a TOML file.
#
# filename - The String path to a TOML file.
# callback - The Function called after parsing.
#
# R... |
Use ::detached instead of ::beforeRemove hook | path = require 'path'
Q = require 'q'
SymbolsView = require './symbols-view'
TagReader = require './tag-reader'
module.exports =
class GoToView extends SymbolsView
toggle: ->
if @panel.isVisible()
@cancel()
else
@populate()
beforeRemove: ->
@deferredFind?.resolve([])
findTag: (editor) -... | path = require 'path'
Q = require 'q'
SymbolsView = require './symbols-view'
TagReader = require './tag-reader'
module.exports =
class GoToView extends SymbolsView
toggle: ->
if @panel.isVisible()
@cancel()
else
@populate()
detached: ->
@deferredFind?.resolve([])
findTag: (editor) ->
... |
Fix case where importing complexity = 0 | AppSettingsStore = require('../../stores/app-settings-store').store
migration =
version: "1.22.0"
description: "Add simulation type"
date: "2018-03-30"
doUpdate: (data) ->
data.settings ?= {}
# previous complexities were:
# 0: diagram only
# 1: basic relationships
# 2: expanded relatio... | AppSettingsStore = require('../../stores/app-settings-store').store
migration =
version: "1.22.0"
description: "Add simulation type"
date: "2018-03-30"
doUpdate: (data) ->
data.settings ?= {}
# previous complexities were:
# 0: diagram only
# 1: basic relationships
# 2: expanded relatio... |
Use a function to determine value | define (require) ->
settings = require('settings')
FooterTabView = require('cs!../inherits/tab/tab')
template = require('hbs!./metadata-template')
require('less!./metadata')
return class MetadataView extends FooterTabView
template: template
templateHelpers: () ->
model = super()
model.lan... | define (require) ->
settings = require('settings')
FooterTabView = require('cs!../inherits/tab/tab')
template = require('hbs!./metadata-template')
require('less!./metadata')
return class MetadataView extends FooterTabView
template: template
templateHelpers: () ->
model = super()
model.lan... |
Return JSON object instead of a primitive | request = require 'request'
_ = require 'lodash'
class StockController
lastTradePrice: (req, res) =>
@request req.params.symbol, (error, response, body) =>
return res.status(500).send(error) if error?
res.status(response.statusCode).send(body)
request: (symbol, callback=->) =>
options =
... | request = require 'request'
_ = require 'lodash'
class StockController
lastTradePrice: (req, res) =>
@request req.params.symbol, (error, response, body) =>
return res.status(500).send(error) if error?
res.status(response.statusCode).send price: parseFloat(body)
request: (symbol, callback=->)... |
Fix autosoft wrap for md files in Atom | # Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
atom.workspaceView.eachEdit... | # Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# Make opened Markdown files always be soft wrapped:
path = require 'path'
atom.workspaceView.eachEditorView (editorView) ->
... |
Add API call to Daily Cute and pick image using msg.random. | module.exports = (robot) ->
robot.respond /hello/, (msg) ->
msg.reply "hello!"
robot.hear /orly/, ->
msg.send "yarly"
| module.exports = (robot) ->
robot.respond /hello/, (msg) ->
msg.reply "hello!"
robot.hear /orly/, ->
msg.send "yarly"
cuteMe = (msg) ->
msg.http("http://api.dailycute.com.net/v1/posts/all")
.get() (body) ->
results = JSON.parse(body)
msg.send (msg.random results.posts).image_sr... |
Add a link to the image to display the comic. | # Description:
# The Adventures of Captain Quail, now in you chat!
#
# Dependencies:
# "htmlparser": "1.7.6"
# "soupselect": "0.2.0"
#
# Configuration:
# None
#
# Commands:
# hubot cq - The latest Adventures of Captain Quail
#
# Author:
# phildini
htmlparser = require "htmlparser"
Select = require("soupsel... | # Description:
# The Adventures of Captain Quail, now in you chat!
#
# Dependencies:
# "htmlparser": "1.7.6"
# "soupselect": "0.2.0"
#
# Configuration:
# None
#
# Commands:
# hubot cq - The latest Adventures of Captain Quail
#
# Author:
# phildini
htmlparser = require "htmlparser"
Select = require("soupsel... |
Fix typo: PORT is capitalized | express = require("express")
routes = require("./routes")
app = module.exports = express.createServer()
app.configure ->
app.set "views", __dirname + "/views"
app.set "view engine", "jade"
app.use express.bodyParser()
app.use express.methodOverride()
app.use app.router
app.use express.static(__dirname + "/a... | express = require("express")
routes = require("./routes")
app = module.exports = express.createServer()
app.configure ->
app.set "views", __dirname + "/views"
app.set "view engine", "jade"
app.use express.bodyParser()
app.use express.methodOverride()
app.use app.router
app.use express.static(__dirname + "/a... |
Remove spaces from image size view | {View} = require 'atom'
ImageEditor = require './image-editor'
module.exports =
class ImageEditorStatusView extends View
@content: ->
@div class: 'status-image inline-block', =>
@span class: 'image-size', outlet: 'imageSizeStatus'
initialize: (filePath, image) =>
@filePath = filePath
@image = im... | {View} = require 'atom'
ImageEditor = require './image-editor'
module.exports =
class ImageEditorStatusView extends View
@content: ->
@div class: 'status-image inline-block', =>
@span class: 'image-size', outlet: 'imageSizeStatus'
initialize: (filePath, image) =>
@filePath = filePath
@image = im... |
Use ErroDisplay and render using function component | ##= require_self
##= require ./Import
##= require ./ApiInfo
##= require ./ChooseRecords
##= require ./ViewRecords
class Skr.Screens.FreshBooksImport extends Skr.Screens.Base
modelForAccess: 'invoice'
getInitialState: -> isEditing: true
dataObjects:
import: ->
new Skr.Screens.FreshBooksI... | ##= require_self
##= require ./Import
##= require ./ApiInfo
##= require ./ChooseRecords
##= require ./ViewRecords
class Skr.Screens.FreshBooksImport extends Skr.Screens.Base
modelForAccess: 'invoice'
getInitialState: -> isEditing: true
dataObjects:
import: ->
new Skr.Screens.FreshBooksI... |
Set proper amount for checkins | mongoose = require('mongoose')
checkinSchema = new mongoose.Schema
user: String
session: Number
checkinTime: Date
deleted: { type: Boolean, default: false }
deletedTime: Date
checkinSchema.methods.upsert = () ->
# https://jira.mongodb.org/browse/SERVER-14322
try
@checkinTime = new ... | mongoose = require('mongoose')
checkinSchema = new mongoose.Schema
user: String
session: Number
checkinTime: Date
deleted: { type: Boolean, default: false }
deletedTime: Date
checkinSchema.methods.upsert = () ->
# https://jira.mongodb.org/browse/SERVER-14322
try
@checkinTime = new ... |
Edit content on load instead of workspace | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!app'
'cs!collections/content'
'cs!views/layouts/workspace'
'less!styles/main.less'
], ($, _, Backbone, Marionette, app, content, WorkspaceLayout) ->
return new class Router extends Marionette.AppRouter
# Show Workspace
# -------
#... | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!app'
'cs!collections/content'
'cs!views/layouts/workspace'
'less!styles/main.less'
], ($, _, Backbone, Marionette, app, content, WorkspaceLayout) ->
return new class Router extends Marionette.AppRouter
# Show Workspace
# -------
#... |
Improve object notation to increase readability | ParticipantHeads = require 'activity/views/privatemessage/participantheads'
IDEChatMessageParticipantAvatar = require './idechatmessageparticipantavatar'
module.exports = class IDEChatParticipantHeads extends ParticipantHeads
setDefaultListTitle: ->
@setOption 'moreListTitle', 'Other Participants'
setVideo... | ParticipantHeads = require 'activity/views/privatemessage/participantheads'
IDEChatMessageParticipantAvatar = require './idechatmessageparticipantavatar'
module.exports = class IDEChatParticipantHeads extends ParticipantHeads
setDefaultListTitle: ->
@setOption 'moreListTitle', 'Other Participants'
setVideo... |
Add og:site_name to opengraph parser | # http://ogp.me/
OgpParser = exports? and exports or @OgpParser = {}
# expects a "dom" object created by cheerio
OgpParser.execute = ($) ->
title: $("meta[property='og:title']").first().attr("content")
summary: $("meta[property='og:description']").first().attr("content")
image: $("meta[property='og:image... | # http://ogp.me/
OgpParser = exports? and exports or @OgpParser = {}
# expects a "dom" object created by cheerio
OgpParser.execute = ($) ->
title: $("meta[property='og:title']").first().attr("content")
summary: $("meta[property='og:description']").first().attr("content")
image: $("meta[property='og:image... |
Use Change case to prettify | Dialog = require './dialog'
Project = require './project'
projects = require './projects'
path = require 'path'
module.exports =
class SaveDialog extends Dialog
filePath: null
constructor: () ->
firstPath = atom.project.getPaths()[0]
title = path.basename(firstPath)
if atom.config.get('project-manager... | Dialog = require './dialog'
Project = require './project'
projects = require './projects'
path = require 'path'
changeCase = require 'change-case'
module.exports =
class SaveDialog extends Dialog
filePath: null
constructor: () ->
firstPath = atom.project.getPaths()[0]
title = path.basename(firstPath)
... |
Fix application pool creation and log child output | http = require 'http'
nack = require 'nack/pool'
{BufferedReadStream} = require 'nack/buffered'
idle = 1000 * 60 * 15
exports.Server = class Server
constructor: (@configuration) ->
@applications = {}
@server = http.createServer (req, res) =>
@onRequest req, res
listen: (port) ->
@server.listen... | http = require 'http'
{createPool} = require 'nack/pool'
{logStream} = require 'nack/logger'
{BufferedReadStream} = require 'nack/buffered'
idle = 1000 * 60 * 15
exports.Server = class Server
constructor: (@configuration) ->
@applications = {}
@server = http.createServer (req, res) =>
... |
Add a method to stringify dongle versions |
ledger.fup ?= {}
ledger.fup.utils ?= {}
_.extend ledger.fup.utils,
compareVersions: (v1, v2) ->
new ledger.utils.ComparisonResult v1, v2, (v1, v2) ->
if v1[0] == v2[0] and v1[1] == v2[1]
0
else if v1[0] == 0 and v2[0] != 0
-1
else if v1[1] > v2[1]
1
|
ledger.fup ?= {}
ledger.fup.utils ?= {}
_.extend ledger.fup.utils,
compareVersions: (v1, v2) ->
new ledger.utils.ComparisonResult v1, v2, (v1, v2) ->
if v1[0] == v2[0] and v1[1] == v2[1]
0
else if v1[0] == 0 and v2[0] != 0
-1
else if v1[1] > v2[1]
1
versionToString:... |
Remove unused function and its call | kd = require 'kd'
React = require 'kd-react'
immutable = require 'immutable'
ActivityFlux = require 'activity/flux'
ChatPane = require 'activity/components/chatpane'
module.exports = class PublicChatPane extends React.Component
@defaultProps =
thread : immutable.Map()
... | kd = require 'kd'
React = require 'kd-react'
immutable = require 'immutable'
ActivityFlux = require 'activity/flux'
ChatPane = require 'activity/components/chatpane'
module.exports = class PublicChatPane extends React.Component
@defaultProps =
thread : immutable.Map()
... |
Fix a typo in stringInquirer | # Wrapping a string in this class gives you a prettier way to test
# for equality. The value returned by `Bullet.env` is wrapped
# in a StringInquirer object so instead of calling this:
#
# Bullet.env == "production"
#
# you can call this:
#
# Bullet.env.production? #=> true
# Bullet.env.staging? #=> t... | # Wrapping a string in this class gives you a prettier way to test
# for equality. The value returned by `Bullet.env` is wrapped
# in a StringInquirer object so instead of calling this:
#
# Bullet.env == "production"
#
# you can call this:
#
# Bullet.env.production? #=> true
# Bullet.env.staging? #=> f... |
Remove returnTo after using it | passport = require "passport"
route =
verb: "post"
path: "/login"
fn: (req, res, next) ->
auth = passport.authenticate "local", (err, user, info) ->
if err then return next err
else if !user
json =
reason:
info.message
return res.status(401).json json
else req.logIn user, (err) ->
... | passport = require "passport"
route =
verb: "post"
path: "/login"
fn: (req, res, next) ->
auth = passport.authenticate "local", (err, user, info) ->
if err then return next err
else if !user
json =
reason:
info.message
return res.status(401).json json
else req.logIn user, (err) ->
... |
Add redeemers.userID index to prepaids collection | mongoose = require 'mongoose'
config = require '../../server_config'
PrepaidSchema = new mongoose.Schema {}, {strict: false, minimize: false,read:config.mongo.readpref}
PrepaidSchema.index({code: 1}, { unique: true })
PrepaidSchema.statics.generateNewCode = (done) ->
tryCode = ->
code = _.sample("abcdefghijklmn... | mongoose = require 'mongoose'
config = require '../../server_config'
PrepaidSchema = new mongoose.Schema {}, {strict: false, minimize: false,read:config.mongo.readpref}
PrepaidSchema.index({code: 1}, { unique: true })
PrepaidSchema.index({'redeemers.userID': 1})
PrepaidSchema.statics.generateNewCode = (done) ->
try... |
Add camera count to road list. | # Cameras by road that they are on view.
view roads: ->
div 'data-role': 'page', id: 'roads', ->
div 'data-role': 'header', 'data-position': 'fixed', ->
h1 'Cameras By Road'
div 'data-role': 'content', ->
ul id: 'road-list', 'data-role': 'listview', 'data-filter': true, 'data... | # Cameras by road that they are on view.
view roads: ->
div 'data-role': 'page', id: 'roads', ->
div 'data-role': 'header', 'data-position': 'fixed', ->
h1 'Cameras By Road'
div 'data-role': 'content', ->
ul id: 'road-list', 'data-role': 'listview', 'data-filter': true, 'data... |
Comment out parts of Nick's javascript that isn't needed | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in home.js.
$ ->
data = [2,3,4,5,5,7,6,5,4,2,2,3,4,5,5,7,9,5,3,2,2,3,2,3,4,5,5,7,6,5,4,2,2,4,2,2,3,4]
console.log(data);
$('.inlinesparkline').sparkline data,
type: "discrete"
lineC... | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in home.js.
$ ->
data = [2,3,4,5,5,7,6,5,4,2,2,3,4,5,5,7,9,5,3,2,2,3,2,3,4,5,5,7,6,5,4,2,2,4,2,2,3,4]
console.log(data);
$('.inlinesparkline').sparkline data,
type: "discrete"
lin... |
Handle for ajax server error | $(document).ready ->
$('.ajax-hijacker').on 'click', 'a', (e) ->
target = $(this).closest('.ajax-hijacker').data('target')
href = $(this).attr('href')
if href == '#'
return
e.preventDefault()
e.stopPropagation()
options = {
url: href,
success: (result) ->
$(targ... | $(document).ready ->
$('.ajax-hijacker').on 'click', 'a', (e) ->
target = $(this).closest('.ajax-hijacker').data('target')
href = $(this).attr('href')
if href == '#'
return
e.preventDefault()
e.stopPropagation()
options = {
url: href
complete: (result) ->
$(targ... |
Fix issue with then() returning nil on successful fetch | angular.module('Sprangular.StaticContent')
.config ($routeProvider) ->
$routeProvider.when '/pages/:slug*',
controller: 'PageShowCtrl'
templateUrl: 'pages/show.html'
resolve:
page: (StaticContent, $route)->
slug = $route.current.params.slug
StaticContent.find(slug)
S... | angular.module('Sprangular.StaticContent')
.config ($routeProvider) ->
$routeProvider.when '/pages/:slug*',
controller: 'PageShowCtrl'
templateUrl: 'pages/show.html'
resolve:
page: (StaticContent, $route)->
slug = $route.current.params.slug
StaticContent.find(slug)
S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.