Skip to content

Instantly share code, notes, and snippets.

View Rahmanism's full-sized avatar
💻
I'm coding!

Rahmani Rahmanism

💻
I'm coding!
View GitHub Profile
@Rahmanism
Rahmanism / html.htm
Last active October 9, 2019 13:57
HTML Default Sceleteon
<!doctype html>
<html dir="rtl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title></title>
</head>
<body>
</body>
@Rahmanism
Rahmanism / view-webcam.htm
Last active October 9, 2019 13:40
View web cam using JavaScript
<video id="video1" autoplay></video>
<script type="text/javascript">
const v = document.getElementById('video1');
function startVideo() {
navigator.getUserMedia(
{ video: {}, audio: {} },
stream => v.srcObject = stream,
err => console.error(err)
@Rahmanism
Rahmanism / confirm-leaving-page.htm
Created October 18, 2019 09:52
Confirm leaving page
<script type="text/javascript">
window.onbeforeunload = function () {
if (is_there_unsaved_data()) {
return "Are you sure you want to navigate away?";
} else {
return;
}
}
</script>
@Rahmanism
Rahmanism / search_all_fileds_all_tables.sql
Created May 1, 2020 11:27
Search in all fields of all tables in SQL Server
DECLARE @SearchStr nvarchar(100)
SET @SearchStr = 'search term'
-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
-- Purpose: To search all columns of all tables for a given search string
-- Written by: Narayana Vyas Kondreddi
-- Site: http://vyaskn.tripod.com
-- Updated and tested by Tim Gaunt
-- http://www.thesitedoctor.co.uk
@Rahmanism
Rahmanism / find_changed_issues_in_jira.jql
Last active August 30, 2021 14:48
JQL to find all issues in Jira that their status has changed in a specific date to a specific status
project = "YourProject" and status changed from "Done" to "open" and status changed on "2021/08/30" ORDER BY created DESC
@Rahmanism
Rahmanism / scrolled.js
Last active January 7, 2023 09:16
To check if user scrolled to the bottom of an HTML element
const elem = document.querySelector('#elem')
elem.onscroll = () => {
if (elem.clientHeight + elem.scrollTop >= elem.scrollHeight) {
console.log('You\'ve reached the bottom of text.')
}
}
@Rahmanism
Rahmanism / allow-scripts-powershell.ps1
Created January 2, 2023 10:13
Let scripts run in Powershell for current user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope currentuser
@Rahmanism
Rahmanism / wait-promise.js
Last active January 7, 2023 09:16
JavaScript wait function with promise
function wait(time) {
return new Promise(resolve => {
setTimeout(resolve, time)
})
}
@Rahmanism
Rahmanism / nextcloud-renew-letsencrypt.sh
Created January 3, 2023 07:19
Renew LetsEncrypt in NextCloud
nextcloud.enable-https lets-encrypt
@Rahmanism
Rahmanism / install-ssl-nextcloud.sh
Created January 3, 2023 07:21
Install custom SSL certificate in NextCloud (installed with snap)
# First copy your cert files into /var/snap/nextcloud/current/certs/custom/
nextcloud.enable-https custom -s cert.pem privkey.pem chain.pem