Skip to content

Instantly share code, notes, and snippets.

View dissolved's full-sized avatar

Ryan Sandridge dissolved

View GitHub Profile
@dissolved
dissolved / .git-commit-template.txt
Created September 29, 2022 19:01
A Github Commit Template, which can live in either a project dir or your home dir.
# -----------------------------------------------
# For the subject line:
# * Use 50 characters maximum.
# * Do not use a sentence-ending period.
# --skip-ci
# ---------------------------------------------------------------------
# For the body text:
@dissolved
dissolved / 0_blocking_non_blocking.md
Last active December 9, 2021 23:00
Python Async/Await Introduction

Blocking vs Non-Blocking

A real world example

Let's say you have the following chores to do:

  • Balance your checkbook
  • Do 3 loads of laundry
  • Cook a pie

If we did all of these tasks synchronously it would take a very long time. Balancing the checkbook might take 30 minutes, each load of laundry will need to go through a wash cycle (30 minutes), and a dry cycle (45 minutes), and cook a pie (15 minutes prep, 30 minutes baking). If we blocked on each task, it would go like this:

@dissolved
dissolved / ruby_freeze.md
Last active March 3, 2020 14:55
A micropost about freezing unnecessarily

Cargo Culting Ruby's freeze

Years ago you rarely saw frozen Ruby objects, but it is very much popular now. There are good reasons to freeze. Take this commonly cited example:

MOVIE = "Not Frozen"
MOVIE << " II" # note no warning because MOVIE is not reassigned, but rather the string is mutated
puts MOVIE # "Not Frozen II"
@dissolved
dissolved / README.md
Last active February 21, 2020 16:05
Proof of Concept Bookmarklet to Generate Branch Name from Jira Issue

Not a Bird

Status

  • Works on Chrome without any much error handling.
  • Doesn't work on Firefox (yet)

Installation

  1. Optionally minify the code (can do that here)
  2. Create a bookmark, start it with javascript: then append the code
@dissolved
dissolved / 1-Intro.md
Last active May 8, 2019 12:16
ABC Complexity and Readability

I was helping out my friend who’s rubocop was complaining on ABC complexity on a method to format a range where either the lower or upper bound or both might be absent. Here was my solution that finally solved it, but here is where I simply wonder if the hoops we jump through to make static code analyzer’s happier isn’t always leading to more readable/maintainable code. You tell me, which is better?

The examples have been simplified to remove implementation details not important to this discussion. example.rb satisfies Rubocop while original.rb gets flagged for ABC complexity.

class Board():
"""A Tic-Tac-Toe board.
Internal representation by 1-dimensional list visualized as:
0 | 1 | 2
-----------
3 | 4 | 5
-----------
6 | 7 | 8
"""
@dissolved
dissolved / gist:14d77f1bc8c78836f877
Created March 24, 2016 23:43
Verifying that +dissolved is my blockchain ID. https://onename.com/dissolved
Verifying that +dissolved is my blockchain ID. https://onename.com/dissolved
@dissolved
dissolved / github-201501-201506-events.csv
Created September 18, 2015 23:51
Data Vis Module 2 Submission
repo_name total_events commit_comment_count create_count delete_count fork_count gollum_count issue_comment_count issues_count member_count public_count pull_request_count pull_request_review_comment_count push_count release_count watch_count
direwolf-github/my-app 292774 0 106493 106479 1 0 0 0 0 0 2 0 79799 0 0
KenanSulayman/heartbeat 262713 0 0 0 0 0 0 0 0 0 0 0 262711 0 2
sakai-mirror/melete 127619 0 0 0 0 0 0 0 0 0 0 0 127619 0 0
apache/spark 99937 151 34 18 2188 0 67801 0 0 0 6582 16799 4013 0 2351
GoogleCloudPlatform/kubernetes 86961 216 195 134 1249 33 47336 4950 0 0 9300 16184 4002 37 3325
greatfire/wiki 79871 1 0 0 439 11 282 62 2 0 0 0 77532 0 1542
ashking/phnest 74172 0 0 0 0 0 0 0 0 0 0 0 74172 0 0
rust-lang/rust 73616 1614 19 19 1139 92 37304 6311 0 0 6786 5374 10198 0 4760
docker/docker 64296 79 37 24 2344 32 37229 3960 0 0 5085 8057 1890 0 5559
@dissolved
dissolved / README.md
Last active February 14, 2017 03:37
Number of Events for Active Github Repos (1st Half 2015)

Data Source Information

This CSV file was created using Google interactive query interface BigQuery to access the Github Archive. The query used to generate this file is:

SELECT
  repo.name,
  COUNT(repo.name) AS total_events,
  SUM(CASE WHEN type = 'CommitCommentEvent' THEN 1 ELSE 0 END) commit_comment_count,
  SUM(CASE WHEN type = 'CreateEvent' THEN 1 ELSE 0 END) create_count,
 SUM(CASE WHEN type = 'DeleteEvent' THEN 1 ELSE 0 END) delete_count,

Keybase proof

I hereby claim:

  • I am dissolved on github.
  • I am dissolved (https://keybase.io/dissolved) on keybase.
  • I have a public key whose fingerprint is 00FB 9059 26D3 37B8 14BF 85F2 08EE 8911 FBE1 DD2A

To claim this, I am signing this object: