Skip to content

Instantly share code, notes, and snippets.

View ponnamkarthik's full-sized avatar

Karthik Ponnam ponnamkarthik

View GitHub Profile
# To convert csr or crt file
openssl x509 -in key.crt -out key.pem
# To convert private key to pem file
openssl rsa -in ./private.key -text > private.key.pem
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: const CircleInsideCircle()));
}
class CircleInsideCircle extends StatefulWidget {
const CircleInsideCircle({Key? key}) : super(key: key);
void _openCheckout() {
var options = {
'key': 'YOUR_RAZORPAY_API_KEY',
'amount': 2000,
'name': 'Example Store',
'description': 'Payment for your order',
'prefill': {'contact': '9876543210', 'email': '[email protected]'},
};
try {
razorpay.open(options);
// Import Razory Pay Dependencies
import 'package:razorpay_flutter/razorpay_flutter.dart';
// Create a Razorpay instance
Razorpay razorpay = Razorpay();
@override
void initState() {
super.initState();
// Attach Listeners for Payment Events
@ponnamkarthik
ponnamkarthik / maximum-depth-of-binary-tree-bfs.py
Created August 5, 2023 08:42
Maximum Depth of Binary Tree - BFS
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def maxDepth(self, root: Optional[TreeNode]) -> int:
if not root:
return 0
@ponnamkarthik
ponnamkarthik / maximum-depth-of--binary-tree-recursion.py
Created August 5, 2023 08:31
Maximum Depth of Binary Tree - Recursion
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def maxDepth(self, root: Optional[TreeNode]) -> int:
if not root:
return 0
@ponnamkarthik
ponnamkarthik / symmetric_tree_leetcode.py
Created August 5, 2023 08:11
Symmetric Tree - LeetCode 101 (Easy)
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isSymmetric(self, root: Optional[TreeNode]) -> bool:
# Base case for root if it is None then we just simply return true
if not root:
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
import 'dart:async';
import 'dart:ui';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:shader_demo/shader_painter.dart';
class ShaderHomeImageBlur extends StatefulWidget {
const ShaderHomeImageBlur({super.key});
class ShaderHomePage extends StatefulWidget {
const ShaderHomePage({super.key});
@override
State<ShaderHomePage> createState() => _ShaderHomePageState();
}
class _ShaderHomePageState extends State<ShaderHomePage> {
late Timer timer;
double delta = 0;