Skip to content

Instantly share code, notes, and snippets.

@mlent
mlent / social-sharing-buttons.html
Last active February 24, 2023 08:22
Social sharing buttons
<ul>
<li>
<a href="https://twitter.com/share?text=TITLE OF YOUR POST via @YOUR_USERNAME&url=HTTPS://YOUR_WEBSITE.COM" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235'); return false;">
Share on Twitter
</a>
</li>
<li>
<a href="https://news.ycombinator.com/submitlink?u=HTTP://YOUR_URL.COM&t=YOUR CONTENT" onclick="window.open(this.href, 'hn-share', 'width=550,height=350'); return false;">
Share on Hacker News
</a>
@mlent
mlent / .nginxconfig
Last active February 7, 2023 14:41 — forked from TedAvery/.nginxconfig
Yoast affiliate redirect for Affilimate
location /go/ {
rewrite ^/go/(.*)$ /go/index.php?id=$1 last;
}
@mlent
mlent / gist:60010ba2bb46c5bcad8af114d283c939
Last active September 28, 2022 09:46
open-links-in-new-tab.js
<script type="text/javascript">
jQuery(document).ready(function($){
$('a').each(function(){
const href = $(this).attr('href');
if (!href) {
return;
}
const isNotAnchor = href.indexOf('#') === -1;
const isNotInternalLink = href.indexOf('YOUR_WEBSITE_URL') !== 0 && href.indexOf('/') !== 0;