Skip to content

Instantly share code, notes, and snippets.

View renjithspace's full-sized avatar
👨‍💻
Research. Design. Build. Test. Ship. Optimize. Repeat.

Renjith renjithspace

👨‍💻
Research. Design. Build. Test. Ship. Optimize. Repeat.
View GitHub Profile
@renjithspace
renjithspace / google-business-review-sort.js
Last active February 5, 2024 05:39
Sort Google Businesses
Array.from(document.querySelectorAll('.Nv2PK'))
.map(b => {
const l = b.querySelector('.hfpxzc')
const t = b.querySelector('.qBF1Pd')
const r = b.querySelector('.UY7F9')
const v = b.querySelector('.MW4etd')
return {
t: t.innerText,
r: r ? Number(r.innerText.replace('(', '').replace(')', '')) : 0,
v: v ? Number(v.innerText.replace('(', '').replace(')', '')) : 0,
@renjithspace
renjithspace / tradingview-import.js
Last active May 27, 2022 03:05
TradingView import tickers to list after successfully exported the screener
function wait (time) {
return new Promise(resolve => setTimeout(resolve, time));
}
async function openAddSymbolWindow () {
const isListOpen = document.querySelector('.is-widgetbar-expanded')
if (!isListOpen) {
document.querySelector('[data-name="base"]').click()
await wait(3000)
}
@renjithspace
renjithspace / tradingview-screener-export.js
Last active March 27, 2022 08:39
TradingView screener sort monthly performance in ascending order export to CSV file and to import
function wait (time) {
return new Promise(resolve => setTimeout(resolve, time));
}
async function sortTickerAscendingMonthlyPerformance() {
document.querySelector('[data-name="screener-field-sets"]').click()
document.querySelector('[data-set="performance"]').click()
await wait(3000)
async function checkAscendingAndSort () {
const oneMonthSortWrap = document.querySelector('[data-field="change.1M"]')
@renjithspace
renjithspace / react-redux-usage.md
Last active August 12, 2020 03:13
React Redux Usage

index.js

Wrap application's root component with redux Provider and set store.

import { Provider } from 'react-redux'
import store from './state/store'
import App from './App'

ReactDOM.render(
  <React.StrictMode>
 
@renjithspace
renjithspace / readme.md
Last active April 13, 2022 00:07
Install Laravel - Ubuntu, Nginx, Let's Encrypt and MySQL

Install Laravel - Ubuntu, Nginx, Let's Encrypt and MySQL

Update

sudo apt update

Install required tools

#Nginx
@renjithspace
renjithspace / readme.md
Last active April 14, 2020 09:10
Enable MySQL Remote Access

Enable MySQL Remote Access

Installation

sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation

Enable remote connection

@renjithspace
renjithspace / readme.md
Last active December 4, 2022 23:06
Laravel Eloquent Relationship Cheatsheet

Laravel Eloquent Relationship Cheatsheet

One To One

One User hasOne one Phone
One Phone belongsTo one User

users
  id
function greet(): string {
return 'Hello world'
}
@renjithspace
renjithspace / Laravel 6x server setup.md
Last active January 14, 2020 04:30
Shell script for Laravel 6x - Ubuntu 18.04 server setup

Download

wget -qO setup.sh https://git.io/JvJoj

Edit and configure

DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
var delay = 4000
setInterval(() => {
console.log('Running')
window.scroll(0, window.scrollY + 200)
document.querySelector('[data-testid="like"]').click()
clearInterval()
}, delay)