coffeescript

How do I start a CoffeeScript repl from within a CoffeeScript script?

隐身守侯 提交于 2020-01-02 05:21:10
问题 If I do repl = require 'repl' repl.start {useGlobal: true} It starts a Node repl. How do I start a CoffeeScript repl instead? Thanks 回答1: Nesh is a project to try and make this a bit easier and extensible: http://danielgtaylor.github.com/nesh/ It provides a way to embed a REPL with support for multiple languages like CoffeeScript as well as providing an asyncronous plugin architecture, support to execute code in the context of the REPL on startup, etc. For example: nesh = require 'nesh' nesh

Parse error using Remotipart

核能气质少年 提交于 2020-01-01 19:35:17
问题 I'm using remotipart to upload and upgrade images using ajax, the problem is when I edit an item, ajax updates the data, but remotipart(https://github.com/leppert/remotipart) returns a 'parse error' for image update. This is how my form looks like: = form_for(Achievement.new), html: {multipart: true , remote: true} do |f| = f.text_field :name = f.text_area :description = f.file_field :image = f.submit 'Send' I'm using a single form to create, edit and delete the 'Achievements'. Here's my js:

Parse error using Remotipart

别说谁变了你拦得住时间么 提交于 2020-01-01 19:35:15
问题 I'm using remotipart to upload and upgrade images using ajax, the problem is when I edit an item, ajax updates the data, but remotipart(https://github.com/leppert/remotipart) returns a 'parse error' for image update. This is how my form looks like: = form_for(Achievement.new), html: {multipart: true , remote: true} do |f| = f.text_field :name = f.text_area :description = f.file_field :image = f.submit 'Send' I'm using a single form to create, edit and delete the 'Achievements'. Here's my js:

Resizing image at client-side using JQuery file upload to amazon S3

前提是你 提交于 2020-01-01 19:06:18
问题 I already saw some examples at the internet like: this and this one, but I'm following the RailsCast Episode #383 Uploading to Amazon S3 and at the very end of the video he mentions about resize the image on the client-side using javascript, of course. The problem is, I can't implement if I follow his example. I'm using the gem jquery-fileupload-rails EDIT : I noticed I was missing some JS required at the JQuery-fileupload example to resize image page, but still doesn't'work. My Requires on

node.js http.request event flow - where did my END event go?

扶醉桌前 提交于 2020-01-01 14:36:09
问题 I am working on a cunning plan that involves using node.js as a proxy server in front of another service. In short: Dispatch incoming request to a static file (if it exists) Otherwise, dispatch the request to another service I have the basics working, but now attempting to get the whole thing working with Sencha Connect so I can access all the kick-ass middleware provided. All of the action happens in dispatchProxy below connect( connect.logger(), connect.static(__dirname + '/public'),

Classes defined in CoffeeScript not found by Jasmine specs

我是研究僧i 提交于 2020-01-01 14:36:06
问题 I am building a backbone.js app on a Rails 3.1 back-end. I'm using CoffeeScript to write the backbone classes, and Jasmine (via jasmine-headless-webkit) for testing. Given the following (partial) tree: . ├── app │ ├── assets │ │ ├── javascripts │ │ │ └── views │ │ │ ├── avia_view.js.coffee ├── spec │ ├── javascripts │ │ └── views │ │ └── avia_view_spec.js.coffee ... I would expect avia_view_spec.js.coffee to know about Avia.AviaView , which is defined in avia_view.js.coffee . However, I get

Classes defined in CoffeeScript not found by Jasmine specs

不问归期 提交于 2020-01-01 14:34:28
问题 I am building a backbone.js app on a Rails 3.1 back-end. I'm using CoffeeScript to write the backbone classes, and Jasmine (via jasmine-headless-webkit) for testing. Given the following (partial) tree: . ├── app │ ├── assets │ │ ├── javascripts │ │ │ └── views │ │ │ ├── avia_view.js.coffee ├── spec │ ├── javascripts │ │ └── views │ │ └── avia_view_spec.js.coffee ... I would expect avia_view_spec.js.coffee to know about Avia.AviaView , which is defined in avia_view.js.coffee . However, I get

angularjs: ui-grid not renders more than 10 columns

你离开我真会死。 提交于 2020-01-01 12:14:55
问题 I have simple controller: angular.module('it.works', ['ngResource']) .controller 'ItWorksCtrl', ($scope, Task) -> $scope.worksTable = { data: Task.query(), columnDefs: [ { field: "created_at", cellFilter: "date:'dd.MM.yyyy'", displayName: 'Дата создания' }, { field: "task", cellFilter: "limitTo:300", displayName: 'Описание задачи' }, { field: "performer", displayName: 'Исполнитель' }, { field: "task_type", displayName: 'Срочность' }, { field: "is_orgtechnik_task", displayName: 'Оргтехника',

Rails path-helpers doesn't work in js.coffee.erb

牧云@^-^@ 提交于 2020-01-01 10:02:44
问题 In my Rails 3.2 app (Ruby 1.9) I get following error when using path helpers in Coffeescript. undefined local variable or method `new_user_session_path' In my partial _usermenu.html.haml that works fine: = link_to t('user.login'), new_user_session_path In my app/assets/javascripts/metamenu.js.coffee.erb that throws above error: $.get("<%= new_user_session_path %>") Isn't it possible to use x_path and x_url helpers in coffeescript erb's? 回答1: This is because you are not within the view context

How do I set a breakpoint inside of atom's package?

牧云@^-^@ 提交于 2020-01-01 09:17:09
问题 I am trying to figure out why this atom package https://github.com/AtomLinter/linter-elixirc/ misbehaves. Its author said I should set a breakpoint in some function of the package to see what's going on there. I have no idea how to do that while running atom. Here is the comment I am talking about: https://github.com/AtomLinter/linter-elixirc/issues/63#issuecomment-214916262 回答1: When you're in Atom, hitting Ctrl+Alt+I (or View -> Developer -> Toggle Developer Tools) will open developer tools