Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
Finished "/cable/" [WebSocket] for 127.0.0.1 at 2018-11-16 08:32:24 -0700
An unauthorized connection attempt was rejected
This file contains hidden or 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 'active_record/connection_adapters/sqlite3_adapter' | |
| # | |
| # Monkey-patch for disable foreign keys during `alter_table` for sqlite3 adapter for Rails 5 | |
| # | |
| module ActiveRecord | |
| module ConnectionAdapters | |
| class SQLite3Adapter < AbstractAdapter |
Having to test your gem on your host app after having to commit changes to your gem... and then having to rebundle your gemfile ... which forces you to refer to your gem-in-process like:
gem 'nfg_ui', git: 'https://github.com/network-for-good/nfg_ui', branch: 'feature/some_feature_branch_that_im_working_on'And then have to:
$ bundle update gem_name`
This file contains hidden or 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
| # N.B. The only tool missing here that is mentioned in the document is `zenmap` | |
| # purely because this image is intended to be run via a CLI and `zenmap` is a GUI | |
| # to `nmap` i.e. one can play around with the tools by running: | |
| # | |
| # $ docker build --name bite_size_networking:latest . | |
| # $ docker run --rm -d --name bsn_test bite_size_networking:latest | |
| # $ docker exec -it bsn_test bash | |
| # | |
| # Alternatively, one can change the `ENTRYPOINT` to `["bash"]` and run: | |
| # |
This file contains hidden or 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
| <%= form_with(model: billboard) do |form| %> | |
| <%= tag.div class: "dropzone", data: { controller: "dropzone", dropzone_param_name_value: "billboard[images][]", dropzone_url_value: rails_direct_uploads_url, dropzone_accepted_files_value: "image/*", dropzone_max_files_value: 3, dropzone_max_filesize_value: 0.300 } do %> | |
| <div class="dz-default dz-message flex flex-col items-center"> | |
| <%= image_tag "upload.svg", size: 28, class: "colorize-black", aria: { hidden: true } %> | |
| <h5 class="font-semibold mbs-4">Drop files here or click to upload.</h5> | |
| <p class="text-sm text-subtle">Upload up to 10 files.</p> | |
| </div> | |
| <% end %> | |
| <div class="inline-flex items-center mbs-2 mie-1"> |
This file contains hidden or 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 'date' | |
| class Sorter | |
| def initialize(*instructions) | |
| @defaults = { | |
| direction: :ascending, | |
| nils: :small, | |
| accessor: :itself, | |
| case_sensitive: true, | |
| normalized: false, |
This file contains hidden or 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
| name: CI | |
| on: [push] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: |
This file contains hidden or 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 switch_pg { | |
| local version_to_run=$1 | |
| local currently_running_version=$(psql --no-psqlrc -t -c 'show server_version;' postgres | xargs) | |
| # check if you're erroneously switching to the same version | |
| if [ "$version_to_run" = "$currently_running_version" ]; then | |
| echo "Postgres $version_to_run is already running." | |
| return 1 | |
| fi |
This file contains hidden or 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
| import { Controller } from "stimulus" | |
| import SlimSelect from "slim-select" | |
| import "slim-select/dist/slimselect.min.css" | |
| import "../style/slimselect-customized.css" | |
| export default class extends Controller { | |
| connect() { | |
| const limit = this.data.get("limit") | |
| const placeholder = this.data.get("placeholder") | |
| const searchText = this.data.get("no-results") |
This file contains hidden or 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
| class ApplicationController < ActionController::Base | |
| include CableReady::Broadcaster | |
| include Toastable | |
| end |