Skip to content

Instantly share code, notes, and snippets.

View lalitmee's full-sized avatar
👨‍💻
Unmarshalling

Lalit Kumar lalitmee

👨‍💻
Unmarshalling
View GitHub Profile
@lalitmee
lalitmee / lsp.lua
Created March 28, 2021 00:41
lsp config
vim.lsp.set_log_level('debug')
USER = vim.fn.expand('$USER')
local lsp_config = require('lspconfig')
local lsp_status = require('lsp-status')
local buf_map = require('lk.utils').buf_map
local telescope_mapper = require('lk.plugins.telescope.mappings')
require('lk.lsp.handlers')
-- require('lk.lsp.commands')
@lalitmee
lalitmee / coc-settings.json
Created March 9, 2021 17:35
settings for coc.nvim
{
"javascript.suggestionActions.enabled": false,
"python.jediEnabled": false,
"coc.preferences.formatOnSaveFiletypes": [
"css",
"graphql",
"graphql",
"html",
"javascript",
"javascript",
@lalitmee
lalitmee / unload.jsx
Created October 26, 2020 04:48
Before Unload event in React.js
useEffect(() => {
window.addEventListener('beforeunload', setCountDownTimeToLocalStorage);
return () => {
window.removeEventListener(
'beforeunload',
setCountDownTimeToLocalStorage,
);
};
}, []);
@lalitmee
lalitmee / react-es6-flow-emacs-configuration.md
Created October 7, 2020 16:36 — forked from CodyReichert/react-es6-flow-emacs-configuration.md
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

window.addEventListener("load", loadFunction, false);
function loadFunction(evt) {
var jsInitChecktimer = setInterval(checkForFullPageLoad, 111);
function checkForFullPageLoad() {
const notebookNamesEl = document.getElementById("notebook-names");
if (notebookNamesEl) {
const children = notebookNamesEl.children;
if (children.length >= 2) {
const isolateDiv = document.getElementsByClassName("ng-isolate-scope");
@lalitmee
lalitmee / error.md
Created September 4, 2019 07:08
Ulauncher error

Message: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)> Error Name: UnhandledError Type: URLError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3.6/urllib/request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
➜  ~ sudo lshw -C video
[sudo] password for lalit: 
  *-display                 
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
@lalitmee
lalitmee / update.sh
Created August 14, 2019 06:40
AppImageLauncher interpreter
python3.6 (enabled):
package = python3.6
type = magic
offset = 0
magic = \x33\x0d\x0d\x0a
mask =
interpreter = /usr/bin/python3.6
detector =
llvm-6.0-runtime.binfmt (enabled):
@lalitmee
lalitmee / hyper.sh
Created August 10, 2019 19:07
Terminal Error on new login
/usr/share/autojump/autojump.zsh:49: defining function based on alias `zz'
/usr/share/autojump/autojump.zsh:49: parse error near `()'
@lalitmee
lalitmee / .csscomb.json
Last active January 18, 2019 15:49
Default configuration for csscomb. This is best because I like it. These are my preferences. http://csscomb.com/config
{
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
"sort-order-fallback": "abc",