$ rails new PROJECT_NAME --api --skip-test --skip-active-storage --skip-action-mailer --skip-action-mailbox
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
function copyToClipboard(str) { | |
const el = document.createElement('textarea'); | |
el.value = str; | |
document.body.appendChild(el); | |
el.select(); | |
document.execCommand('copy'); | |
document.body.removeChild(el); | |
}; | |
str = $("h1.title").textContent |
$ git diff --name-only master my_branch | sort
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
# From: https://aws.amazon.com/blogs/developer/advanced-client-stubbing-in-the-aws-sdk-for-ruby-version-3/ | |
RSpec.describe RosterCsvNotifierJob, type: :job do | |
it "s3 test example" do | |
bucket = { | |
"SeededKey" => { body: "Hello!" } | |
} | |
s3 = Aws::S3::Client.new(stub_responses: true) | |
s3.stub_responses(:get_object, -> (context) { | |
obj = bucket[context.params[:key]] |
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
# | |
# FROM: https://aws.amazon.com/blogs/developer/advanced-client-stubbing-in-the-aws-sdk-for-ruby-version-3/ | |
# | |
require 'rspec' | |
require 'aws-sdk-s3' | |
describe "Enhanced Stubbing Example Tests" do | |
let(:fake_s3) { {} } | |
let(:client) do | |
client = Aws::S3::Client.new(stub_responses: true) |
$ gem uninstall bundler
$ gem install bundler --version '1.3.6'
Copy and paste into terminal:
echo "This is example.txt" > example.txt
cat example.txt
ln -s example.txt symlink.txt
cat example.txt
cat symlink.txt
echo "UPDATED" >> example.txt
cat example.txt
cat symlink.txt
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
https://stackoverflow.com/questions/22475849/node-js-error-enospc#32600959 | |
``` | |
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
$ sudo sysctl --system # Not sure if this is necessary | |
``` | |
Source: https://github.com/facebook/create-react-app/issues/2549 |
bold
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
public class Lambda { // requires >= java 1.8 | |
interface IntegerMath { | |
int operation(int a, int b); | |
default IntegerMath swap() { | |
return (a, b) -> operation(b, a); | |
} | |
} |