Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Gitting it done (from 🏡)

Vinayak Kulkarni vinayakkulkarni

:octocat:
Gitting it done (from 🏡)
View GitHub Profile
@vinayakkulkarni
vinayakkulkarni / csv.worker.ts
Created Sep 14, 2021
CSV to GeoJSON Parser in Web Worker
View csv.worker.ts
import { csvParse } from 'd3-dsv';
import { Feature, FeatureCollection, Point } from 'geojson';
function snooze(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
addEventListener('message', async (event: MessageEvent) => {
const { payload, sleep } = event.data.message;
await snooze(sleep);
View profile.vue
<script lang="ts">
import { useProfile } from '@/hooks/profile';
import { useContext } from '@nuxtjs/composition-api';
export default defineComponent({
setup() {
const { $axios } = useContext();
const { getUser, profile } = useProfile($axios);
return { profile };
}
})
@vinayakkulkarni
vinayakkulkarni / setup.md
Created Jun 9, 2020
Mounting NVMe EBS for AWS EC2 Nitro Instances
View setup.md

Ensure you have the ebs attached.

$ lsblk

Once you find the blk id, create xfs type filesystem

$ sudo mkfs -t xfs /dev/nvme1n1
View test.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vinayakkulkarni
vinayakkulkarni / SSL.md
Created Apr 28, 2020 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert
View SSL.md

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
View keybase.md

Keybase proof

I hereby claim:

  • I am vinayakkulkarni on github.
  • I am vinayak (https://keybase.io/vinayak) on keybase.
  • I have a public key ASCxgMkTIndvwScAt_z3yUKxx2JAbkCpJoWNOx2ft4W_Ogo

To claim this, I am signing this object:

View test.json
This file has been truncated, but you can view the full file.
[
{ "seq": 1, "name_first": "Christopher", "name_last": "Rivera", "age": 58, "street": "Rahop Park", "city": "Ozuaruavi", "state": "GA", "zip": 69322, "dollar": "$4192.07", "pick": "WHITE", "date": "07/23/2032", "seq_1": 1, "name_first_1": "Clarence", "name_last_1": "Webb", "age_1": 56, "street_1": "Vorbo Extension", "city_1": "Ahiireni", "state_1": "UT", "zip_1": 61595, "dollar_1": "$4936.89", "pick_1": "WHITE", "date_1": "05/20/1938" },
{ "seq": 2, "name_first": "Ray", "name_last": "Barker", "age": 34, "street": "Peuk View", "city": "Kaebpi", "state": "OR", "zip": 13622, "dollar": "$1073.74", "pick": "YELLOW", "date": "08/26/2042", "seq_1": 2, "name_first_1": "Agnes", "name_last_1": "Cox", "age_1": 42, "street_1": "Ejehe Plaza", "city_1": "Batizku", "state_1": "NE", "zip_1": 5831, "dollar_1": "$7897.86", "pick_1": "RED", "date_1": "11/24/2047" },
@vinayakkulkarni
vinayakkulkarni / example.py
Created Jan 23, 2019 — forked from Lukasa/example.py
Requests and Beautiful Soup example, following the form of http://bpaste.net/show/kMetvCdrfnzh5RgiUKU4/
View example.py
from BeautifulSoup import BeautifulSoup
import requests
import urlparse
URL = 'example.com'
s = requests.Session()
def fetch(url, data=None):
if data is None:
return s.get(url).content
View axios-error-handling.js
class Api {
constructor() {}
call(requestType, url, data = null) {
return new Promise((resolve, reject) => {
axios[requestType](url, data)
.then((response) => {
resolve(response);
})
.catch(({ response, request, message }) => {
View safari-ripper.html
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA