Skip to content

Instantly share code, notes, and snippets.

@chandu
chandu / td-cc-statement-parser.py
Created January 26, 2025 02:45
TD Credit Card Statement parser using tabula
import datetime
import glob
import os
from datetime import datetime
from pathlib import Path
import pandas as pd
from pikepdf import Pdf
from tabula.io import read_pdf
@chandu
chandu / ajax-ladi.js
Created April 29, 2021 14:41
Ajax Ladi
const generatePromise = (valueGeneratorFn, delay = 1) => {
return new Promise((resolve) => {
setTimeout(() => resolve(valueGeneratorFn()), delay);
});
};
const getFirstDataSetAsync = async (input) => {
return generatePromise(() => input * 1);
};
@chandu
chandu / using_git-svn.md
Created May 7, 2020 18:31 — forked from rickyah/using_git-svn.md
A simple guide to git-svn

#Getting started with git-svn

git-svn is a git command that allows using git to interact with Subversion repositories.git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation. SourceTree also happens to support this command so you can use it with your usual workflow.

Reference: http://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion

##Cloning the SVN repository

You need to create a new local copy of the repository with the command

@chandu
chandu / spring-boot-cheatsheet.java
Created February 7, 2020 16:03 — forked from jahe/spring-boot-cheatsheet.java
Spring Boot Cheatsheet
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@chandu
chandu / System Design.md
Created January 22, 2020 20:23 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@chandu
chandu / SwtBrowserCanvas.java
Created December 5, 2019 16:53 — forked from caprica/SwtBrowserCanvas.java
Embed an SWT Webkit Browser component inside a Swing JPanel, with non-crashing clean-up.
/*
* This class is made available under the Apache License, Version 2.0.
*
* See http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Author: Mark Lee
*
* (C)2013 Caprica Software (http://www.capricasoftware.co.uk)
*/
@chandu
chandu / ReflectionHelpersSnippet.scala
Created June 12, 2019 13:38 — forked from ConnorDoyle/ReflectionHelpersSnippet.scala
Generic reflective case class instantiation with Scala 2.10.x
package test
import scala.reflect.runtime.universe._
object ReflectionHelpers extends ReflectionHelpers
trait ReflectionHelpers {
protected val classLoaderMirror = runtimeMirror(getClass.getClassLoader)
[info] Loading settings for project scastie7634183376889156235-build from plugins.sbt ...
[info] Loading settings for project scastie7634183376889156235 from build.sbt ...
Downloading http://scala-webapps.epfl.ch:8081/artifactory/scastie-ivy/com.sksamuel.avro4s/avro4s-core_2.11/3.0.0-RC2/ivys/ivy.xml.sha1
Downloading http://scala-webapps.epfl.ch:8081/artifactory/scastie-ivy/com.sksamuel.avro4s/avro4s-core_2.11/3.0.0-RC2/ivys/ivy.xml
Downloaded http://scala-webapps.epfl.ch:8081/artifactory/scastie-ivy/com.sksamuel.avro4s/avro4s-core_2.11/3.0.0-RC2/ivys/ivy.xml
Downloaded http://scala-webapps.epfl.ch:8081/artifactory/scastie-ivy/com.sksamuel.avro4s/avro4s-core_2.11/3.0.0-RC2/ivys/ivy.xml.sha1
Downloading http://scala-webapps.epfl.ch:8081/artifactory/scastie-maven/com/sksamuel/avro4s/avro4s-core_2.11/3.0.0-RC2/avro4s-core_2.11-3.0.0-RC2.pom
Downloading http://scala-webapps.epfl.ch:8081/artifactory/scastie-maven/com/sksamuel/avro4s/avro4s-core_2.11/3.0.0-RC2/avro4s-core_2.11-3.0.0-RC2.pom.sha1
Downloaded http://s
@chandu
chandu / anorm.scala
Created April 3, 2019 01:09 — forked from davegurnell/anorm.scala
A short guide to Anorm
/*
Overview
--------
To run a query using anorm you need to do three things:
1. Connect to the database (with or without a transaction)
2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator
3. Call one of the methods on `SqlQuery` to actually run the query
@chandu
chandu / auxpattern.scala
Created January 19, 2019 00:28 — forked from gigiigig/auxpattern.scala
Aux Pattern
import shapeless._
import scalaz._
import Scalaz._
object console extends App {
trait Foo[A] {
type B
def value: B