Skip to content

Instantly share code, notes, and snippets.

View im-noob's full-sized avatar
🎯
I'm Iron man

Amritesh kumar im-noob

🎯
I'm Iron man
View GitHub Profile
@im-noob
im-noob / FixTelescopeIssue.js
Created June 10, 2021 14:38
Fix Telescope Issue Laravel
Fix telescope path issue.
Auto Load Entries
0. mkdir -p resources/views/vendor/telescope
1. cp vendor/laravel/telescope/resources/views/layout.blade.php resources/views/vendor/telescope/
2. window.Telescope.path = '{{ env('MIX_APP_NAME') }}/telescope'; in view
3. MIX_APP_NAME=Projects/catalet/public/
@im-noob
im-noob / Datatable Config Same Page.js
Created May 26, 2021 07:37
DataTable Setting On Same Config where it was
function fetch_data($project_id) {
progress_bar_start();
visible_column_list = [];
columnDefs = [];
/*Extracting Column name from List*/
column_filter.each(function () {
visible_column_list.push({'data': $(this).val()});
@im-noob
im-noob / selenium_starter2.py
Created May 22, 2021 08:54
Starter Code Selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import Select
import os
import shutil
import time
import ntpath
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
@im-noob
im-noob / AddLoader.js
Last active May 21, 2021 09:44
Add Loader in page for download reqest
// js
xhr: function()
{
var xhr = new window.XMLHttpRequest();
let duration_change = true;
//Download progress
xhr.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<div class="container">
<h2>Button Styles</h2>
<button type="button" id="button1" class="btn">Basic</button>
@im-noob
im-noob / DetectAjaxRequest.js
Created April 13, 2021 07:52
Detect XHR ajax request with javascript
(function() {
var proxied = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function() {
console.log( arguments );
return proxied.apply(this, [].slice.call(arguments));
};
})();
@im-noob
im-noob / Laravel_Permission.sh
Created April 6, 2021 05:56
Laravel Permission On Server
sudo chown -R www-data:www-data html/
sudo usermod -a -G www-data root
sudo find html/ -type f -exec chmod 644 {} \;
sudo find html/ -type d -exec chmod 755 {} \;
cd html/
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
reference: https://stackoverflow.com/a/37266353
@im-noob
im-noob / PlayDifferentAudioInLinkedIn.js
Created April 3, 2021 19:51
Play Different Audio In LinkedIn
// let audio_url = 'https://media.licdn.com/media/AAMBAQQiAAgAAQAAAAAAAAriAAAAJDg2ZWY0MzhjLWQ5YTUtNDgyMy1hZjQ3LWYzM2RlOWRjZmZkYg.bin';
let audio_url = 'https://fsb.zobj.net/download/bSCIjtRQgjq9_Y6tM5IdFilYEp18rUjolRsAWyFRQ54YLXrhcs8YkPqexUvo6-8y_FSaAVLZTBAxgRJyfyJmkHU_XtboIwuG6xprhiQl9xn2FXkpi41Y0DUq7nNU/?a=web&c=72&f=small_town_boy.mp3&special=1617478235-s9coL3BX6o9WBKgaxaZf6upK89ytW4oVqSGzPyFIsZY%3D';
let audio = new Audio(audio_url);
document.getElementsByClassName('msg-thread')[0].addEventListener("DOMSubtreeModified", function() {
if( typeof play_audio_trigger !== 'undefined'){
clearTimeout(play_audio_trigger);
}
play_audio_trigger = setTimeout(function(){
play_audo();
@im-noob
im-noob / gist:4a884b777712669c8a9fc191c4760ee9
Created April 3, 2021 18:45 — forked from alecperkins/gist:3889507
Detect any XMLHttpRequests
// From: http://stackoverflow.com/questions/3596583/javascript-detect-an-ajax-event
var s_ajaxListener = new Object();
s_ajaxListener.tempOpen = XMLHttpRequest.prototype.open;
s_ajaxListener.tempSend = XMLHttpRequest.prototype.send;
s_ajaxListener.callback = function () {
// this.method :the ajax method used
// this.url :the url of the requested script (including query string, if any) (urlencoded)
// this.data :the data sent, if any ex: foo=bar&a=b (urlencoded)
console.log(this.method);
@im-noob
im-noob / WeatherJavaScriptByLatLong.js
Created April 1, 2021 12:05
Weather Java Script By Lat Long
<script>
$(function () {
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(fetchPosition);
} else {
$('.wether-section').hide();
console.log("Geolocation is not supported by this browser.");
}
}