Skip to content

Instantly share code, notes, and snippets.

View RaghulXander's full-sized avatar
💡
Updating...

Xander Luhgar RaghulXander

💡
Updating...
View GitHub Profile
!function(e,t,s,n,r,o,a,i,l,c,d,u,m,p){"use strict";function h(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var x=h(l);const f=()=>e.jsx(n.Helmet,{children:e.jsx("script",{type:"module",src:"https://ajax.googleapis.com/ajax/libs/model-viewer/3.0.1/model-viewer.min.js"})}),g=({withAr:t,url:s})=>e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsx("div",{id:"google-model-viewer",className:"h-screen w-full",children:e.jsx("model-viewer",{class:"w-full h-[70vh]",src:s,"ios-src":"",poster:"7",alt:"A 3D model of an astronaut","shadow-intensity":"1","camera-controls":!0,"auto-rotate":!0,ar:t})})]}),j=()=>{const[s,n]=t.useState("sunset");return t.useTransition(),e.jsx(c.Environment,{preset:s,background:!0,blur:.65})};function v(...e){return u.twMerge(d.clsx(e))}const b=t=>{const{progress:s=0,size:n=120,stokeSize:r=12,progre
@RaghulXander
RaghulXander / promises.js
Created January 29, 2024 07:00
Custom Promises
const STATE = {
PENDING: 'pending',
SUCCESS: 'fulfilled',
REJECTED: 'rejected'
}
class MyPromise {
#value = null;
#state = STATE.PENDING;
#successCallbacks = [];
#rejectedCallbacks = [];
@RaghulXander
RaghulXander / detect_adblockers.js
Created January 28, 2024 18:03
A function to detect any ad blockers are present
const adBlockerList = [
{
name: 'uBlock',
property: 'ublock',
className: 'uBlockOrigin',
},
{
name: 'Adblock Plus',
property: 'adblockplus',
className: 'adblockplus',
// The idea is remove the middle letter from from 3 repeated letters (www/bbb). This repeated by two persons and finally the person
// who doesn't have moves loses
// var input = "wwwbbbbwbwbwbwbwbbbwwbbbbwwwww"
// var bobCounter = 0;
// var wiendyCounter = 0;
// var counter = 0;
// let current = counter % 2 === 0 ? 'b' : 'w'
@RaghulXander
RaghulXander / nosleep.sh
Created August 17, 2020 03:35
Completely disable sleep on any Mac
# Useful to prevent Macbooks to go to sleep when closing the lid instead of running tools that requires a Kernel Extension (e.g. InsomniaX) and more
# Before doing anything, save your current configuration using
pmset -g
# To disable sleep
sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;
# And to go back to normal
sudo pmset -a sleep 1; sudo pmset -a hibernatemode [original hibernatemode value]; sudo pmset -a disablesleep 0;
@RaghulXander
RaghulXander / raspberry_setup.md
Last active June 19, 2020 03:25
Fresh Setup Raspberry

Raspberry Setup

NOTE: Minimum 16GB will be required for better performance

  1. Download Raspberry Image from raspberrypi.org (Its around 1.5 to 2.5GB) and unzip it (Now it will be ~7.5GB)

  2. Use Etcher or terminal to flash SD card.

  3. For headless connection we might need to add plain empty SSH file and wpa_supplicant.conf

  4. wpa_supplicant.conf should have following contents

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;