Skip to content

Instantly share code, notes, and snippets.

View dhruvilp's full-sized avatar
💭
👨‍💻 working on something really cool

Dhruvil Patel dhruvilp

💭
👨‍💻 working on something really cool
View GitHub Profile
@dhruvilp
dhruvilp / main.dart
Created November 22, 2022 23:02
Dart JSON Pretty print
import 'dart:convert';
void main(List<String> arguments) async {
final jsonResponse = jsonDecode(
"JSON");
// final data = jsonResponse["sid_01"];
JsonEncoder encoder = JsonEncoder.withIndent(' ');
String prettyprint = encoder.convert(jsonResponse);
print(prettyprint);
@dhruvilp
dhruvilp / main.dart
Created October 22, 2022 04:17
Flutter: Custom Tab Bar Widget
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const String _title = 'Flutter Code Sample';
@override
@dhruvilp
dhruvilp / notes.md
Created July 25, 2022 15:14
System Design 101

Fundamentals of System Design

  • Introduction to System Design
  • The System Design Interview
  • How to Answer System Design Questions
  • System Design Principles
  • How to Answer Web Protocol Questions in a System Design Interview
  • How to Cover Load Balancing in a System Design Interview
  • How to Answer Questions About CDNs in a System Design Interview
  • How to Answer Questions About APIs in System Design Interviews
@dhruvilp
dhruvilp / attachment-retrieval.py
Last active July 22, 2022 22:16
retrieving-attachments-from-exchange-mailbox-using-python
# source: https://www.moh10ly.com/retrieving-attachments-from-exchange-mailbox-using-python/
from exchangelib import DELEGATE, IMPERSONATION, Account, Credentials, EWSDateTime, EWSTimeZone, Configuration, NTLM, GSSAPI, CalendarItem, Message, Mailbox, Attendee, Q, ExtendedProperty, FileAttachment, ItemAttachment, HTMLBody, Build, Version, FolderCollection
credentials = Credentials(username='moh10ly\info', password='PWD')
ews_url = 'https://mail.moh10ly.com/EWS/exchange.asmx'
ews_auth_type = 'NTLM'
@dhruvilp
dhruvilp / notes.md
Last active June 30, 2022 21:25
Blockchain Learning Guide

Topics:

Foundations of Blockchain

Much of the use of blockchain is tied to the concept of “stores of value.” Thus it is important to understand the history and context of monetary instruments, fiat currency, and the innovation that blockchain brings as a store of value and a tool for a broad range of business applications. Learn how to explain the origin and workings of blockchain technology.

Transacting on the Blockchain

One of the most prolific and public applications of blockchain technology is to cryptocurrencies. As such, it is important to understand how cryptocurrencies work and when it is appropriate to use them. Understand the key elements of blockchain technology and how to apply it across business models. Learn how to explain the value of “alternative” stores of value such as cryptocurrencies.

Solving Problems with Blockchain

Understand when to apply blockchain technology, and just as importantly, when blockchain does not add value. Learn about distributed ledger technology, Bit

@dhruvilp
dhruvilp / main.dart
Last active May 12, 2022 12:55
Flutter Workshop Demo
// Get more Flutter packages and plugins at https://pub.dev
import 'package:flutter/material.dart'; // Material UI widgets
import 'package:http/http.dart' as http; // http package
import 'dart:convert'; // json handler package
import 'defaults.dart'; // default strings and constants
// =============================================================================
// FILE: weather_model.dart
// =============================================================================
@dhruvilp
dhruvilp / dart_vul.txt
Created March 16, 2022 16:56
Dart/Flutter Vulnerabilities Management
1. Github Security Advisories: https://github.com/dart-lang/sdk/security/advisories
2. CVE.report: https://cve.report/software/dart/dart_software_development_kit
Android/iOS Scanning:
1. https://github.com/MobSF/Mobile-Security-Framework-MobSF
@dhruvilp
dhruvilp / words.txt
Created January 27, 2022 21:38
Skribbl custom words
Back seat, Highchair, Rock band, Birthday, Hockey, Sasquatch, Black hole, Hotel, Scrambled eggs, Blizzard, Jump rope, Seat belt, Burrito, Koala, Skip, Captain, Solar eclipse, Chandelier, Light, Space, Crib, Mask, Stethoscope, Cruise ship, Mechanic, Stork, Dance, Mom, Sunburn, Deodorant, Mr Potato Head, Thread, Facebook, Pantyhose, Tourist, Paper plate, United States, Frame, Photo, WiFi, Full moon, Pilgrim, Zombie, Game, Pirate,Brain, Kitten, Playground, Bubble bath, Kiwi,Pumpkin pie, Buckle, Lipstick, Raindrop, Bus, Lobster ,Robot, Car, Lollipop, Sand castle, Castle, Magnet, Slipper, Chain saw, Megaphone, Snowball ,Circus tent, Mermaid, Sprinkler ,Computer, Minivan, Statue of Liberty, Crib ,Mount Rushmore ,Tadpole, Dragon, Music ,Teepee ,Dumbbell ,North pole, Telescope, Train, Ferris wheel ,Owl ,Tricycle, Flag ,Pacifier, Piano,Angry, Fireworks, Pumpkin ,Baby ,Flower ,Rainbow ,Beard, Flying saucer ,Recycle ,Bible, Giraffe ,Sand castle ,Bikini ,Glasses ,Snowflake, Book ,High heel, Stairs, Bucket ,Ice cream cone
@dhruvilp
dhruvilp / useKeyPress.js
Created January 26, 2022 20:45
useKeyPress React Hook
import React from "react";
import { useState, useEffect } from "react";
// Usage
export default function App() {
// Call our hook for each key that we'd like to monitor
const happyPress = useKeyPress("h");
const sadPress = useKeyPress("s");
const robotPress = useKeyPress("r");
const foxPress = useKeyPress("f");
const enterPress = useKeyPress("Enter");
@dhruvilp
dhruvilp / react_hook_interval.js
Created January 24, 2022 16:17
React Hook Interval
import {useEffect} from 'react';
export default function useIntervalHook(minutes = 5) {
const interval = minutes * 60 * 1000;
function refresh(){
fetch('/api/**', {mode: 'no-cors', credentials: 'include'})
.catch(error => {
console.log(`There was a problem... ${error.message}`);
});