Skip to content

Instantly share code, notes, and snippets.

View vi4hu's full-sized avatar
☀️
Praise the Sun

Ashutosh Yadav vi4hu

☀️
Praise the Sun
View GitHub Profile
@vi4hu
vi4hu / npmtoyarn.md
Last active April 20, 2023 07:18
Migrate from npm to yarn

Migrating your node project from using npm to yarn

  1. Install yarn with npm globally
npm i -g yarn
  1. Run yarn in project's root dir

It will create a yarn.lock file, be patient.

yarn
@vi4hu
vi4hu / updatepat.md
Last active June 3, 2023 18:25
How to reset you github Personal Acess Token (PAT) in linux terminal

if you are doing first time with this method

The most simple and working solution i was able to find is removing the config file itself, git will generate it again so its fast and simple.

don't push till the very end.

rm ~/.gitconfig

Note: after doing this git will forget about your username and email so, run this command.

git will prompt this on your first fresh commit anyway, but don't forget to do this. the relation between you signed commit(via email) to account is very important.

@vi4hu
vi4hu / sassguide.md
Last active April 13, 2023 18:43
dart sass guide

Using Dart Sass with node and normally

If previously Installed

Checking if its dart sass or not

sass -v # output should not be Ruby sass
# Note: npm dart-sass is now sass

Unstalling if its Ruby Sass

sudo apt-get remove sass
@vi4hu
vi4hu / pytoc.md
Created May 27, 2021 12:30
Convert and Compile python in c via cython

steps:

  1. convert .py to .pyx
  2. use cython to convert .pyx to .c
  3. compile .c
  4. Test run

example python file:

script.py
@vi4hu
vi4hu / settings.py
Last active June 28, 2022 12:13
Security checks before deploying any django application
# you can check all the security checks by running
# python manage.py check --deploy
# set debug to false
DEBUG = false #True by default
# set allowed host
ALLOWED_HOSTS = ["your website url"] # you can only access the application via these hosts
# A tuple representing a HTTP header/value combination that signifies a request is secure. This controls the behavior of the request object’s is_secure() method.