Change your Github Settings > Appearance > Theme (light to dark, or dark to light) and reload this page! You will note that none of these solutions work!
View ansi_highlight.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "colorized_string" | |
String.class_eval do | |
# Adapted from the Rails highlight text helper. | |
# http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-highlight | |
# | |
# NOT FOR USE WITH HTML (use the Rails standard one for that) | |
# |
View Emoji Monospace Test.md
A markdown table that I want to be aligned; alas, it is impossible!
123456 | 123456 | 123456 | 123456 | 123456 | 123456 | 123456 | 123456 | 123456 |
Not even an attempt to pad with other characters works because the emoji are not even a multiple of the monospaced width.
|
View rails_single_file.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
View keybase.md
Keybase proof
I hereby claim:
- I am pboling on github.
- I am pboling (https://keybase.io/pboling) on keybase.
- I have a public key ASC8gzP9Mb-g0_M06lihOvgkD5uFbTrPooaUCSxRT9fIGgo
To claim this, I am signing this object:
View Gemfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixes :github macro to be secure HTTPS. | |
# :github macro is slated to become secure HTTPS by default in the Bundler 2.0 release. | |
git_source(:github) do |repo_name| | |
repo_name = "#{repo_name}/#{repo_name}" unless repo_name =~ /\// | |
"https://github.com/#{repo_name}.git" | |
end |
View unobtrusively_logged.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simpler version of what the debug_logging gem does; see https://github.com/pboling/debug_logging | |
# | |
############# THIS IS A BAUBLE | |
############# FOR EXAMINING SEVERAL OF THE WONDERS OF RUBY | |
############# TO ACCOMPLISH SOMETHING PRACTICAL | |
############# For a more robust implementation use the gem debug_logging itself, | |
############# which makes use of these same principles. | |
# | |
# Automatically log Class.method(arguments) as they are called at runtime (instance or singleton)! | |
# |
View private_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def calls_bar | |
bar + " from foo" | |
end | |
private | |
def bar | |
raise "define #{__method__} in subclasses" | |
end | |
end | |
class SubFooPrivateOverride < Foo |
View extract_embedded_flickr_image_url_for_google_sheets.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: | |
# | |
# embedded = '<a data-flickr-embed="true" href="https://www.flickr.com/photos/galtzo/32796076230/in/album-72157679012034441/" title="IMG_2054"><img src="https://c1.staticflickr.com/3/2939/32796076230_773e54a3b0_h.jpg" width="1200" height="1600" alt="IMG_2054"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>' | |
# extract_embedded_flickr_image_url_for_google_sheets(embedded) | |
# | |
def extract_embedded_flickr_image_url_for_google_sheets(embedded, mode: 4, aspect: "4:3", height: nil, width: nil) | |
options = [] | |
url = embedded[(start = embedded.index("img src=\"https")+9)..(start+embedded[start..(-1)].index("g\" "))] | |
options << "\"#{url}\"" |
View mixpanel-mock.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isDev = false; | |
if (window.__env.NODE_ENV === 'development') { | |
isDev = true; | |
} | |
if (isDev) { | |
var MixpanelMock; | |
MixpanelMock = (function() { | |
function MixpanelMock() { | |
this.init = function() { |
NewerOlder