Skip to content

Instantly share code, notes, and snippets.

@purwa-astawa
purwa-astawa / findOverflowParents.js
Created December 9, 2022 18:20 — forked from brandonjp/findOverflowParents.js
find overflow:hidden ancestors
// when you're trying to use `position:sticky` on an element
// you'll have trouble if any parent/ancestor element has
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll)
// & turns out if a parent is `display:flex` it might need some love
// (to remedy this you can set the `align-self` of your sticky element)
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o
// so, to find those troublesome parents...
// copy & paste this into Chrome Inspector/Dev Tools console
// (and be sure to change the #stickyElement below, if needed)
#!/bin/sh
#
# This hook is placed in Bare repository and it updates Working tree whenever a PUSH
# is executed
#
# Assuming following file structure:
# .
# |-- myproject
# |-- myproject.git
# set WORKTREE=../myproject
#Add a new remote URL pointing to the separate project that we're interested in.
git remote add -f spoon-knife git@github.com:octocat/Spoon-Knife.git
#Merge the Spoon-Knife project into the local Git project
git merge -s ours --no-commit spoon-knife/master
#Create a new directory called spoon-knife, and copy the Git history of the Spoon-Knife project into it.
git read-tree --prefix=spoon-knife/ -u spoon-knife/master
#Commit the changes to keep them safe.
@purwa-astawa
purwa-astawa / wp:migrationsfix.sql
Created April 9, 2014 06:05
wp:migrationquery
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `wp_usermeta` SET `meta_value` = REPLACE(`meta_value`, 'http://www.old-domain.com', 'http://www.new-domain.com');