build-lists: true
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
# Apply a sample rate to Scout so it only instruments a portion of requests | |
# or jobs. Here's an example of how to use it in a controller action or job: | |
# ScoutApm::Transaction.use_sample_rate 0.001 | |
module ScoutApm | |
module Transaction | |
# Set SCOUT_SAMPLING=false to disable sampling. This will send all transactions to Scout, | |
# and very quickly use up our monthly transaction limit. | |
USE_SAMPLING = ENV["SCOUT_SAMPLING"] != "false" | |
def self.use_sample_rate(rate) |
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
# frozen_string_literal: true | |
class AdapterSetupComponent < ApplicationComponent | |
def initialize(app, process_type) | |
@app = app | |
@process_type = process_type | |
end | |
def template | |
render ModalComponent.new do |modal| |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
sourceInternal: 'default', | |
logs: [], | |
source: Ember.computed('sourceInternal', { | |
get: function() { | |
this._log(`[source getter] sourceInternal=${this.get('sourceInternal')}`); | |
return this.get('sourceInternal'); |
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
Event.where(date_end: (Time.current.midnight .. Time.parse('2020-01-01'))).cache_key | |
#=> "events/query-38261fed1ce8f823ec1c05f19e0123fb-0" | |
Event.where(date_end: (Time.current .. Time.parse('2020-01-01'))).cache_key | |
#=> "events/query-a5aea4fdf9842521af708f1d663a710b-0" |
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
release: RAILS_MAX_THREADS=1 rails db:migrate | |
web: RAILS_MAX_THREADS=$PUMA_THREADS rails c | |
worker: RAILS_MAX_THREADS=$SIDEKIQ_THREADS bundle exec sidekiq | |
# heroku config:add RAILS_MAX_THREADS=1 so one-off dynos don't consume more than necessary |
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
#!/bin/bash | |
# Example: | |
# pgpull -r production | |
# | |
# Options are passed through to `heroku pg:pull`, so this would look for a git branch | |
# named "production". | |
opts=$* | |
# Replace this with your local database name |
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 is a simple script to convert an XML file exported | |
# from Evernote into a bookmarks file that can be imported | |
# into Pinboard. In my case, all I cared about were notes | |
# that had a source-url, and all I'm retaining is the title | |
# and URL. I'm adding a fixed "evernote" tag for all notes. | |
require 'nokogiri' | |
def note_attributes(note) | |
{ |
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
#!/bin/bash | |
md_filename=$1 | |
html_filename=/tmp/ghpreview.html | |
url=https://api.github.com/markdown/raw | |
# Markdown to HTML | |
html=`curl --data-binary @$md_filename -H 'Content-Type:text/plain' $url` | |
# Grab Github's fingerprinted stylesheets |
NewerOlder