Skip to content

Instantly share code, notes, and snippets.

View raorao's full-sized avatar

Srinivas Rao-Mouw raorao

  • San Francisco, CA
View GitHub Profile
@raorao
raorao / large_changes.md
Last active December 4, 2024 19:21
Applying large changes to co-owned repos

Prerequisties

  • a script that can make all necessary changes, with no manual intervention.

Steps for Implementer

  1. check out master, run the script, commit the result
git fetch origin
git checkout master
@raorao
raorao / pr-comment-emojis.md
Last active December 12, 2024 14:23
PR Comment Emojis

Any top-level comment on pull request ought be tagged with one of four emojis:

  • for a non-blocking comment that asks for clarification. The pull request author must answer the question before the pull request is merged, but does not have to wait for the comment author to re-review before merging.

  • 🎨 for a non-blocking comment that proposes a refactor or cleanup. The pull request author does not have to address the comment for the pull request to merge.

  • ⚠️ for a blocking comment that must be addressed before the pull request can merge. The comment's author should leave a Request Changes review, and is responsible for re-reviewing once the pull request author has addressed the issue.

  • 😻 for a comment that compliments the author for their work.

<html>
<body>
<style>
td {
border: 1px solid black;
width: 40px;
height: 40px;
}
</style>
@raorao
raorao / ets_cache.ex
Last active October 21, 2024 19:20
Simple ETS based cache with TTL
defmodule RequestCache do
@moduledoc """
Simple ETS-based cache.
"""
use GenServer
@type t :: %{ttl: integer, invalidators: %{}}
@type cache_key :: any
@type cache_value :: any
@raorao
raorao / gen_server_cache.ex
Created May 12, 2017 04:30
Simple Process cache in Elixir.
defmodule RequestCache do
@moduledoc """
Simple GenServer-based cache.
"""
use GenServer
@type t :: %{cache: %{optional(cache_key) => cache_value}, interval: integer}
@typep cache_key :: any
@typep cache_value :: any
GroceryList.start
GroceryList.next
# nil
GroceryList.add("a gallon of milk")
# :ok
GroceryList.next
# "a gallon of milk"
@raorao
raorao / progress.sass
Last active September 4, 2015 20:00
how I used to write sass --> how i write it now.
// how I used to write sass!
// -----------------------
// its short, sure, but short doesn't necessarily mean simple. Its very difficult for me
// to tell how a given element gets its styles -- element-1 is getting inherited styles
// from its container, and then has two different explicit selectors. At scale,
// its even harder to tell what overrides what, and file ordering begins to actually
// matter. Whenever I see code like this now, I refactor it asap -- before
// it gets too unwieldy and brittle to change.
.container-element
font: 15px verdana

Keybase proof

I hereby claim:

  • I am raorao on github.
  • I am raorao (https://keybase.io/raorao) on keybase.
  • I have a public key whose fingerprint is 2B05 C1E8 A751 C8FF DE93 20B6 CC2B F1A1 2EC2 F87E

To claim this, I am signing this object:

@raorao
raorao / foo.md
Last active August 29, 2015 14:18

bar foo

Query = {}
Query.new = function() {
var queryAttributes = {
filters: [],
beginDate: null,
endDate: null,
attribute: null
}