Skip to content

Instantly share code, notes, and snippets.

View SatyaAchanta's full-sized avatar

Satya Achanta SatyaAchanta

  • Ithaka
  • Ann Arbor, MI
View GitHub Profile

brew install neovim

  • Open a file in vim editor using vi <path_to_file_name>

Important Points

  • 4 modes
    • normal mode ~ just move cursor around
    • insert mode ~ can type regular editor
    • visual mode ~ highlighting with cursor
@SatyaAchanta
SatyaAchanta / init.lua
Created January 2, 2024 02:08
My neovim config
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
Kickstart.nvim is *not* a distribution.
Kickstart.nvim is a template for your own configuration.
The goal is that you can read every line of code, top-to-bottom, understand
@SatyaAchanta
SatyaAchanta / MyTestWithWaitFor.test.jsx
Created December 25, 2022 18:35
test without waitFor on multiple API calls
import { render, screen, waitFor } from "@testing-library/react";
import OrderEntry from "../OrderEntry";
import { rest } from "msw";
import { server } from "../../../mocks/server";
test("handles error for scoop and toppings", async () => {
server.resetHandlers(
rest.get("http://localhost:3030/scoops", (req, res, ctx) =>
res(ctx.status(500))
),
@SatyaAchanta
SatyaAchanta / SummaryForm.jsx
Created December 25, 2022 02:08
SummaryForm component
import React, { useState } from "react";
import Form from "react-bootstrap/Form";
import Button from "react-bootstrap/Button";
import OverlayTrigger from "react-bootstrap/OverlayTrigger";
import Popover from "react-bootstrap/Popover";
export default function SummaryForm() {
const [tcChecked, setTcChecked] = useState(false);
const popover = (
@SatyaAchanta
SatyaAchanta / SummaryForm.test.jsx
Created December 25, 2022 02:08
pop over test
test("should display popover message when hovered", async () => {
const user = userEvent.setup();
render(<SummaryForm />);
//popover should start hidden
const noPopoverElement = screen.queryByText(
/no ice cream will actually be delivered/i
);
expect(noPopoverElement).not.toBeInTheDocument();
@SatyaAchanta
SatyaAchanta / appointment_service_test.dart
Created January 2, 2022 00:17
Unit Test Dart + Firestore collection calls
import 'package:fake_cloud_firestore/fake_cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hairstylist_appointment/models/appointment.dart';
import 'package:hairstylist_appointment/services/appointments_service.dart';
import '../common/collection_reference_mock.dart';
import '../firebase_mock.dart';
void main() {
setupFirebaseAuthMocks();
@SatyaAchanta
SatyaAchanta / svgfixer.js
Created December 29, 2017 02:46 — forked from leonderijke/svgfixer.js
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html