Skip to content

Instantly share code, notes, and snippets.


Sunny R. Juneja sunnyrjuneja

View GitHub Profile
hopsoft / Dockerfile
Last active May 22, 2022
Dockerize your Rails app
View Dockerfile
FROM ruby:3.0-alpine
RUN apk add --no-cache --update \
ack \
bash \
build-base \
curl \
git \
htop \
less \
ProGM /
Last active Aug 9, 2022
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.


posts =
posts = Post.arel_table # ActiveRecord

Table alias

View neat postgres
  • Constraints - super important for ensuring data integrity (bad data can't get into the DB)

  • Indexes - i

BaseCase /
Last active Jan 23, 2020
List of resources recommended or mentioned by the speakers at Deconstruct 2017

Deconstruct 2017 Bibliography

Here are all of the resources mentioned by Deconstruct 2017 speakers, along with who recommended what. Please post a comment if I missed something or have an error!

DC 2017 Speakers' Choice Gold Medalist

  • Seeing Like a State by James Scott


  • Public Opinion by Walter Lippmann (Evan Czaplicki)
  • A Pattern Language by Christopher Alexander (Brian Marick)
  • Domain Driven Design by Eric Evans (Brian Marick)
View types.markdown

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

View README.markdown

I've written this code to test what happens once a Stripe card token has been passed through to the server. This code does not do any browser testing (because JS-friendly headless testing is painful at best, and impossible if you want VCR in the mix). VCR is being used here to capture interactions with a test Stripe account, to ensure the tests are fast on future runs. That said, it's structured so that nothing is expected to be present in the Stripe account. If you delete all the stored VCR cassettes, the specs will safely re-record them.

Instead of using VCR.use_cassette directly, instead you use stripe_cassette in your specs, passing in the current spec example object. This will automatically generate a cassette name based on the spec's file name and the example's description (limitations of this are noted in the code comments). Within the cassette's recording block, Stripe data is cleared out before yielding back to the spec, with a context object. The context object provides access to helper methods

bishboria /
Last active Aug 9, 2022
Springer made a bunch of books available for free, these were the direct links

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.