Skip to content

Instantly share code, notes, and snippets.

Working from home

Arup Rakshit aruprakshit

Working from home
View GitHub Profile
View vim
" snippets
Plug 'SirVer/ultisnips'
Plug 'atefth/ruby-on-rails-snippets-vs-code'
Plug 'abusaidm/html-snippets'
Plug 'wvffle/vimterm'
Plug 'mtdl9/vim-log-highlighting'
Plug 'vim-ruby/vim-ruby'
Plug 'joker1007/vim-ruby-heredoc-syntax'
Plug 'chase/vim-ansible-yaml'

Everything I Know About UI Routing


  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
View App.Combobox.js
/* eslint-disable jsx-a11y/accessible-emoji */
import React, { Suspense, useState } from "react";
import { unstable_scheduleCallback } from "scheduler";
import { unstable_createResource as createResource } from "react-cache";
import {
azer / fake-chat.elm
Created May 21, 2018
Elm Ports Example
View fake-chat.elm
port module FakeChat exposing (..)
import Html exposing (Html, div, input, text, button, ul, li)
import Html.Events exposing (onClick, onInput)
import Html.Attributes exposing (type_, placeholder, value)
main =
{ view = view
robertgonzales / Frame.js
Created Dec 12, 2017
Use React portals to render inside shadow dom and iframes
View Frame.js
class Frame extends Component {
componentDidMount() {
this.iframeHead = this.node.contentDocument.head
this.iframeRoot = this.node.contentDocument.body
render() {
const { children, head, } = this.props
return (
heygrady /
Last active Jul 19, 2021
Redux containers: mapDispatchToProps

Redux containers: mapDispatchToProps

This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.

kyledcline /
Last active Nov 28, 2021
Postgres Best Practices


Psql is a fully-fledged CLI client for Postgres, but most people are unaware of its many advanced features.

~/.psqlrc can be edited to persist any behavior or configuration settings you want between psql sessions. It behaves just like ~/.bashrc or ~/.vimrc, sourced at psql launch. See More out of psql for some interesting configurations.

If you have a long query to write and rewrite, you can use \e to edit your query in an editor.

Use \watch at the end of a query in order to automatically re-run the query every few seconds - great for monitoring while making changes elsewhere in your application architecture.


React && Firebase Workshop

Contact Information

Prequisite Setup

  • A recent version of Node.js
  • npm install -g create-react-app