How to run examples:
- Run $ createdb nplusonedb to create DB
- Run specs $ rspec demo.rb
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
How to run examples:
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.
I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)
Before trying it out DIY, I considered using:
// Copyright 2014 The Flutter Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
// Flutter code sample for NavigationBar with nested Navigator destinations. | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
class Destination { |
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", github: "rails/rails" |
import 'package:async/async.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
void main() { | |
test("CancelableOperation with future", () async { | |
var cancellableOperation = CancelableOperation.fromFuture( | |
Future.value('future result'), | |
onCancel: () => {print('onCancel')}, | |
); |
The following outlines how to setup Heroku + Cloudflare with a full SSL certificate. What this means is that communication between the browser and the Cloudflare CDN is encrypted as well as communication between Cloudflare and Heroku’s origin server. Follow these steps exactly and the setup is a breeze.
First you want to add the root domain and the www domain to heroku. You do this by clicking into your production application, then going to settings and then scrolling down to Domains and certificates.
Here you will add <your_domain>.com
and www.<your_domain>.com
. This will give you two CNAME records. They will look something like <your_domain>.com.herokudns.com
and www.<your_domain>.com.herokudns.com
.
Developing an app to accompany our website, worried that we would lose people in the transition if they couldn't remember their password, we were looking to make our app do Password AutoFill, a feature in iOS.
A talk from WWDC introducing the feature: https://developer.apple.com/videos/play/wwdc2017/206/
It works well, but there were a few bumps in the road making it work for React Native on Expo, so here are some notes to help out.
Apple's docs are here: https://developer.apple.com/documentation/security/password_autofill and they say something like this:
class Rack::Attack | |
# By default, Rack::Attack uses `Rails.cache` to store requests information. | |
# It's configurable as follows - | |
# | |
# redis_client = Redis.connect(url: ENV["REDIS_URL"]) | |
# Rack::Attack.cache.store = Rack::Attack::StoreProxy::RedisStoreProxy.new(redis_client) | |
class Request < ::Rack::Request |