Skip to content

Instantly share code, notes, and snippets.

// You’d expect this one…
render() {
return (
<button { ...this.props } className={ this.cn + (this.props.className ? ' ' + this.props.className : '') }>
{ this.props.children }
</button>
);
}
// <script src="angular.min.js"></script>
(function(name, factory) {
// our basic IO module system that stores every module on modules with the "file" namespace
// please use something like browserify rather than rolling your own like this
window.modules = window.modules || {};
window.require = window.require || function require(name) { return window.modules[name] || window[name]; };
var exports = {}; factory(exports, window.require);
window.modules[name] = exports;
}('TodoService', function(exports, require) {
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active May 2, 2025 15:13
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

LaterPay is seeking a Front-End Engineer

Who we are

With LaterPay, we want to change the way people buy and sell digital content on the Internet. Why? Because we believe paying for digital content should be fast, convenient, and fair. And because we think you should be able to buy the exact piece of content you want.

We want to create a great software product which influences and changes the way people use paid content of any kind on the Internet. The usage of paid content should be as easy and convenient as going out to dinner: you are served first and pay later.

@arindam89
arindam89 / Links.md
Last active March 11, 2017 15:05
JS Links for the talk
@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@alganet
alganet / arch.md
Last active August 29, 2015 14:20
@SgtPooki
SgtPooki / mcoords.js
Created April 11, 2015 05:04
Display mouse coordinates
(function() {
'use strict';
var $toolTip = $('<div/>');
$toolTip.addClass('customTooltip-rsd')
.css({
position: 'absolute',
display: 'inline-block',
'font-size': '22px',
backgroundColor: '#000',
color: '#ffffff',
@edsu
edsu / README.md
Last active August 29, 2015 14:18

The Apparatus of CongressEdits

Sometimes you write a piece of software and it gets used for purposes you didn't quite imagine at the time. Sometimes you write a piece of software and it unexpectedly rearranges your life. I'd like to tell you a quick story about a Twitter bot named @CongressEdits. It tweets when someone edits Wikipedia anonymously from the United States Congress. In this post I'll give you some background on how the bot came to be, what it has been used for so far, and how it works. @CongressEdits taught me how the world of archives intersects with the world of politics and journalism. To explain how that happened I first need to give a bit of background.

Wikipedia

According to [Alexa][alexa] wikipedia.org is the 6th most popular destination on the Web. You are probably used to seeing Wikipedia articles near the top of your Google search results. Wikipedia is the encyclopedia anyone can edit, so long as you can stomach [wikitext][wikitext] and revert wars. Wikipedia is also a platfor

@addyosmani
addyosmani / notes.md
Last active August 10, 2022 03:59
Notes on streaming JS & long-term code compilation caching in Chrome

Re: http://blog.chromium.org/2015/03/new-javascript-techniques-for-rapid.html

V8 Optimisations to enable fast page startup

As mentioned in our Chromium blog post, Chrome 41 introduces support for streaming parsing of JavaScript files using the async or defer attributes. This is where the V8 parser will parse any incoming JavaScript piece-by-piece so the compiler can immediately begin compiling the AST when script loading has completed. This lets us do something useful while waiting for the page to load. Compare:

This means parsing can be removed from the critical path when loading up the page. In these cases such scripts are parsed on a separate thread as soon as the download begins, allowing parsing to complete very soon after the download has completed (milliseconds), leading to pages (potentially) loading much faster.