Skip to content

Instantly share code, notes, and snippets.

View iaminamcom's full-sized avatar
🏠
Working from home

M. Inam iaminamcom

🏠
Working from home
View GitHub Profile
@iaminamcom
iaminamcom / Auto-Stoploss-and-profit-for-MT5.mq5
Last active October 30, 2023 15:23
Auto Stoploss and profit for MT5 - Good For Scalping
//+--------------------------------------------------------------------------------------------+
//| AutoStopLoss.mq5 |
//| Copyright 2023, iaminam.com |
//| ` https:/iaminam.com |
//| Made following https://orchardforex.com/mt5-expert-to-apply-an-automatic-stop-loss/ |
//+----------------------------------------------------+---------------------------------------+
#property copyright "Copyright 2023, iaminam.com"
#property link "https:/iaminam.com"
#property version "1.00"
#property strict
@iaminamcom
iaminamcom / how-to-add-cron-jobs-in-caprover.md
Last active January 13, 2025 10:51
How to add CRON jobs in Caprover

I was trying to add CRON jobs and found no guide. So here are the steps I followed

  1. mkdir cron && cd cron Creates directory and change into it.
  2. git init New git initialization.
  3. touch captain-definition Creates new captain config file.
  4. In captain-definition add folowing code. It'll loads jobber image which works fine even if deprecated. We just need it to run a task in a schedule.
# tab1
- tab:
name: "2020"
images:
# tab2
- tab:
name: "2019"
images:
# tab3
- tab:
@iaminamcom
iaminamcom / Hugo-similiar-post.html
Created February 26, 2020 05:39
To List similiar posts
{{ $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">
@iaminamcom
iaminamcom / Disqus-show-comments.html
Last active February 25, 2020 16:07
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.
<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">
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
th {
border: 1px solid #000;
padding: 10px;
}
td {
@iaminamcom
iaminamcom / copy to clipboard.js
Last active October 1, 2019 16:21
Add 'copy to clipboard' button which works. Made speciically for Hugo code highlighter but after a little bit of modification works everywhere.
// 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');