Skip to content

Instantly share code, notes, and snippets.

@alisdair
alisdair / intensify.sh
Created May 21, 2019 23:44
intensifies Slack emoji creator
#!/bin/bash
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
# Number of frames of shaking
count=10
# Max pixels to move while shaking
@JoshCheek
JoshCheek / github_api_debugging.md
Last active August 29, 2015 14:19
How did we debug the github auth issue?

How did we debug the github api issue?

There is a mindset will guide you when debugging, this attempts to describe it, and then identify concrete ways that it led to decisions as a student and I performed a debugging.

We were working in a Rails application that was authenticating with github, and then getting a 401 error when asking for our repositories after getting the token.

@JoshCheek
JoshCheek / 1503_object_model_notes.md
Last active December 18, 2018 16:53
Object Model Notes for 1503

Object Model

Bindings

  • are nodes in the stack
  • store local_variables
  • have a return value
  • have a self
@kinopyo
kinopyo / custom_logger.rb
Created October 11, 2011 15:40
Custom logger file in Rails
# lib/custom_logger.rb
class CustomLogger < Logger
def format_message(severity, timestamp, progname, msg)
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
end
end
logfile = File.open("#{Rails.root}/log/custom.log", 'a') # create log file
logfile.sync = true # automatically flushes data to file
CUSTOM_LOGGER = CustomLogger.new(logfile) # constant accessible anywhere