Skip to content

Instantly share code, notes, and snippets.

View dotLou's full-sized avatar

Louis Cloutier dotLou

  • Software Engineering Manager @Shopify
  • Gatineau, Quebec (Canada)
  • 10:13 (UTC -04:00)
View GitHub Profile
@dotLou
dotLou / install.md
Created December 22, 2021 21:05
git commit signing with gpg keys on mac os
  1. Import GPG keys from 1password/keybase/etc. (public & private!)
  2. brew install gpg gpg2 pinentry-mac
  3. echo "pinentry-program $(which pinentry-mac)" | tee ~/.gnupg/gpg-agent.conf
  4. Restart the agent (something like pkill -TERM gpg-agent and then a new terminal)
  5. Test it out echo test | gpg -e -r EMAIL_GOES_HERE | gpg -d (replace EMAIL_GOES_HERE with email of target key)
@idelem
idelem / titleUrlMarkdownClip.js
Last active March 12, 2024 02:01 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@jahfer
jahfer / active_record_test_logger.rb
Last active November 26, 2019 14:34
Small tweak to output Active Record logs inside of a test with the stacktrace attached
module MyLogSubscriber
def sql(*args)
trace = caller
Rails.backtrace_cleaner.remove_silencers!
Rails.backtrace_cleaner.add_silencer { |line| not line =~ /^(components)\// }
puts Rails.backtrace_cleaner.clean(trace)
super
puts "---------------"
end
end
@wojteklu
wojteklu / clean_code.md
Last active June 10, 2024 12:18
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules