Access Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.deb
Access Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.deb
Access Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.deb
Increase live Ubuntu server disk space (requires LVM) without any downtime.
All of the commands below need to be executed as root
user.
Create a new partition using unallocated space.
First we'll need to determine exactly which disk was added or had its size increased.
Feature: Facebook Connect | |
Scenario: Sign in with Facebook | |
When I go to the sign in page | |
And I press "Sign in with Facebook" | |
And Facebook returns uid:"123", nickname:"chunky.bacon", first_name:"Chunky", last_name:"Bacon", email:"[email protected]" | |
Then I should see "Your mysite account was successfully created" |
... | |
gem 'devise', | |
:git => 'https://github.com/plataformatec/devise.git', | |
:branch => 'omniauth' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
... |
# in spec/support/omniauth_macros.rb | |
module OmniauthMacros | |
def mock_auth_hash | |
# The mock_auth configuration allows you to set per-provider (or default) | |
# authentication hashes to return during integration testing. | |
OmniAuth.config.mock_auth[:twitter] = { | |
'provider' => 'twitter', | |
'uid' => '123545', | |
'user_info' => { | |
'name' => 'mockuser', |
module Devise | |
module Models | |
# Registerable is responsible for everything related to registering a new | |
# resource (ie user sign up). | |
module Registerable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# A convenience method that receives both parameters and session to | |
# initialize a user. This can be used by OAuth, for example, to send |
# requires :password_reset_token and :password_reset_token_expires_at fields | |
module PasswordResetable | |
extend ActiveSupport::Concern | |
included do | |
before_validation do | |
if password_reset_token_expires_at && password_reset_expires_at.past? | |
expire_password_reset! | |
end | |
end |
I'm a Rust newbie, and one of the things that I've found frustrating is that the default docker build
experience is extremely slow. As it downloads crates, then dependencies, then finally my app - I often get distracted, start doing something else, then come back several minutes later and forget what I was doing
Recently, I had the idea to make it a little better by combining multistage builds with some of the amazing features from BuildKit. Specifically, cache mounts, which let a build container cache directories for compilers & package managers. Here's a quick annotated before & after from a real app I encountered.
This is a standard enough multistage Dockerfile. Nothing seemingly terrible or great here - just a normal build stage, and a smaller runtime stage.
require 'benchmark' | |
require 'etc' | |
Ractor.new { :warmup } if defined?(Ractor) | |
def fibonacci(n) | |
return n if (0..1).include? n | |
fibonacci(n - 1) + fibonacci(n - 2) | |
end |