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
# app/controllers/concerns/pageable.rb | |
module Pageable | |
extend ActiveSupport::Concern | |
@@page_size = 20 | |
def page | |
@page ||= (params[:page].to_i > 1) ? params[:page].to_i : 1 | |
end |
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
<%# app/views/pageable/_widget.erb %> | |
<nav class='pageable-widget' aria-label="pagination widget"> | |
<%= if prev_page | |
link_to "prev", {controller: controller_name, action: action_name, page: prev_page}.merge(pageable_params), aria: { label: 'previous page'} | |
end %> | |
<%= if total_pages > 0 | |
"Page #{page} of #{total_pages}" | |
end %> |
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
@media (hover: hover) { | |
.masked-container:hover { | |
.mask { | |
/* needs to be able to take clicks while it's beneath .masked, to gain focus */ | |
pointer-events: auto; | |
/* once focused, clicks should fall through to .masked */ | |
&:focus { | |
pointer-events: none; | |
/* when focused, .mask and siblings not intended to be covered need to come above .masked */ | |
z-index: 1; |
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
/* -> If a card is EVER a .masked-container, it MUST ALWAYS be a .masked-container, | |
because this fucks w the z-indexes. | |
-> The styling of .masked MUST be predicated upon the presence of a .mask | |
-> .mask is assumed to have a saturated background-color to be legible under white text */ | |
.masked-container { | |
/* positioned above the container so that children w a negative z-index are also above the container */ | |
z-index: 1; | |
/* don't take clicks, so that negative z-index child can be clicked */ | |
pointer-events: none; | |
/* all descendants */ |
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
.a-post-card { | |
display: grid; | |
grid-template-columns: 1fr; | |
grid-template-rows: auto 1fr auto; | |
.cn-body { | |
grid-column: 1 / -1; | |
grid-row: 1 / -1; | |
color: white; |
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
.a-post-card { | |
display: grid; | |
grid-template-columns: 1fr; | |
grid-template-rows: auto 1fr auto; | |
.cn-body { | |
grid-column: 1 / -1; | |
grid-row: 1 / -1; | |
color: white; |
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
<article class='a-post-card masked-container'> | |
<section class='cn-body mask' tabindex=0> | |
I'm a content note! | |
</section> | |
<section class='post-inner masked' tabindex=0> | |
<span class='post-body'>I'm the text of the post!</span> | |
</section> | |
<header class='post-header'> |
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
<div class='a-post-card-hack'> | |
<div class='cn-body'>I'm pretending to be a content note</div> | |
<div class='post-inner'>I'm pretending to be a post</div> | |
</div> |
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 gitbranch() { | |
git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,' | |
} | |
function gitup() { | |
local git_branch=$(gitbranch) | |
local stash_out=$(git stash) | |
echo $stash_out | |
git checkout master | |
git fetch upstream |
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
#apparently the gist 'title' is just the name of the lexicographically first filename |