Skip to content

Instantly share code, notes, and snippets.

View jogHar's full-sized avatar
🏡
Working from home

Hardik Jogani jogHar

🏡
Working from home
View GitHub Profile
@jogHar
jogHar / gist:7a076dc5a0cdee0bf6b08c3c8b2334c9
Last active October 28, 2021 09:49 — forked from JJediny/gist:a466eed62cee30ad45e2
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@jogHar
jogHar / estimate_read_time_generator.md
Last active October 22, 2021 07:23
Estimate Read Time generator using jekyll
{% assign words = post.content | strip_html | number_of_words %}
{% if words < 360 %} 
  1 min 
{% else %} 
  {{ words | divided_by:180 }} mins 
{% endif %}
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
@jogHar
jogHar / SystemMacAddress.java
Created January 10, 2020 12:45
Using this program you can find machine MAC address of windows and ubuntu
import java.net.InetAddress;
import java.net.NetworkInterface;
/**
* @author jogHar
*/
public class SystemMacAddress {
public static String getSystemMac(){
try{
String OSName= System.getProperty("os.name");
public class DatabaseBackup {
public static void main(String[] args) throws IOException, InterruptedException {
Backupdbtosql();
Restoredbfromsql("backup.sql"); //argument is a file name of database
}
private static void Backupdbtosql() {
try {
/*NOTE: Getting path to the Jar file being executed*/
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}