Skip to content

Instantly share code, notes, and snippets.

View eskfung's full-sized avatar
🕳️

Eric Fung eskfung

🕳️
View GitHub Profile
@eskfung
eskfung / snacklog.md
Created September 24, 2024 19:11
In Support of the “Snacklog”

Recently we’ve noticed a number of our clients maintain a backlog of small tasks that are handled separately from their main backlog. These are tasks that should be finished at some point, but will rarely take priority over business-critical features and bugfixes. Often they are bite-sized pieces of work that can be finished in a couple of hours or less: addressing engineering chores, paying off tech debt, and addressing minor bugs. Internally, this separate backlog has earned a catchy name: the snacklog.

When is it appropriate to work on a snacklog task instead of something in the prioritized backlog? After all, developers should be working on things that move the business forward (obviously). Inevitably, though, natural lulls come up in the course of development:

  1. I’ve just finished a big pull request and have some time before my team finishes leaving feedback.
  2. I’m temporarily blocked by a design or product decision.
  3. It’s near the end of the day, and I’d rather work on something small than sta
@eskfung
eskfung / emoji-reviews.md
Created September 24, 2024 19:11
How to Use Actionable Emojis in Your Pull Request Reviews

Carbon Five has embraced emoji in daily written communication. They carry a lot of meaning in a small package, they inject personality and culture into our writing, and they visually stand out on the page as you scan a document. Pull requests are no exception. Love them or hate them, emojis ensure our pull request comments include the intended tone, something easily lost in written communication.

An engineer has only two strong signals to summarize their whole response to a PR: approve or reject. But what about all of the smaller, intermediate comments? Consider prefacing a review comment with different emoji to classify the comment under one of these three categories. (Many thanks to Srinivas Rao for his initial write-up that inspired this strategy.)

  1. Positive, congratulatory comments that give kudos and compliment the author for his or her work. The pull request author is not required to respond to these.

To stick to green emojis:

@eskfung
eskfung / require-pr-labels.yml
Created October 6, 2021 19:30
Require the presence of certain labels before a pull request is ready to merge
# .github/workflow/require-pr-labels.yml
name: Require Pull Request Labels
permissions:
pull-requests: read # Needs read permissions in order to read labels and reviews
on:
pull_request:
types: [labeled, unlabeled, opened, edited, reopened, synchronize]
pull_request_review:
jest.mock('@/constants', () => ({
...jest.genMockFromModule('@/constants'),
FOO: 'bar',
}))

Keybase proof

I hereby claim:

  • I am eskfung on github.
  • I am eskfung (https://keybase.io/eskfung) on keybase.
  • I have a public key whose fingerprint is CB5E E4E7 AB34 85B7 3345 ED97 987A E3A2 215E AF80

To claim this, I am signing this object:

@eskfung
eskfung / ApplyAssignmentGroupsToCase.trigger
Last active August 11, 2022 03:16
Apex for round robin assignments of Salesforce leads and cases.
trigger ApplyAssignmentGroupsToCase on Case (after update) {
Map<Id, Id> caseOwners = new Map<Id, Id>();
for (Case c : Trigger.new) {
if (Trigger.isUpdate) {
if (c.OwnerId != Trigger.oldMap.get(c.id).OwnerId) {
caseOwners.put(c.Id, c.OwnerId);
}
} else {
caseOwners.put(c.Id, c.OwnerId);
@eskfung
eskfung / km_json_to_csv.rb
Created November 20, 2014 20:22
KM People JSON to CSV
require 'csv'
data = {
# simplifying returned results
"total" => nil,
"links" => [],
"metadata" => {},
"columns"=> [
{
"display_name"=>"KMID",
@eskfung
eskfung / KMTrackLeadConversion.trigger
Last active April 30, 2023 08:29
Notify KISSmetrics of Salesforce actions
trigger KMTrackLeadConversion on Lead (after update) {
List<String> lead_ids = new List<String>();
for(Lead lead : Trigger.new) {
if(lead.IsConverted && !trigger.oldMap.get(lead.Id).IsConverted) {
lead_ids.add(lead.Id);
}
}
KMTracking.trackLeadsConverted(lead_ids);
}
@eskfung
eskfung / identity_tracking.erb
Last active December 24, 2015 07:59
How KISSmetrics uses the 'identify' API call.
<!-- KISSmetrics -->
<script type="text/javascript">
var _kmq = _kmq || [];
var _kmk = _kmk || 'foo';
function _kms(u){
setTimeout(function(){
var d = document, f = d.getElementsByTagName('script')[0],
s = d.createElement('script');
s.type = 'text/javascript'; s.async = true; s.src = u;
f.parentNode.insertBefore(s, f);
@eskfung
eskfung / _analytics.html
Created September 30, 2013 18:12
Two examples of using the 'record' API call, within the KISSmetrics support site.
<!-- KISSmetrics -->
<script type="text/javascript">
var _kmq = _kmq || [];
var _kmk = _kmk || 'foo';
function _kms(u){
setTimeout(function(){
var d = document, f = d.getElementsByTagName('script')[0],
s = d.createElement('script');
s.type = 'text/javascript'; s.async = true; s.src = u;
f.parentNode.insertBefore(s, f);