Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sudhir Mitharwal sudkumar

🏠
Working from home
View GitHub Profile
@sudkumar
sudkumar / channels.tsx
Last active May 22, 2020
Web-Sockets in ReactJS with PusherJs and Laravel Echo with public and private channels
View channels.tsx
import React, { useEffect, useState, useMemo } from "react"
import Echo from "laravel-echo"
import Pusher from "pusher-js"
/**
* Pusher configuration
*/
const pusherConfig = {
key: '<your_pusher_key_here>',
cluster: '<pusher_cluster>',
@sudkumar
sudkumar / frontmatter.js
Last active May 1, 2020
MDX Remark plugin to handle frontmatter
View frontmatter.js
// helps us in parsing the frontmatter from text content
const matter = require('gray-matter')
// helps us safely stringigy the frontmatter as a json object
const stringifyObject = require('stringify-object')
// helps us in getting the reading time for a given text
const readingTime = require('reading-time')
// please make sure you have installed these dependencies
// before proceeding further, or remove the require statements
// that you don't use
@sudkumar
sudkumar / # neovim - 2018-10-17_20-42-08.txt
Created Oct 17, 2018
neovim on macOS 10.14 - Homebrew build logs
View # neovim - 2018-10-17_20-42-08.txt
Homebrew build logs for neovim on macOS 10.14
Build date: 2018-10-17 20:42:08
@sudkumar
sudkumar / install_tmux_locally.sh
Last active Aug 5, 2020
How to install tmux locally
View install_tmux_locally.sh
#!/bin/bash
# Installing tmux locally
# 1. visit: https://github.com/tmux/tmux
# 2. create a local directory to install tmux
# 3. download depencencies
# 1. libevent
# 1. visit: http://libevent.org/
# 2. download the stable version
# 2. ncurses
View PdfFromAUrlDownloader.py
# import the required stuff
import urllib2
import lxml.html
import urlparse
pdfLinks = []
def getContentType(connection):
meta = connection.info()
return meta.getheader("Content-Type")
View regex.md

Regular Expression

Regular expression are used to match a string or a set of string

General format

/matching_pattern/flags
  • matching_pattern: Any pattern to match with a string
You can’t perform that action at this time.