This file contains hidden or 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
# Sources: | |
# | |
# https://github.com/crystal-lang/crystal/issues/10066 | |
# https://github.com/crystal-lang/crystal/pull/10348#issue-564769672 | |
# | |
# Usage: | |
# | |
# - Follow the instructions here to install ibrew: https://soffes.blog/homebrew-on-apple-silicon | |
# - brew install gmp libevent libyaml [email protected] pcre pkg-config libatomic_ops llvm | |
# - brew unlink bdw-gc |
This file contains hidden or 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
# Custom errors with arguments | |
# | |
# Example usage: | |
# | |
# ENV.fetch('BLAH') { raise EnvironmentError.new('BLAH') } | |
class EnvironmentError < StandardError | |
attr_reader :key | |
def initialize(key) | |
@key = key |
This file contains hidden or 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
// ==UserScript== | |
// @name Disable Github List Completion | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Disables the behavior described in https://github.blog/changelog/2020-12-15-markdown-list-syntax-now-autocompleted/ | |
// @author Jay Dorsey | |
// @match https://*.github.com/* | |
// @grant window.focus | |
// ==/UserScript== |
This file contains hidden or 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
require "aws-sdk-s3" | |
# Original source: https://gist.github.com/fleveque/816dba802527eada56ab | |
# | |
# This version is for the newer aws-s3-sdk v3 | |
# | |
# You need to require some of the components, at least this one from what I remember: | |
require 'aws-sdk-s3' | |
# Upload a folder of files as public files, to S3, using threads. Useful for | |
# pushing assets compiledi in a rails app on S3, so you can front them with cloudfront. |
This file contains hidden or 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
require 'aws-sdk-s3' | |
# Creds get picked up from ENV vars per AWS docs | |
resource = Aws::S3::Resource.new(region: 'us-east-1') | |
bucket = resource.bucket('my-bucket') | |
bucket.put_object( | |
key: 'foo.gif', | |
body: File.read('foo.gif'), | |
acl: 'public-read' | |
) |
This file contains hidden or 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
# This file lives in the pry gem. This patch strips out backtrace information from the gems, so I | |
# only see _my_ code files related to an error when I'm in a pry session | |
# | |
# Replace the content in the begin block inside the +show_result+ method | |
# | |
# @todo Make this a separate gem that I can install to patch this method without having to edit my | |
# bundled pry gem | |
relevant_context = e.backtrace.reject { |b| b =~ /(ruby\/gem)|(asdf\/installs)/ } | |
output.puts "(pry) output error: #{e.inspect}\n\nRelevant files:\n\n#{relevant_context.join("\n")}\n\n" |
This file contains hidden or 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
libgirepository-1.0-1 | |
libgirepository1.0-dev | |
libpoppler-glib-dev |
This file contains hidden or 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
# Generates docs | |
gem list | awk '{ print $1 }' | xargs gem rdoc | |
# Starts server | |
gem server |
This file contains hidden or 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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"definitions": { | |
"attributes": { | |
"additionalProperties": false, | |
"description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.", | |
"patternProperties": { | |
"^(?!relationships$|links$)\\w[\\w_-]*$": { | |
"description": "Attributes may contain any valid JSON value." | |
} |
This file contains hidden or 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' | |
require 'bundler' | |
require 'pry' | |
require 'pry-byebug' | |
rescue LoadError => e | |
STDERR.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end |