Skip to content

Instantly share code, notes, and snippets.

View marcelokanzaki's full-sized avatar
🏠
Working from home

Marcelo Kanzaki marcelokanzaki

🏠
Working from home
View GitHub Profile
@marcelokanzaki
marcelokanzaki / pagination_controller.js
Created May 25, 2021 13:39 — forked from dhh/pagination_controller.js
HEY's Stimulus Pagination Controller
/*
ERB template chunk from The Feed's display of emails:
<section class="postings postings--feed-style" id="postings"
data-controller="pagination" data-pagination-root-margin-value="40px">
<%= render partial: "postings/snippet", collection: @page.records, as: :posting, cached: true %>
<%= link_to(spinner_tag, url_for(page: @page.next_param),
class: "pagination-link", data: { pagination_target: "nextPageLink", preload: @page.first? }) unless @page.last? %>
</section>
@marcelokanzaki
marcelokanzaki / web-servers.md
Created January 31, 2020 17:20 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000