Skip to content

Instantly share code, notes, and snippets.

View bitlather's full-sized avatar

Jun Reiderdai bitlather

View GitHub Profile
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
$ rails new PROJECT_NAME --api --skip-test --skip-active-storage --skip-action-mailer --skip-action-mailbox
$ git diff --name-only master my_branch | sort
# 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]]
#
# 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'
@bitlather
bitlather / Symlink Tutorial.md
Created May 2, 2019 19:27
Tutorial for how to use symlinks
@bitlather
bitlather / create-react-app Ubuntu fix.txt
Created July 31, 2018 01:58
facebook/create-react-app - Fix for can't create app on Ubuntu
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
public class Lambda { // requires >= java 1.8
interface IntegerMath {
int operation(int a, int b);
default IntegerMath swap() {
return (a, b) -> operation(b, a);
}
}