Skip to content

Instantly share code, notes, and snippets.

View samlovescoding's full-sized avatar
🔮
Building

Sampan Verma samlovescoding

🔮
Building
View GitHub Profile
@samlovescoding
samlovescoding / extensions.sh
Created April 30, 2024 05:06
Mac VSCode Setup
code --install-extension aaron-bond.better-comments
code --install-extension adrianwilczynski.alpine-js-intellisense
code --install-extension ahmadawais.shades-of-purple
code --install-extension alexcvzz.vscode-sqlite
code --install-extension antfu.browse-lite
code --install-extension antfu.vite
code --install-extension bmewburn.vscode-intelephense-client
code --install-extension bradlc.vscode-tailwindcss
code --install-extension christian-kohler.path-intellisense
code --install-extension dart-code.dart-code

https://stackoverflow.com/questions/8652948/using-port-number-in-windows-host-file

I managed to achieve this by using Windows builtin networking tool netsh.

As Mat points out: The hosts file is for hostname resolution only, so a combination of the two did the trick for me. Example Overview

example.app:80 | <--Link by Hosts File

@samlovescoding
samlovescoding / what-forces-layout.md
Created February 19, 2024 14:08 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
630
10895
11224
567
11848
521
426
10882
2576
11571
@samlovescoding
samlovescoding / ll_of_array.cpp
Created November 30, 2019 11:02
Linked List of Array
#include <iostream>
#define ARRMAX 100
using namespace std;
class LinkedList{
private:
struct node{
int info[ARRMAX];
node* next;
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+n",
"command": "explorer.newFile"
},
{
"key": "ctrl+shift+n",
"command": "explorer.newFolder"
},
@samlovescoding
samlovescoding / extensions.bat
Last active January 12, 2021 18:36
Visual Studio Code Settings
code --install-extension anseki.vscode-color
code --install-extension bierner.color-info
code --install-extension bmewburn.vscode-intelephense-client
code --install-extension burkeholland.simple-react-snippets
code --install-extension dbaeumer.vscode-eslint
code --install-extension DigitalBrainstem.javascript-ejs-support
code --install-extension dracula-theme.theme-dracula
code --install-extension esbenp.prettier-vscode
code --install-extension formulahendry.auto-close-tag
code --install-extension formulahendry.auto-rename-tag
@samlovescoding
samlovescoding / lamp-stack.sh
Created August 9, 2020 00:44
Actually working Linux setup for PHP and MySQL.
# Update your system and its repositories
sudo apt-get update
sudo apt-get upgrade
# Install Apache Server
sudo apt-get install apache2
# Install MySQL Server
sudo apt-get install mysql-server
mysql_secure_installation
@samlovescoding
samlovescoding / package.json
Created June 27, 2020 06:15
Webpack for Electron and Vue
{
"name": "webpack-electron-vue",
"version": "1.0.0",
"description": "Boilerplate for Webpack Electron Vue App",
"main": "index.js",
"scripts": {
"start": "npm run build && npm run serve",
"build": "webpack --config webpack.config.js",
"watch": "webpack --config webpack.config.js --watch",
"serve": "electron ."
@samlovescoding
samlovescoding / pytor.py
Created May 31, 2020 01:43
Request Session with Tor
import requests
from stem import Signal
from stem.control import Controller
def get_tor_session():
session = requests.session()
session.proxies = {'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050'}
return session