Skip to content

Instantly share code, notes, and snippets.

View rafialhamd's full-sized avatar
💭
Working on HBarScan.com

Rafiudeen Chozhan Kumarasamy rafialhamd

💭
Working on HBarScan.com
View GitHub Profile
@rafialhamd
rafialhamd / alt-callback-pass.md
Created June 11, 2019 09:53
Alternative ways to pass a callback to a function in Javascript

#Alternative ways to pass a callback to a function in Javascript

Javascript is extremely flexible, encouraging us to find alternatives to almost any possible expression or statement. For example, passing a callback function to another function can be done in different ways.

Because a function is an object in Javascript, it can be passed to another function as an argument and executed later. Callbacks let us defer the code execution to the moment it's really needed.

function waitAndCall(func)
{
 setTimeout(func,parseInt(Math.random()*10000));
@rafialhamd
rafialhamd / pom.xml
Created February 2, 2019 04:30 — forked from mnadeem/pom.xml
Add non maven jar in maven way
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo.app</groupId>
<artifactId>demo-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<version.maven-install-plugin>2.5.2</version.maven-install-plugin>
<version.non-maven1>1.0.0</version.non-maven1>