Skip to content

Instantly share code, notes, and snippets.

M. Inam minaminfo

Block or report user

Report or block minaminfo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Hugo-similiar-post.html
{{ $page_link := .Permalink }}
{{ $tags := .Params.categories }}
{{ range .Site.Pages }}
{{ $page := . }}
{{ $has_common_tags := intersect $tags .Params.categories | len | lt 0 }}
{{ if and $has_common_tags (ne $page_link $page.Permalink) }}
<h2>Read Similiar</h2>
<div class="max-w-screen-sm mb-6 flex m-1 h-32 md:h-40">
<div class="w-1/3 flex">
@minaminfo
minaminfo / Disqus-show-comments.html
Last active Feb 25, 2020
This is a ready to use partial for hugo to add `show comments` like functionality to avold extra load time by hindering disqus request until user really need it.
View Disqus-show-comments.html
<div class="disqus-comments">
<div id="showcom">
<span>Say something or read other's ideas</span>
<button id="show-comments" type="button">Show <span class="disqus-comment-count" data-disqus-identifier="{{ .File.UniqueID }}">First article</span></button>
</div>
<div id="disqus_thread"></div>
</div>
<script id="dsq-count-scr" src="//{{.Site.DisqusShortname}}.disqus.com/count.js" async></script>
<script type="text/javascript">
View CS101.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
th {
border: 1px solid #000;
padding: 10px;
}
td {
@minaminfo
minaminfo / copy to clipboard.js
Last active Oct 1, 2019
Add 'copy to clipboard' button which works. Made speciically for Hugo code highlighter but after a little bit of modification works everywhere.
View copy to clipboard.js
// copy to clipboard
const d = document;
const tempCopyInput = d.createElement('input');
d.body.appendChild(tempCopyInput);
tempCopyInput.style.position = 'fixed';
tempCopyInput.style.top = '-1000px';
// copy to clipboard function
const copyToCB = () => {
tempCopyInput.select();
d.execCommand('copy');
You can’t perform that action at this time.