coffeescript Questions
5
Solved
I've just started to explore new JavaScript ideas and I'm pretty impressed. At first sight both CoffeeScript and TypeScript have some great features. They're both compiled to JavaScript. CoffeeScri...
Slackjawed asked 26/10, 2015 at 11:9
10
Solved
I both love and hate writing Bash. I love that it's so streamlined for operating on files and working with processes (I agree with this popular question that it's way better in this regard than Pyt...
Binomial asked 20/4, 2012 at 1:55
2
I'd like to run a command line script using the coffee executable, but I'd like to call that executable through npx.
Something like #!/usr/bin/env npx coffee does not work, because only one argume...
Long asked 20/4, 2019 at 20:58
5
Solved
I am trying to bind a checkbox to scope using ng-model. The checkbox's initial state corresponds to the scope model just fine, but when I check/uncheck the checkbox, the model does not change. Some...
Mccain asked 5/9, 2013 at 17:23
3
Solved
I've got a single method in my namespace that I'd like to mock, but I'd prefer that all the others work normally. Is it possible to have sinon mock a specific method while leaving the others the sa...
Brodie asked 24/7, 2014 at 2:14
6
Solved
I have the below schema (apologies that it is in coffeescript)
Schema = mongoose.Schema
AuthS = new Schema
auth: {type: String, unique: true}
nick: String
time: Date
Auth = mongoose.model 'Aut...
Cornute asked 11/8, 2011 at 21:50
4
Solved
Is there any elegant way how to get ordinals in word format in js/coffee?
Something like this:
ordinalInWord(1) # => "first"
ordinalInWord(2) # => "second"
ordinalInWord(5) # => "fifth"
...
Paean asked 14/4, 2013 at 10:22
3
I used busboy module to parse multipart request with below coffeeScript code.
The problem is, sometimes, on 'data' handler called several times for the request including one file.
That means I nee...
Abdulabdulla asked 4/8, 2015 at 10:38
37
Solved
I am trying to support CORS in my Node.js application that uses the Express.js web framework. I have read a Google group discussion about how to handle this, and read a few articles about how CORS ...
Amphithecium asked 15/8, 2011 at 16:53
3
Solved
Why isn't lodash's _.unique returning unique objects when I pluck a field that is an object?
I'm using lodash's _.unique and it's not working as expected. I'm doing this:
uniqueByFocusIndex = _.unique(clickables, false, "focusIndex");
And as you can see in the image (look at the right),...
Faradic asked 5/7, 2014 at 23:0
23
Solved
I am doing MongoDB lookups by converting a string to BSON. Is there a way for me to determine if the string I have is a valid ObjectID for Mongo before doing the conversion?
Here is the coffeescri...
Pict asked 13/12, 2012 at 0:1
12
Solved
I'm developping a JS-app that needs to work both on the client side and the server side (in Javascript on a browser and in Node.js), and I would like to be able to reuse the parts of the code that ...
Parris asked 10/7, 2013 at 16:15
9
I'm trying to create a simple form with react, but facing difficulty having the data properly bind to the defaultValue of the form.
The behavior I'm looking for is this:
When I open my page, the...
Coxcombry asked 9/5, 2015 at 23:27
15
Solved
I'm rendering a link with react:
render: ->
`<a className="upvotes" onClick={this.upvote}>upvote</a>`
Then, above I have the upvote function:
upvote: ->
// do stuff (ajax)
...
Secund asked 30/3, 2016 at 18:28
25
Solved
How do I use a local version of a module in node.js. For example, in my app, I installed coffee-script:
npm install coffee-script
This installs it in ./node_modules and the coffee command is in ...
Filaria asked 13/3, 2012 at 7:31
1
I am trying to import an ES6 module with CoffeeScript.
The javascript working code is the following :
import { MyModule } from 'my-module';
const mymod = new MyModule({
some-options: '...'
});
...
Wanderjahr asked 20/6, 2018 at 11:16
5
I've got a two-step compilation process for my web application. Firstly, I compile CoffeeScript files into JavaScript files [1]. Then the JavaScript files (both ones that come from CoffeeScript, an...
Whipstall asked 11/2, 2014 at 17:52
3
One of the problems, for some of us, with Javascript is the lack of operator overloading. This makes writing numeric libraries awkward. For instance, we might want to write something like:
var a =...
Synaeresis asked 18/9, 2011 at 18:3
5
I'm making some 3D text using WebGL, three.js, and THREE.TextGeometry. It's working fine so far. I'm able to create a single line of 3D text.
Now I want to create multiline text, like a short para...
Nodular asked 4/8, 2013 at 1:21
6
Solved
How can I get the size of the newly created new Image() in bytes if this image's src is base64 data image?
I have such coffeescript code:
# This string is received after some original image prepr...
Encasement asked 29/4, 2015 at 9:30
10
Solved
I have this simple script :
var exec = require('child_process').exec;
exec('coffee -cw my_file.coffee', function(error, stdout, stderr) {
console.log(stdout);
});
where I simply execute a comman...
Trifocal asked 19/4, 2012 at 16:7
11
Solved
Edit Nov 2016: Node now has a built in debugger that you can start with --inspect. This answer explains it: https://mcmap.net/q/241059/-what-39-s-the-right-way-to-enable-the-node-debugger-with-moch...
Extragalactic asked 11/1, 2013 at 19:22
4
Solved
I have app in Node.js and Express. I need to write tests for it. I have a problem with handling Express app errors. I found this How do I catch node.js/express server errors like EADDRINUSE?, but i...
Concernment asked 10/11, 2012 at 14:26
11
Solved
I have a node app sitting like a firewall/dispatcher in front of other micro services and it uses a middleware chain like below:
...
app.use app_lookup
app.use timestamp_validator
app.use request_...
Lali asked 25/11, 2014 at 1:30
6
Solved
Given the following code:
outer=1
f=->
local=1
outer=0
local+outer
coffeescript creates a var for local but re-ueses outer:
var f, outer;
outer = 1;
f = function() {
var local;
local ...
Untouched asked 14/8, 2013 at 11:17
1 Next >
© 2022 - 2025 — McMap. All rights reserved.