Skip to content

Instantly share code, notes, and snippets.

View geekykant's full-sized avatar

Sreekant Shenoy geekykant

View GitHub Profile
/// ytstayactive.js
// ==UserScript==
// @name YouTube - Stay Active and Play Forever
// @namespace q1k
// @version 3.1.1
// @description Tired of Youtube pausing playback asking you to click 'yes' to continue playing? This script will make the popup never appear, music will never stop. Never pause, never inactive, never worry. The script will keep you active and keep playing music FOREVER. Enables playing in background on mobile.
// @author q1k
// ==/UserScript==
Object.defineProperties(document, { /*'hidden': {value: false},*/ 'webkitHidden': {value: false}, 'visibilityState': {value: 'visible'}, 'webkitVisibilityState': {value: 'visible'} });
setInterval(function(){
@geekykant
geekykant / LazyHorizontalGrid.kt
Last active July 21, 2021 18:03
Jetpack Compose Horizontal Grid Kotlin
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
@ExperimentalFoundationApi
@Composable
fun LazyHorizontalGrid(
@geekykant
geekykant / docker_commands.md
Created May 17, 2021 06:11
Docker Commands

Docker Cheat Sheet

Access Docker VM Volume files (MacOS)

docker run --rm -it --privileged --pid=host justincormack/nsenter1
@geekykant
geekykant / repo-reset.md
Created October 11, 2020 05:15 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@geekykant
geekykant / proxy_generate.js
Created October 8, 2020 14:23
Generate Proxy using SSLProxies.org
function proxyGenerator() {
let ip_addresses = [];
let port_numbers = [];
return axios
.get("https://sslproxies.org/")
.then((response) => {
if (response.status == 200) {
let $ = cheerio.load(response.data);
@geekykant
geekykant / js-quick-codes.md
Last active October 4, 2020 16:06
JavaScript 💫 - QUICK Codes!

Exception Handling

function makePizza(toppings = []) {
  return new Promise((resolve, reject) => {
    if (toppings.includes("apple")) {
      reject("Sorry apple not available 🍎");
    }

    ms = 1500 + 500 * toppings.length;
@geekykant
geekykant / nginx_cloudflare.conf
Created May 19, 2020 11:33
Cloudflare + Nginx (DigitalOcean Setup)
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl; #Make sure to set SSL to (Strict) in Clouflare menu
root /var/www/html;
index index.php;
server_name example.com www.example.com;
/*
Group 4 (10,12,14,16)
A publishing company markets both book and CD versions of its works. Create a class
publication that stores the title ( type char *) and price (type float) of publication. From this
class derive two classes: book, which adds a page count (type int); and CD, which adds size
(type int). Each of these three classes should have a getdata() function to get its data from the
user, and a putdata() function to display its data.
/*
Group 12 (42,44,46,48)
Create a class called CDriver that contains:
■ Data members for the name(tvpe char*) and age(tvpe int);
■ A constructor function that is used to intialize age and then allocates space on the heap for
the name;
■ A copy constructor function;
■ A print( ) function that displays the name and age;
#include<iostream>
using namespace std;
int a,b,c;
int not_odd(){
a = (a+b)/2;
b = (b+c)/2;
c = (c+a)/2;