Skip to content

Instantly share code, notes, and snippets.

Coding... coding.. coding.... and coding..!

Hendi Santika hendisantika

Coding... coding.. coding.... and coding..!
View GitHub Profile
hendisantika /
Created Apr 17, 2020 — forked from hootlex/
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
hendisantika /
Created Apr 16, 2020
Concurrent HashMap Vs SynchronizedMap
package com.hendisantika.thread;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
hendisantika / .gitlab-ci.yml
Created Apr 7, 2020 — forked from daicham/.gitlab-ci.yml
A sample of .gitlab-ci.yml for a gradle project
View .gitlab-ci.yml
image: java:8-jdk
- build
- test
- deploy
# - echo `pwd` # debug
hendisantika / gist:9ab9ba7514befcb322501deee5accc2e
Created Apr 4, 2020 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database
View gist:9ab9ba7514befcb322501deee5accc2e

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

hendisantika /
Created Mar 26, 2020 — forked from luanvuhlu/
convert byte data to MultipartFile in Spring MVC
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.multipart.MultipartFile;
hendisantika / .gitlab-ci.yml
Created Jul 4, 2019 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
View .gitlab-ci.yml
# Reference:
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
View build.gradle
buildscript {
repositories {
dependencies {
classpath 'no.nils:wsdl2java:0.10'
hendisantika /
Created May 7, 2019 — forked from Yengas/
Java String comparison, differences between ==, equals, matches, compareTo

String Comparison

In this gist, i will try to explain you what is the main differences between known string comparison techniques and where to use them.

Explanation of methods


This is the main equality operator in Java. To summarize it, this method compares the left and right hands references to eachother and returns boolean. This means this operator returns true only if left and right variable both point at the same Object in the memory. As in most of the class comparisons, this operators is discouraged to use if you're not really intented to check if two variables point to same object.



  • docker-machine create --driver virtualbox dev
  • docker-machine env dev (add values to ~/.zshrc)
    • e.g. echo eval "$(docker-machine env dev)" >> ~/.zshrc
  • docker-machine ls
  • docker ps (might need to re-source .zshrc file; e.g. . ~/.zshrc)
  • docker run hello-world
  • docker-machine ip dev
hendisantika /
Created Feb 28, 2019 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
You can’t perform that action at this time.