Skip to content

Instantly share code, notes, and snippets.

View dpaola2's full-sized avatar

Dave Paola dpaola2

View GitHub Profile
@dpaola2
dpaola2 / daves-pairing-exercise.md
Created December 13, 2022 17:26
Dave's Pairing Exercise

Dave's Pairing Exercise

Hello and thanks for spending some time pairing with me! This exercise is an opportunity for us to try out working together and hopefully have some fun writing code!

  • This exercise is open ended and collaborative. There are no set goals or evaluation metrics.
  • We have 60 minutes together, and as that is not a lot of time, we should spend it wisely and make sure we make the most of it.
  • It's best to use the candidate's (your) machine, in their most comfortable environment/IDE, while sharing screen.
  • It's recommended to use the language/framework you are most familiar with, and choose a task that would be best in this language/framework (it's not the day for trying a new language :) )
  • Bonus points if you run rails new/npm install/composer create-project/etc beforehand so that we can get started a bit faster
ruby-2.6.8 - #removing src/ruby-2.6.8 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/13.0/x86_64/ruby-2.6.8.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/dave/.rvm/rubies/ruby-2.6.8, this may take a while depending on your cpu(s)...
ruby-2.6.8 - #downloading ruby-2.6.8, this may take a while depending on your connection...
ruby-2.6.8 - #extracting ruby-2.6.8 to /Users/dave/.rvm/src/ruby-2.6.8 - please wait
def javascript_to_elixir(js_code)
# Define a method that will convert JavaScript keywords to Elixir
define_method :convert_keyword do |keyword|
case keyword
when "function"
"def"
when "var"
"def"
when "let"
"def"
{
"_id": "1661312886559-1055787122967",
"coreID": "33304708393730393c001d00",
"locationID": "1654872368417-0895177245456",
"name": "WaterLeak",
"severity": 2,
"start": "2022-08-24T03:48:03.000Z",
"displayName": "Leak",
"details": {
"totalLiters": 24846.9575699462,
@dpaola2
dpaola2 / stripe_handler.js
Created September 30, 2018 23:23
Stripe Elements and Turbolinks
function doStripe() {
if (!document.getElementById('card-element')) {
return;
}
var stripe = Stripe(window.stripe_key);
var elements = stripe.elements();
var style = {};
var card = elements.create('card', {style: style});
@dpaola2
dpaola2 / gist:6fcbc58f48ae5840673ed2e5a1879276
Created March 29, 2019 19:22
Managers Path Marginalia
The Managers Path Notes
- chapter 1: management 101
- what to expect from your manager
- 1:1s
- feedback, workplace guidance
- give it fast
- manager needs to be number one ally
- ask for stretch projects
- shows you the larger picture of your work, provide sense of purpose
<html>
<body>
<script src="https://cdn.atomicfi.com/transact.js"></script>
<script>
Atomic.transact({
publicToken: "",
product: "deposit",
demoMode: true,
color: "#4B39EF",
onFinish: function(data) {},
@dpaola2
dpaola2 / Sidekiq Reset
Created January 6, 2021 18:51 — forked from unkleara/Sidekiq Reset
Sidekiq reset stats
To reset processed jobs:
Sidekiq.redis {|c| c.del('stat:processed') }
To reset failed jobs:
Sidekiq.redis {|c| c.del('stat:failed') }
To reset statistics:
Sidekiq::Stats.new.reset
# typed: false
class WebhooksController < ApplicationController
protect_from_forgery except: :stripe
def stripe
payload = JSON.parse(request.body.read, symbolize_names: true)
@event = Stripe::Event.construct_from(payload)
case @event.type
when "invoice.finalized"

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style