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 / 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.");
}
}
@im-noob
im-noob / first_url_from_google.py
Created March 27, 2021 18:34
Find First Url from Google Search
import requests
from bs4 import BeautifulSoup
import time
search = input('Search: ')
searched_url = 'https://www.google.com/search?q='+search.replace(' ','+')
# googling
page = requests.get(searched_url)
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>The page you were looking for doesn't exist (404)</title>
<meta name="robots" content="noindex">
<style type="text/css">
body {
background:#fafafa;
font-family: 'Open Sans', sans-serif;
font-weight:300;
color:#979997;
@im-noob
im-noob / redirection.php
Created March 5, 2021 23:58
Redirection in php
# index.php
<?php
$REQUEST_URI = $_SERVER['REQUEST_URI'];
$REQUEST_URI_split = explode('/',$REQUEST_URI);
$SCRIPT_NAME = $_SERVER['SCRIPT_NAME'];
$SCRIPT_NAME_split = explode('/',$SCRIPT_NAME);
$intersection_length = count(array_intersect($REQUEST_URI_split,$SCRIPT_NAME_split));
let certificate_search_ele = $('#certificate-search');
let certificate_list_text_ele = $('.certificate-list-text');
let certificate_category_ele = $('#certificate_category');
function applyFilters() {
/*Search Filter */
let value = certificate_search_ele.val().toLowerCase();
certificate_list_text_ele.filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
@im-noob
im-noob / DataTableBackend.php
Created February 12, 2021 13:33
DataTableBackend.php
$data = User::all();
$dataTable = DataTables::collection($data)
->editColumn('check_box', static function ($value) {
return '<td>
<div class="checkbox">
<input type="checkbox" name="check" value="checkbox" class="row-check-box-active-table">
<label for="checkbox"></label>
</div>
</td>';
})->editColumn('profile_pic_and_name', static function ($value) {
@im-noob
im-noob / DataTableLaravel.js
Last active February 12, 2021 13:45
Data Table Laravel snips
$(function () {
let data_table = $('#data-table');
let data_table_object = null;
fetch_data()
function fetch_data() {
if (data_table_object != null) {
data_table_object.destroy();
}
data_table_object = data_table.DataTable({
@im-noob
im-noob / password_guess.py
Created February 7, 2021 15:01
Password Guessing Technique in python algo
from itertools import permutations
password = [
'rahul',
'kumar',
'rina',
'kumari',
'2001',
'2001',
'loves'
#!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().system('python -m pip install dask[dataframe] --upgrade')
get_ipython().system('python -m pip install Flask')