Skip to content

Instantly share code, notes, and snippets.

View abepetrillo's full-sized avatar
🏠
Working from home

Abraham Petrillo abepetrillo

🏠
Working from home
View GitHub Profile
@troex
troex / my_controller.rb
Last active October 7, 2021 09:41
Sinatra + EventMachine + Puma – Heroku workaround for 30 seconds timeout
module Application
module Controllers
class MyController < Sinatra::Base
helpers Sinatra::Streaming
class << self
def stream(method, path, opts = {}, &block)
send(method, path, opts) do
stream do |out|
timer = EventMachine::PeriodicTimer.new(10) { out << "\0" }
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@ericelliott
ericelliott / essential-javascript-links.md
Last active May 7, 2024 01:25
Essential JavaScript Links
@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.