Skip to main content

Questions tagged [coffeescript]

CoffeeScript is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

1vote
1answer
632views

Converting Date object in CoffeeScript to string (with a weird format)

I'm trying to convert a Date object into a weird format, like so: 03/30/2017 11:37:14:082 -0500 The issue that really trips me up is the timezone offset. There's ...
Camden Clark's user avatar
4votes
1answer
76views

CoffeeScript 2 + 2 program

I tested this program on Smooth-CoffeeScript I just wanted to have as many eyes on this as I could to learn about coffeescript; Is there anything I should do to improve it? Am I using the tools ...
Shui's user avatar
  • 173
0votes
1answer
734views

Displaying job status in a jQuery Datatable

I was wondering if there was a better way to write this: ...
Wes's user avatar
  • 133
0votes
1answer
48views

Abstracting out two lines of code in Coffeescript

I am currently working on refactoring two methods that exist in directives into a service. This is method one: ...
theGreenCabbage's user avatar
0votes
1answer
44views

Multiple string interpolation

Mostly robocop and hound give "line is too long" for such code statements. I just wanted to know which one is better and preferable way. This one is a way to avoid making the message long so just do ...
Junaid Farooq's user avatar
2votes
0answers
67views

jQuery Mobile Menu plugin

I would like some opinions on this Mobile Menu plugin I wrote for work. We develop custom WordPress themes, nothing too advanced or anything. I would like if anyone could just take a look and provide ...
bebaps's user avatar
7votes
1answer
276views

Loading an SVG into the canvas

The code below is loading an svg into the canvas via RaphaelJS. There are mouseover/mouseout events, on click on an element of the svg, and drag/zoom. I would like to know, what are some good ...
Radu Dascălu's user avatar
3votes
0answers
83views

Hotel Room Problem in CoffeeScript

Question: You're in a hotel and you forgot what room number you were in but remember that the sum of it's divisors is greater than the number, yet there is no subset of those divisors that add up to ...
user avatar
3votes
0answers
42views

Backbone.model based state machine

I have created a class to keep track of some internal states. You can see it as a very simple implementation of a state machine ...
Anthony Kong's user avatar
2votes
0answers
53views

Recursively merge objects with corresponding property names

I have such objects that I need to merge: ...
eawer's user avatar
3votes
1answer
1kviews

Configuring a DataTable using CoffeeScript

I am working on a simple Rails app. For the Expense resource I use a DataTable. So, in my CoffeeScript for this resource I basically do several things: initialize ...
Alexander Popov's user avatar
1vote
1answer
108views

Kruskal's algorithm

I'm working through Coffeescript implementing simple algorithms (started with Prim's as reviewed in this previous post) and wrote out Kruskal's algorithm as below, with a few helper functions. I'd ...
sunny's user avatar
  • 1,845
1vote
1answer
167views

Operating on a list of files using recursion

I'm starting just now with CoffeeScript and I found out that I can't solve problems like looping and recursives with just one line. I would like to improve the code that I just wrote using built-in ...
Amanda Ferrari's user avatar
2votes
3answers
120views

Prim's algorithm in CoffeeScript

I'm just starting to learn CoffeeScript and am trying to work through simple examples, this one being Prim's algorithm. I'd like feedback on everything but especially on making this script take ...
sunny's user avatar
  • 1,845
3votes
0answers
52views

Using Angular directives for connect HTML clicks in buttons and controller actions

I'm trying to improve my Angular directive. I'm pretty new to CoffeeScript, so I think there may be inconsistent code. ...
user98293989823's user avatar

153050per page
close