Shortcut to prepend module that checks an argument and only calls original implementation if argument evals to false. Other versions could instead execute super(*args) and do different things depending on the result.
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
gem "rails", "6.0.3.6" | |
gem "bonsai-elasticsearch-rails", "~> 7" | |
gem "elasticsearch-model", github: "elastic/elasticsearch-rails", branch: "master" | |
gem "elasticsearch-rails", github: "elastic/elasticsearch-rails", branch: "master" |
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
#!/usr/bin/env bash | |
# Credit: https://stackoverflow.com/a/59795634/1686364 | |
host="localhost:9200" | |
response="" | |
attempt=0 | |
until [ "$response" = "200" ]; do | |
if [ $attempt -ge 25 ]; then |
rails new actiontexttest --webpacker
- cd actiontexttest
- rails action_text:install
- rails db:migrate RAILS_ENV=development
- Add a root route, controller and view file
bin/rails server
bin/webpack-dev-server
- goto http://localhost:3000 (in Internet Explorer 11)
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
export default [ | |
{ | |
table: 32, | |
from: 1, | |
to: 1600, | |
value: 0 | |
}, | |
{ | |
table: 32, | |
from: 1601, |
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
{ | |
"status": 1, | |
"list": { | |
"229279689": { | |
"item_id": "229279689", | |
"resolved_id": "229279689", | |
"given_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview", | |
"given_title": "The Massive Ryder Cup Preview - The Triangle Blog - Grantland", | |
"favorite": "0", | |
"status": "0", |
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
brew install erlang | |
brew install elixir | |
git clone https://github.com/phoenixframework/phoenix.git | |
cd phoenix | |
mix do deps.get, compile | |
mix phoenix.new ../my_app | |
cd ../my_app | |
mix do deps.get, compile | |
mix phoenix.server |
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
require "aws-sdk" | |
require "pry" | |
filename = File.expand_path("./deploy/video.rb", File.dirname(__FILE__)) | |
config_file = File.open(filename, "w") | |
client = Aws::EC2::Client.new( | |
region: "eu-west-1", | |
access_key_id: "access_key_id", | |
secret_access_key: "secret_access_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
{ | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetBucketLocation", | |
"s3:GetObject", | |
"s3:ListBucket" | |
], | |
"Resource": [ |
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
# Run with iex -S mix run script/verify | |
defmodule Pitch.VerifyPush do | |
@valid_tokens [ | |
"7a61a279e0a35396d08ce13131fa6e2278a404f53683f17a16e1d6566223c712" # add more here | |
] | |
@number_of_bad_tokens 10 | |
@pool :my_pool_name |
NewerOlder