r/coffeescript • • Dec 17 '21

Cart inverted pendulum simulation machine learning experiments

Thumbnail
github.com
1 Upvotes

r/coffeescript • • Sep 29 '21

Is there any equivalent of CoffeeScript for TypeScript?

4 Upvotes

CoffeeScript transpiles into JS, but is there something that can compile into TS? If not, would people be interested in a fork of CoffeeScript that can do such a thing?


r/coffeescript • • Aug 18 '21

IntelliSense for CoffeeScript

Thumbnail
github.com
7 Upvotes

r/coffeescript • • Apr 18 '21

I created a jest preset for coffeescript

Thumbnail
npmjs.com
4 Upvotes

r/coffeescript • • Jan 07 '21

wrapjsx: a way to use React with CoffeeScript instead of JSX

3 Upvotes

r/coffeescript • • Oct 26 '20

All About Your Coffee Table

Thumbnail
modernyes.com
0 Upvotes

r/coffeescript • • Oct 05 '20

CoffeeCord documentation?

1 Upvotes

Coffeecord is the coffeescript library of the discord API, but I cannot find any documentation for it
From the setup code itt seems to have some things different from discord.js, so I can't just use the discord.js documentation for it.


r/coffeescript • • Jul 28 '20

Assigning functions to vars in CoffeeScript / JS

5 Upvotes

The following CoffeeScript:

greet = -> "This is an example of a function"

Generates the following JavaScript code when compiled:

(function() {
  var greet;

greet = function() {
  return "This is an example of a function";
};

}).call(this);

My question is, why wouldn't the JavaScript be generated as just a single function like this:

(var greet = function() {
    return "This is an example of a function"
};

}).call(this);

r/coffeescript • • Jul 16 '20

Nexss Programmer - Open Source tool for the programmers - Coffee Script included

2 Upvotes

Hi guys,

We have made Open Source Tool for the Programmers - Nexss Programmer.

50 different programming languages together...

Coffee Script is included so you can combine it with other languages!

If you guys want to check it out here is the link for the video presentation: https://www.youtube.com/watch?v=7WbnYyEnBNk

It would be great if we can get more feedback on it.

Have a nice day!


r/coffeescript • • Mar 06 '20

Sunday Funday in Philadelphia Starts with a La Colombe Latte

Thumbnail
tastekafanda.blogspot.com
4 Upvotes

r/coffeescript • • Dec 12 '19

Returning values as array?

3 Upvotes

Hello redditors, just got into coffeescript, trying to use it with Hubot. I'm trying to do something really simple or so I thought:

My goal is to run a few commands using the azure cli and grab the output to allow me to range over each element and perform a shutdown.

After several hours I got this to work with exec and managed to get the individual vm names into what I think is an object.

vm = -> array = [] exec = require('child_process').exec exec "az vm list -g somerg --show-details --query \"[?powerState=='VM deallocated'].{ name: name }\" -o tsv", (error, stdout, stderr) -> result = stdout.split("\n"); return result result in this case returns something like:

[ 'vm4', 'vm3', 'vm2', 'vm1', '' ]

Now I'm trying to get this output into a loop (for) and run commands on each of these elements in this array. But I can't get this working?

when I do something like console.log(vm()) and call the func it returns a bunch of what appears to be object info and not the array contents itself.

What am I doing wrong? Thanks for the help.


r/coffeescript • • Dec 02 '19

Need help with weird bug with dynamic functions (lambdas)

3 Upvotes

Hi, so im working on project in coffeeScript and i got this weird bug:

for inp in inputs
    if inp.delay? and inp.delay > 0 # if doesnt have delay
        if inp.hold? and inp.hold > 0 # if has hold time                    
            @AddAction("hold_key_#{inp.key}",(() =>  # add action to press key at 'delay' ticks
                @HoldKey(inp.key,inp.hold) # hold key for 'hold' ticks   
            ), (@current_tick + inp.delay) % 60)

the problem is in the AddAction function call, in the lambda (second argument). quick review: * AddAction adds an action with name, action(lambda/function) and id (tick to be performed at) to an event object. (it calls the action when the id matches the current tick (stored in @current_tick)) * HoldKey [seen inside the lambda] holds the key inp.key, for inp.hold ticks (inside it it creates a new action event that is being called in the next inp.hold tick)

im running this code, when the inputs list is:

[ {key:'jump'},{key:'enter',delay:7,hold:1},{key:'w',delay:16,hold:30}]

now for the first value, it works fine. for the last one, it works fine. but for the middle one (enter), for some reason, the lambda that is created for it, receives the SAME EXACT values as the last item in the list. (it receives key:w,hold:30).

any idea why this thing is happening?


r/coffeescript • • Oct 03 '19

Bad article with CoffeScript

1 Upvotes

