Skip to content

Instantly share code, notes, and snippets.

View shahidcodes's full-sized avatar

Shahid Kamal shahidcodes

View GitHub Profile
@shahidcodes
shahidcodes / Caddyfile
Last active December 5, 2023 05:26
Deploy react spa on caddy, Caddy file
shahid.codes {
try_files {path} /
encode gzip
root * /usr/share/caddy
file_server
}
@shahidcodes
shahidcodes / BreakpointDebug.tsx
Created July 5, 2021 04:28
Tailwind Breakpoint Debug
import React from 'react';
export const BreakpointDebug: React.FC<{}> = () => {
return (
<div className="bg-white rounded-full flex items-center justify-center p-2 px-3">
<div className="sm:hidden md:hidden lg:hidden">sm</div>
<div className="hidden sm:block md:hidden lg:hidden">md</div>
<div className="hidden sm:hidden md:block lg:hidden">lg</div>
<div className="hidden sm:hidden md:hidden lg:block">lg+</div>
</div>
@shahidcodes
shahidcodes / main.js
Last active October 12, 2019 13:45
Find Minimum Occurance Of A String In String With No Repeated Letters
const find = (str, char)=>{
let indexes = []
for(let i=0; i<str.length; i++){
// console.log(str.charAt(0) + "==" + char)
if(str.charAt(i) == char){
indexes.push(i);
}
}
@shahidcodes
shahidcodes / index.html
Created July 29, 2019 04:26
JS Bin twitter-comment // source https://jsbin.com/tovetiv
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="twitter-comment">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="media">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdn.rawgit.com/Marak/faker.js/master/examples/browser/js/faker.js"></script>
</head>
<body>
@shahidcodes
shahidcodes / instruction.txt
Created April 30, 2019 11:16
windows 10 hidden host (marked as system file) fixed.txt
From a command prompt with administrative access type each of the following commands:
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /G BUILTIN\Users:R
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G "BUILTIN\Power Users:R"
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G BUILTIN\Administrators:F
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G "NT AUTHORITY\SYSTEM:F"
ATTRIB.EXE -S -H +A -R C:\WINDOWS\system32\drivers\etc\hosts
If this doesn't resolve the issue you will need a better program to do it. Download SubInACL from Microsoft. You can work up the syntax for taking ownership or I'll do it if you can't figure it out.
var scrollCount = 0
var btns = [];
let delay = 0
var addConnections = ()=>{
btns.forEach(el=>{
delay += Math.floor(Math.random()*3000);
console.log("btn set to auto click after " + delay + "ms")
setTimeout(()=>{
el.click();
}, delay)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
body {
background-color: #00A6A6;
color: #BBDEF0;
@shahidcodes
shahidcodes / structure-of-tweepy-status-object.json
Created August 4, 2017 19:12
the structure of the Status object of Tweepy
/* json.dumps(StatusObject._json) */
{
"created_at": "Thu Jul 28 00:08:39 +0000 2016",
"in_reply_to_status_id": null,
"id_str": "758454081656467456",
"retweeted": false,
"entities": {
"hashtags": [
{
@shahidcodes
shahidcodes / index.html
Last active July 17, 2017 09:39
CalculatorCalculator using vuejs for freeCodeCamp// source https://jsbin.com/yewirey
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Calculator using vuejs for freeCodeCamp">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.99.0/css/materialize.min.css">
<title>Calculator</title>
<style>