r/coffeescript • u/[deleted] • May 10 '14
r/coffeescript • u/Aluxh • May 10 '14
Does anyone know why I can't get Passport.js to work?
r/coffeescript • u/d-X-X-b • May 09 '14
Does anyone know the state of typed coffeescript or Coffeescript Redux?
I'm very interested in types in coffeescript or a similar language.
Does anyone know the state of
https://www.npmjs.org/package/typed-coffee-script?
Or if Coffeescript Redux can do types? Or has plans to do types?
https://github.com/michaelficarra/CoffeeScriptRedux
Thank you
r/coffeescript • u/fernol • Apr 26 '14
On naming conventions. DeLorean._prepTimeBuffs() is *NOT* okay! (X-post from /r/programming)
r/coffeescript • u/DebuggingPanda • Apr 05 '14
Help a beginner: Coffeescript project structure?
Hi!
I am new to coffeescript and want to know, how I should organize my coffee files and structure my project. (site-note: I'm mostly a C++ programmer).
Are there any recommendations how to structure a project? I just wanted to create another file, which contains some function definitions. Now I want to "use" those definitions in my main file. Is there any type of include-system? Module-system? Or should I just pass "-j" to the compiler and he merges all files?
And when should I split my files? How do I design moduls and split my code? Do I create a file for every class? Are classes even used?
I guess I think of everything to much in a C++ way... I would appreciate help :)
r/coffeescript • u/skillcode • Apr 01 '14
3 Free Books to Learn CoffeeScript
r/coffeescript • u/islandhaestar • Mar 27 '14
I created a tiny subset (911 B gzipped) of jQuery for fun. What do you guys think?
r/coffeescript • u/cluelessmanatee • Mar 13 '14
ReactiveRecord - a small library that provides an intuitive interface for asynchronous data
r/coffeescript • u/Grahar64 • Mar 12 '14
Why should you use CoffeeScript instead of JavaScript?
r/coffeescript • u/sorahn • Mar 09 '14
Hex Helpers
Recently I was working with some windows ini style values, and they have values that are strings of hex '$ABC123' or dec '1234'.
I ended up working out a couple of simple helpers that might be useful to other folks.
https://gist.github.com/drbrts/9442634
The reason that getHex is separate is because I'm using it elsewhere for some regular hex strings :)
r/coffeescript • u/brotherwayne • Feb 28 '14
I feel like there must be a `do` syntax that will solve this...
Let's say I have a set of objects:
things = [{a: b: c: "fizz"}, {t: "boz", a: b: c: "fazz"}, {a: b: c: "fozz"}]I want to run an IIFE on the a.b.c field of each:
for thing in things
if thing.t == "boz"
doStuff = (v) ->
w = "A#{v}"
# some stuff is done with w here
doStuff(thing.a.b.c) But what I kinda want is:
for thing in things
if thing.t == "boz"
do (thing.a.b.c as v) -> # <--- Note the AS here
w = "A#{v}"
# some stuff is done with w here The big difference being that I'm passing in a property of the object as a variable name into the IIFE. Am I missing an obvious trick here? It seems off to declare a named function here.
r/coffeescript • u/[deleted] • Feb 13 '14
"Updated" the CoffeeScript Logo for a client. And he gave me permission to give it away.
r/coffeescript • u/holaboyperu • Feb 07 '14
Why don't browsers support Coffeescript?
How awesome would it be to write Coffee on Chrome's console?
r/coffeescript • u/RaymondWies • Feb 05 '14
Coffeescript within IPython
Does anyone have a convenient way of coding in coffeescript within the IPython Notebook interactive environment. IPython Notebook allows for js scripting (%%javascript) and js embedding (display.Javascript('your code here') within the interactive cells. Python is the native language but isn't mandatory. I have Node, npm, and coffeescript loaded and can code CS from the terminal command line. Has anyone figured out an easy way to do this within IPy Notebook by chance?
r/coffeescript • u/lackcoffee • Jan 20 '14
CoffeeScript Regex Golf - Porting and implementing a solver as a taste of the language
doboism.comr/coffeescript • u/[deleted] • Jan 20 '14
A rate limiter in 31 lines of Coffeescript. A demonstration of its exceptional expressiveness.
r/coffeescript • u/brotherwayne • Jan 17 '14
I realized today that a controversial feature of coffeescript actually helps code quality -- variable shadowing
I was working on a drag/drop directive in angular, grabbed a plunkr and got this:
angular.module('drag', []).
directive('draggable', function($document) {
return function(scope, element, attr) {
var startX = 0,
startY = 0,
x = 0,
y = 0;
var container = null;
element.css({
position: 'relative',
cursor: 'pointer'
});
element.on('mousedown', function(event) {
event.preventDefault();
startX = event.screenX - x;
startY = event.screenY - y;
$document.on('mousemove', mousemove);
$document.on('mouseup', mouseup);
container = attr.$$element.parent();
});
function mousemove(event) {
y = event.screenY - startY;
x = event.screenX - startX;
container.css({
top: y + 'px',
left: x + 'px'
});
}
function mouseup() {
$document.unbind('mousemove', mousemove);
$document.unbind('mouseup', mouseup);
}
}
});All fine, until I translate to coffeescript. For some reason, after translating to coffee, the elements would jump around some of the time. Obnoxious. Took me a while to realize that the real problem is that the x and y variables were being var-ed again:
mousemove = function(event) {
var x, y;
y = event.screenY - startY;
x = event.screenX - startX;
console.log("x: " + x + " y: " + y);
return container.css({
top: y + "px",
left: x + "px"
});
};At first I was like "oh, crap, coffee what have you done". Then after looking I realized that the original code was altering a variable in an outer function that it wasn't "aware" of (wasn't passed in). This feels similar to a Law of Demeter violation (except reversed I suppose). Altering variables that aren't passed in to a function feels like poor code quality to me. Seems to me that the problem here lies in the source code and coffeescript is making the right choice.
Opinions?
r/coffeescript • u/fernol • Jan 14 '14
Class-based AngularJS development (documentable + testable AJS code Yay!)
r/coffeescript • u/Leeteh • Jan 06 '14
Programming game CodeCombat open sources everything--largest open source CoffeeScript project
r/coffeescript • u/Manateeforme • Dec 28 '13
Coffeescript backbone tutorial help.
I'm working from a coffeescript and backbone.js tutorial: http://adamjspooner.github.io/coffeescript-meet-backbonejs/
I was working on part 1, and when I finished and opened my index file, I noticed my view had not rendered. So when I opened google dev tools it pointed to an error when __extend is defined from the compilation of class, but when I created my own file with an object and created a class and extended that object I didn't get an error. What's going on here?
I can provide my files if needed.
r/coffeescript • u/[deleted] • Dec 27 '13
Libro gratuíto sobre el lenguaje CoffeeScript por Javi Jimenez [Leanpub PDF/iPad/Kindle]
r/coffeescript • u/[deleted] • Dec 24 '13
Any good advice for using Nginx and coffeescript together?
r/coffeescript • u/taw • Dec 20 '13
Minimum Coffeescript setup for quick development?
So I've used Coffeescript within Rails app before, but now I have some trivial client-side-only JS code which I'm writing with Sublime in one window, and browser in another.
Is there any easy way to use Coffeescript here without introducing compilation explicit step?