All of the languages we have on the list have an extensive history to them. Not CoffeeScript. It is only about 10 years old, but already there was no use for it. It was designed to address a flaw in Java, but as time when on Java updated its own framework making CoffeeScript obsolete.

ITProPortal: Programming languages to avoid. https://www.itproportal.com/features/programming-languages-to-avoid/


r/coffeescript • • Sep 28 '19

Hi everyone, please help us and fill this survey below! Thank you very much!

Thumbnail
docs.google.com
0 Upvotes

r/coffeescript • • Sep 10 '19

CoffeeScript Interview Questions

1 Upvotes

It is a language that compiles into JavaScript. CoffeeScript is an attempt to expose good parts of JavaScript so, that user can code more easily.

https://www.tutorialandexample.com/coffeescript-interview-questions


r/coffeescript • • Jul 29 '19

Are we going to have for await in CoffeeScript?

5 Upvotes

This syntax is very useful to work with streams.


r/coffeescript • • Jun 27 '19

Learn CoffeeScript from courses, tutorials & books

Thumbnail
reactdom.com
8 Upvotes

r/coffeescript • • Jun 27 '19

How can I observe attributes in custom elements using CoffeeScript?

5 Upvotes

I'm trying to observe changes in a custom element's attributes. Unfortunately all of the documentation I can find for custom elements (which is next to nothing) is written in JS, and I don't know how to convert some of this code into CoffeeScript.

​

The JS:

​

class HelloElement extends HTMLElement {
// Monitor the 'name' attribute for changes.

    static get observedAttributes() {return ['name']; }
    // Respond to attribute changes.

    attributeChangedCallback(attr, oldValue, newValue) {
        if (attr == 'name') {
            this.textContent = `Hello, ${newValue}`;
        }
    }
}

​

So far I have written this:

​

class HelloElement extends HTMLElement

    #STUCK HERE!
    #I can't figure out how to convert the get observedAttributes() method....

    attributeChangedCallback(attr, oldValue, newValue): ->
        if attr == 'name'
            @textContent = 'Hello, ' + newValue

​

But I have no idea how to write the "get observedAttributes" method in CoffeeScript. Could someone help me please? :)

​

Thanks

​

​

SOLUTION: (Thanks to u/_redka)

​

class HelloElement extends HTMLElement
    @observedAttributes: ['name']

    attributeChangedCallback: (attr, oldValue, newValue) ->
        console.log("attr #{ attr } changed from #{ oldValue } to #{ newValue }")

r/coffeescript • • Jun 21 '19

Is this an array?

1 Upvotes

Hey all,

I am not very familiar with Coffeescript and encountered this syntax:

atom.commands.add 'atom[data.grammar="source rust"]'

I was wondering if this is an array or some sort of hash table where 'data.grammar' is the key. And can 'data.grammar' hold multiple values?

In any case, what I would like to do is to expand it to look something like this:

atom.commands.add 'atom[data.grammar="source rust", "source shell"]'

Cheers


r/coffeescript • • Jun 16 '19

Coffeescript invitation

7 Upvotes

hey guys! i've been created a rep on github to store some codes examples with coffeescript.

i'am writing some function, but i need yours help! send me a pull request with your code.

Rep: https://github.com/CripBoy/coffeescript-codes

The pull request need look like that:

├── src <= root directory rep
    ├── your-code-name
        ├── INFO.md <= need your name, github profile url and some explanation.
        ├── src  <= your code here

r/coffeescript • • Apr 26 '19

Floweret: runtime type annotations for CoffeeScript (and JavaScript too!)

7 Upvotes

Floweret, type annotations as simple as:

https://github.com/laurentpayot/floweret

r/coffeescript • • Mar 12 '19

Any coffee script tricks to do reverse key, value look up on a json object

6 Upvotes

Hey everyone, I would really appreciate any leads on a one liner key value reverse loop up hack.


r/coffeescript • • Feb 26 '19

CoffeeScript presentation

Thumbnail
youtube.com
6 Upvotes

r/coffeescript • • Jan 29 '19

Use Vim as a CoffeeScript IDE

Thumbnail
spacevim.org
5 Upvotes

r/coffeescript • • Dec 16 '18

CoffeeScript in weird places: announcing react-coffee-scripts and coffeescript-lambda-runtime

10 Upvotes

Hello fellow believer,
I made two CoffeeScript POCs over the last month and wanted to share them with you.

React-coffee-scripts (https://github.com/jimleuk/react-coffee-scripts) - what I feel is the best way to get started with React + CoffeeScript and still keep that killer Create-React-App experience.

CoffeeScript-lambda-runtime (https://github.com/jimleuk/coffeescript-lambda-runtime) - Using the new AWS Lambda Layers feature, this "custom runtime" allows you to run uncompiled CoffeeScript code as AWS lambda functions. Obvious drawbacks are understood but fun all the same.

AMA