Skip to content

Instantly share code, notes, and snippets.

View farhancdr's full-sized avatar
🎯
Focusing

Farhan Sadek farhancdr

🎯
Focusing
View GitHub Profile
@farhancdr
farhancdr / useLocalStorage.js
Last active August 20, 2022 17:01
useLocalStorage hook for react
import { useEffect, useState } from 'react'
const PREFIX = 'app-name-'
export default function useLocalStorage(key, initialValue) {
const prefixedKey = PREFIX + key
const [value, setValue] = useState(() => {
const jsonValue = localStorage.getItem(prefixedKey)
if (jsonValue != null) return JSON.parse(jsonValue)
if (typeof initialValue === 'function') {
// add this to test in your login route.
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("token", jsonData.token.accessToken);
// change the 'jsonData.token.accessToken' according to your response body.
/*
============================
============================
*/
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
import requests
import re
import random
url = "http://earn500.fun/m_data.php"
s = """SumonKabirNazmulArafatAkbarSajjadSohailKosikBibaJarifM
irjaRabeyaSlmanSabiqRubiyaNusratNahidHasanSirazamnMuniraswanS
omanjanBigyaniAnikhAriteshPrJahanaraKanizMirjaHasnaInzamaulSh
arminTaziaAfrinShornaSabrinaTaimurRizwanIpshitaTasnimSnehaNazi
nMaksudaSultanaNilimaawarParvikPuspanshuDebtanuSochinSowmikDi
ptarsikaNoinaSriyamiAtyamajaKoushukiSomdeeptiSairatiRiptyRipt
import requests
import re
import random
url = "http://earn500.fun/m_data.php"
s = """SumonKabirNazmulArafatAkbarSajjadSohailKosikBibaJarifM
irjaRabeyaSlmanSabiqRubiyaNusratNahidHasanSirazamnMuniraswanS
omanjanBigyaniAnikhAriteshPrJahanaraKanizMirjaHasnaInzamaulSh
arminTaziaAfrinShornaSabrinaTaimurRizwanIpshitaTasnimSnehaNazi
nMaksudaSultanaNilimaawarParvikPuspanshuDebtanuSochinSowmikDi
ptarsikaNoinaSriyamiAtyamajaKoushukiSomdeeptiSairatiRiptyRipt
{
"editor.fontFamily": "'Victor Mono', 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontWeight": "600",
"workbench.colorTheme": "Panda Syntax",
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"files.associations": {
"**/templates/*.html": "django-html",
"**/templates/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
//vscode settings sycn
@farhancdr
farhancdr / Unfollow All All Facebook
Last active February 21, 2020 17:39
Unfollow all on facebook at once.
//Go to news feed Preferences then Unfollow Option then Open console...
// paste this code
var unf = document.querySelector('[data-testid ="unfollow"]');
var scr = unf.querySelector(".scrollable");
setInterval(function(){
scr.scrollTop = scr.scrollHeight;
}, 500
);
// ====================================================
@farhancdr
farhancdr / gist:fce1cce3d1b8e9c4996d1d5d7de757c0
Created October 10, 2019 02:28
Click_All_Button_Of_A_WebPage
#a simple way to click all button with specific inner text....
var click_all = ()=> {
[].slice.call(document.querySelectorAll('button')).filter(x=>x.innerText.indexOf('Liked') !=-1).map(x=>{x.click()});
window.scrollTo(0,document.body.scrollHeight);
window.setTimeout(click_all, 3 * 1000)
};
click_all();
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;