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
// recipe_cards.js | |
$('.cards-wrapper').on('click', '.card', function() { | |
var new_top = this; | |
var cards_length = $(this).closest('.cards-wrapper').find('.card').length; | |
var l = cards_length - 1; | |
$(this).closest('.cards-wrapper').find('.card').each(function() { | |
if (this == new_top) { | |
// highest card always top css class - card 3 in 3-card layout, card 4 in 4-card layout | |
$(this).attr("class", "card card-" + cards_length + "-" + cards_length); | |
} |
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
# Goes with http://joemerante.blogspot.com/2014/07/may-tmil-touch-of-eval.html | |
# app/models/subscription.rb | |
class Subscription < ActiveRecord::Base | |
belongs_to :plan | |
after_create :set_expiration | |
# ... | |
def expired? | |
self.expiration < DateTime.now |
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
For quick reference if you're not in your usual environment, add to Preferences -> Key Bindings-User: | |
[ | |
{ "keys": ["alt+super+p"], "command": "insert", "args": {"characters": "binding.pry"} } | |
] | |
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
# some more explanation at https://joemerante.blogspot.com/2020/01/changing-pdf-metadata-with-python.html | |
import datetime | |
import fitz # install PyMuPDF | |
doc = fitz.open("existing_document.pdf") | |
for idx, page in enumerate(doc): | |
try: | |
while (next(page.annots())): | |
annot = next(page.annots()) | |
page.deleteAnnot(annot) |