Rico Sta. Cruz
ricostacruz.com · Personal blog · on HN since 2011
Rico Sta. Cruz is a web developer who writes JavaScript libraries, cheatsheets and Backbone guides, including Flatdoc and NProgress.
What HN saysHN links his Flatdoc documentation tool, Backbone patterns and Vim script cheatsheet; one commenter calls Flatdoc more full featured and good with code samples.
57HN people shared it
28linked it in comments
31stories submitted
1.1Kstory points
2 years agolast shared
2011people per year2026
Most-shared posts
- 1Backbone patterns11 people · 281 points · first shared 2011 · 33 comments on HN
- 2Flatdoc is the fastest way to create a site for your open source project.10 people · 37 points · first shared 2013 · 6 comments on HN
- 3NProgress: slim, site-wide progress bars9 people · 599 points · first shared 2013 · 140 comments on HN
- 4JQuery Transit - CSS3 animations for jQuery8 people · 173 points · first shared 2011 · 26 comments on HN
- 5JS2Coffee: The JavaScript to CoffeeScript compiler5 people · 10 points · first shared 2011 · 2 comments on HN
- 6RSJS: Reasonable System for JavaScript Structure4 people · 4 points · first shared 2017 · discussion on HN
- 7Rico's Cheatsheets3 people · 6 points · first shared 2015 · discussion on HN
- 8Vim script cheatsheet2 people · 3 points · first shared 2016 · discussion on HN
- 9Rscss: Styling CSS without losing your sanity2 people · 3 points · first shared 2023 · discussion on HN
- 10A better Hello World1 people · 4 points · first shared 2017 · 1 comments on HN
- 11Phoenix Ecto Models Cheatsheet1 people · 2 points · first shared 2016 · discussion on HN
- 12Pnpm: Performant npm installations1 people · 1 points · first shared 2016 · discussion on HN
- 13Type Annotations in JavaScript Files1 people · 1 points · first shared 2019 · discussion on HN
- 14Fish shell1 people · first shared 2015
What HN people wrote when they linked it
Tehnix · 2016-09-19
Not that much to be honest, there are some quirks and such as variable scopings (g:, s:, l: a:) and other things, but other than that it's pretty familiar.
A few great resources I found after having googled a ton around was [0] and [1]. If you are very familiar with vim (I'm not really a power user tbh), then all the commands you use with : are supported in vim script. Meaning opening a split in your script is, well, just split.
[0] http://ricostacruz.com/cheatsheets/vimscript.html
[1] http://www.ibm.com/developerworks/library/l-vim-script-1/
bluespice · 2012-07-04
Depends on browser and mouse settings (smooth scrolling on/off).
However the animation and rendering is just very slow for me on Chrome + quad, about 5-10 FPS. I won't even try on Android.
This could have been greatly improved by using CSS3 animations, there's even a drop-in jquery library that makes this an easy fix: http://ricostacruz.com/jquery.transit/
With that said, the effect is overused and tacky.
Message could have been delivered more quickly and elegantly.
I felt as if visiting that link was just a waste of time, like watching an old movie I've seen and looking for changes in subtitles.
iheartmemcache · 2015-12-12
-- A survey which will likely be of interest to the zsh and/or iTerm and/or Git users --
I used zsh for almost 3 years exclusively before moving over to Fish. Oh-my-fish doesn't leave me lacking for any features that Oh-my-zsh has, and it's easier for me to extend as well.
Anyways, yeah. Fish rules. The package manager that comes with oh-my-fish is nice, but you have options like 'fundle'. And being able to see what each function does/edit it out of the box with 'funced' is great.
This is a good cheat-sheet to start with fish and omf.[2] Followed by a setup that's pretty standard for zsh converts especially if you're on OS X[3]. Bobby's theme is good out of the box and git-friendly. Read the guide to see the out-of-the-box omf plugin functionality[4]. It really is that easy. Some iTermer's like Agnoster[5], and the github page has previews for dozens of themes.
-- Modifications that might be of interestif you're an autojump/z/j user [Skip to the citations 2-5 if you just want to try Fish out] --
Directory navigation/auto-complete/globbing is probably the #1 'issue' I've had with shells, and I'd imagine others as well because of the numerous 'j','z','autojump', etc solutions that are out there. My problem with all of those is that it uses heuristics rather than giving you a deterministic solution as to 'ok, you will end up here'.
After ~15 years I finally wrote my own solution extended fish with SQLite. After every cmd, it makes an atomic append to the directory history…
richardofyork · 2012-08-26
I learned Backbone just about 3 months ago and the first project I built (still in developing) with it was a commercial eCommerce web application for a major client. This is how I learned Backbone:
—— 1. I downloaded a copy of the following book and followed all the examples:
http://addyosmani.github.com/backbone-fundamentals/
Note that the following incomplete sections in the book you will very likely need (I did). The answer to each can be found on StackOverflow.
- Sub-Views And Nesting
- Managing Models In Nested Views
- Views Triggering Other Views
- Cleanly Disposing Views
- [Communicating effectively between views (particularly subviews)]—I added this because I was not sure how to do this after reading the book, I found help on StackOverflow.
By the way, the book is very good and Addy Osmani is a thorough writer, he does not shy away from detail, which I love. Detail is very good, it prevents you from getting stuck later and allows you to have a thorough understanding of the subject matter.
—— 2. Follow these 3 tutorials, they are easy, but very helpful:
http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tutorial-par…
http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tutorial-par…
http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tutorial-par…
— And this one, which is incredibly important for improving your Backbone skills and using Backbone efficiently. These are the…
fomojola · 2020-05-16
Very nice. In a similar vein, I've used https://ricostacruz.com/flatdoc/ before, which is a bit more full featured and includes support for code samples.
denisw · 2017-10-14
It seems as if the author is on the way to rediscovering the idea of Unobtrusive JavaScript, aka the RSJS pattern (Reasonable System for JavaScript):
http://ricostacruz.com/rsjs/
The main difference is that Unobtrusive JavaScript relies on HTML5 data attributes rather than misusing CSS classes.
Perhaps the most well-known example of the Unobtrusive JavaScript approach are the AJAX helpers of Rails:
http://guides.rubyonrails.org/working_with_javascript_in_rails.html
rstacruz · 2017-09-18
Nice work! I've also done a similar thing (https://github.com/rstacruz/onmount), and it's really useful in managing behaviors in a page.
For those wondering what this is for, I've written a document with guidelines in building scalable non-SPA apps leveraging this: http://ricostacruz.com/rsjs
srpeck · 2017-01-26
Interesting. I had not seen FlatDoc (http://ricostacruz.com/flatdoc/) before. Similar purpose to what I was aiming for with Benchpress CMS (demo: https://srpeck.github.io/benchpress/ and repo: https://github.com/srpeck/benchpress). Not a huge fan of putting all the page-building client-side though and breaking the lightweight HTML web, regardless of how fast it can be.
moondowner · 2015-07-03
For the lazy, the source reveals these jQuery dependencies:
https://github.com/camoconnell/lazy-line-painter
http://ricostacruz.com/jquery.transit/
https://github.com/jquery/jquery-mousewheel
netnichols · 2014-11-28
Funnily enough I was just today checking out Transit[1] for a project I'm working on. Has anyone gone through the process of picking Velocity vs. Transit? What made you pick one or the other?
[1]: http://ricostacruz.com/jquery.transit/
jonahx · 2014-10-07
This looks nice but $60/mo seems incredibly pricey when there are also nice, and similar, open source solutions such as http://ricostacruz.com/flatdoc/
What extra value am I paying for?
stellar2014 · 2014-09-30
Another stripe inspired documentation made easy @ http://ricostacruz.com/flatdoc/
stillmotion · 2014-03-11
I very much enjoy using NProgress.js (http://ricostacruz.com/nprogress/). Very similar to this library, but with the added benefit of a random increment function that allows you to show progress without knowing the specific position.
dsk139 · 2014-03-07
There's a couple of libraries that help you implement this. http://ricostacruz.com/nprogress/ is one.
dieulot · 2014-02-08
Yes, I was thinking about something in the like of NProgress: http://ricostacruz.com/nprogress/ If the page is displayed instantly, show a complete bar that disappears. (I’m not sure if that would solve the problem, I may explore different solutions.)
wiradikusuma · 2013-08-21
Wow, this is cool. The first thing I thought when I saw http://ricostacruz.com/nprogress/ (submitted earlier) was how much effort to port/implement it to/in AngularJS. And you did it!
Sorry for nitpicking: (1) I think the color is too strong, (2) At one time (I don't know what I did), the progress bar went 50% but centered instead of left-aligned (but still on top), unfortunately I can't reproduce it, and (3) While trying to reproduce the bug, I encounter another bug where it won't stop if I click "Start progressbar" repeatedly.
diggan · 2013-08-21
This is a Angular provider I've created after seeing NProgress[1] but I didn't want the jQuery dependency and I also wanted it for Angular so here it is.
Please comment if you see I'm doing something superstrange in the code or if you have any suggestions. I'm eager for your feedback!
[1] http://ricostacruz.com/nprogress/
wosc · 2013-08-21
Here's a general-purpose JS implementation of a progress bar that achieves a similar visual effect: http://ricostacruz.com/nprogress/
swah · 2013-08-20
Careful not to read this too fast: I thought it was criticizing http://ricostacruz.com/nprogress/ but it's not.
sohooo · 2013-07-15
There's also flatdoc http://ricostacruz.com/flatdoc/ which renders the markdown file on the client side ('marked' js parser), so no server-side stuff is needed.
azamuddin · 2013-04-03
Hey eranation, for multiple words we can use CamelCase and avoid underscore. And when we use multiple words, both 'imageModel' and 'ImageModel' are good practice, see here http://ricostacruz.com/backbone-patterns/#naming_convention
and about adding multiple things to collection the reason for using 'add' instead of 'reset' is, 'add' will maintain the existing data, while reset will clear the existing data then replace it.
I like the code schools's part 1 and 2 which was written by Jeremy Ashkenas, it is simple but practical, I agree.
eranation · 2013-02-14
Looks really nice
honorable mention to other nice animation frameworks:
Move.js (http://visionmedia.github.com/move.js/)
Transit.js (http://ricostacruz.com/jquery.transit/)
drivebyacct2 · 2012-01-10
This has been very helpful for me, learning Backbone.js: http://ricostacruz.com/backbone-patterns/
jarek-foksa · 2011-06-26
Not sure if that's what you meant, but there is already JavaScript to CoffeeScript compiler: http://ricostacruz.com/js2coffee/
nicksergeant · 2011-06-23
FWIW, I used js2coffee on a 400-line JS file powering an app today and the compiled version of the code (js->coffee->js) was noticeably faster than the straight JS version. The for-in efficiency is probably part of that.
A quick way to port once: http://ricostacruz.com/js2coffee/
kirchhoff · 2013-07-28
bergie · 2011-07-05
There is http://ricostacruz.com/js2coffee/
TrevorBurnham · 2011-06-14
This podcast was recorded about three weeks ago. A couple of things that have happened since then that surprised me:
1. I was asked about CoffeeScript and CouchDB. To my surprise (and delight), it's since been announced that CoffeeScript support will be integrated into CouchDB 1.2 (see https://issues.apache.org/jira/browse/COUCHDB-817).
2. I was asked whether there's a JavaScript-to-CoffeeScript compiler. I said no, and there probably never would be... then js2coffee appeared (which is quite good, though the code it generates doesn't always have the same behavior as the original JS): http://ricostacruz.com/js2coffee/
Also, I was asked at the end if I had any upcoming speaking engagements. At the time, I didn't. I'm now scheduled to talk about CoffeeScript at the O'Reilly Web 2.0 Expo in NYC in October, and at Øredev in Sweden in November.
So, things are moving pretty fast in CoffeeScriptland. My book (http://pragprog.com/titles/tbcoffee/coffeescript) was PragProg's #1 seller last month. Who knows what the next three weeks will bring?