Skip to content

Instantly share code, notes, and snippets.

View pcalves's full-sized avatar
🍵

Paulo Coelho Alves pcalves

🍵
View GitHub Profile
@pcalves
pcalves / placeholder.js
Created November 5, 2013 12:58
Placeholder polyfill (requires jQuery and Modernizr).
// input placeholder polyfill
if(!Modernizr.input.placeholder){
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@pcalves
pcalves / share.html
Last active December 31, 2015 07:59
Sharing without loading external elements.
<button href="http://twitter.com/home?status=STATUS" class="twitter">Tweet</button>
<button href="http://www.facebook.com/sharer.php?s=100&amp;p[url]=URL&amp;p[title]=TITLE&amp;p[summary]=DESCRIPTION&amp;p[images][0]=ABSOLUTE_LINK_TO_IMAGE" class="facebook">FB Share</button>
<button href="http://pinterest.com/pin/create/button/?url=URL&amp;media=MEDIA_IMG_OR_VIDEO&amp;description=DESCRIPTION" class="pinit">Pin It</button>
<button href="http://www.tumblr.com/share/link?url=URL&amp;name=NAME&amp;description=DESCRIPTION" class="tumblr">Tumblr</button>
@pcalves
pcalves / delete_dupes.sql
Last active January 3, 2016 21:09
Delete duplicate entries in a table (MySQL).
DELETE FROM table
USING table, table t2
WHERE table.id > t2.id
AND table.`column` = t2.`column`
@pcalves
pcalves / proof.md
Created March 21, 2024 16:33
keyoxide identity claim

aspe:keyoxide.org:4DUWGYYUDGLTC72ODGL5OA3KSU

@pcalves
pcalves / obsidian-web-clipper.js
Created March 27, 2024 08:52 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@pcalves
pcalves / obsidian-web-clipper.js
Last active March 27, 2024 08:53 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */