Skip to content

Instantly share code, notes, and snippets.

View retronav's full-sized avatar

Pranav Karawale retronav

View GitHub Profile
@retronav
retronav / sway.nix
Created September 17, 2022 08:53
Sway config from nixos
{ config, pkgs, lib, ... }:
let
# bash script to let dbus know about important env variables and
# propogate them to relevent services run at the end of sway config
# see
# https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist
# note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts
# some user services to make sure they have the correct environment variables
dbus-sway-environment = pkgs.writeTextFile {
@retronav
retronav / keybase.md
Last active March 26, 2022 07:24
keybase.md

Keybase proof

I hereby claim:

  • I am retronav on github.
  • I am retronav (https://keybase.io/retronav) on keybase.
  • I have a public key ASCeZoxsx5srKD_iFvZLHaLt6fKyaMIHEmM6v9iwj-DkKwo

To claim this, I am signing this object:

@retronav
retronav / fixViteAsset.mjs
Last active May 10, 2022 14:01
Script to fix __VITE_ASSET__ names in CSS output
/**
* Copyright 2022 Pranav Karawale
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@retronav
retronav / mysql_install_instructions.md
Created August 23, 2021 08:52
Install MySQL on Ubuntu 20.04 LTS (WSL2)

This method works for me. Use-cases for MySQL for me are:

  1. Connecting to it via Python
  2. Normal CRUD operations

I AM NO MYSQL EXPERT, BUT I WOULD RECOMMEND TO DO THIS ONLY ON YOUR LOCAL SYSTEM. DON'T DO THIS ON A SERVER. I'D NOT BE RESPONSIBLE FOR THE MESS YOU'VE CREATED.

  1. Install it
sudo apt install mysql-server
sudo service mysql start
@retronav
retronav / esbuild-dev.ts
Created November 12, 2020 14:25
Watch and build code with esbuild
import { startService } from "esbuild";
import { watch } from "chokidar";
const noop = () => {};
/**
* Function to update lines when something happens
* @param input The text you want to print
* @param isBuiltInput Whether you are printing `Built in x ms` or not
*/
@retronav
retronav / teddytags-different-env.md
Last active May 10, 2020 09:39
Using TeddyTags in different enviornments

Using TeddyTags in different enviornments

TeddyTags can be used in any browser compatible with ES5+ features. Here is a small example targeting ES5 and ES6 enviornments:

  • ES5
    //# ES5 implementation of a class
    var App = function(props) {
      Component.call(props)
      this.props = props;
    };
    App.prototype.render = function (){
@retronav
retronav / .teddy-dom-manipulation.md
Last active May 10, 2020 09:22
DOM manipulation problem while using TeddyTags

The Problem

If you are having problems with DOM manipulation, simply add all your DOM manipulation scripts as well as the TeddyTags declaration script with the defer attribute.

Working example with files attached.