Skip to content

Instantly share code, notes, and snippets.

View rhishikeshj's full-sized avatar
📚
Learning...

Rhishikesh rhishikeshj

📚
Learning...
View GitHub Profile
@rhishikeshj
rhishikeshj / record-time.clj
Created August 23, 2023 11:06
A more flexible version of the `clojure.core/time` function
(defmacro record-time
"Evaluates expr and calls recorder fn. Returns value of expr.
recorder is an fn of 2 args,
time-taken double
expr string"
[recorder expr]
`(let [start# (. System (nanoTime))
ret# ~expr]
(~recorder (/ (double (- (. System (nanoTime)) start#)) 1000000.0) ~(str expr))
ret#))
@rhishikeshj
rhishikeshj / keybase.md
Last active March 21, 2022 10:35
Keybase

Keybase proof

I hereby claim:

  • I am rhishikeshj on github.
  • I am rhishikeshj (https://keybase.io/rhishikeshj) on keybase.
  • I have a public key ASBjjoCAQuO2mW93jdiNOV72W0R-_cmZrz_XDCbNt4ls4Qo

To claim this, I am signing this object:

@rhishikeshj
rhishikeshj / ExtendedEntry.cs
Created May 3, 2017 08:55
How to debounce an Entry control in Xamarin
private Task _debounceTask;
public ExtendedEntry()
{
int debounceDelay = 500;
CancellationTokenSource _debounceTaskCancellationSource = null;
TextChanged += (sender, e) =>
{
if (_debounceTask != null)
{
@rhishikeshj
rhishikeshj / ReflectionUtil
Created September 2, 2015 14:50
Util class for doing reflection via objc runtime
//
// ReflectionUtil.m
//
// Created by Rhishikesh Joshi on 02/09/15.
//
#import "ReflectionUtil.h"
@import ObjectiveC;
@implementation ReflectionUtil