Skip to content

Instantly share code, notes, and snippets.

View hendisantika's full-sized avatar
💻
Coding... coding.. coding.... and coding..!

Hendi Santika hendisantika

💻
Coding... coding.. coding.... and coding..!
View GitHub Profile
@hendisantika
hendisantika / bank.xml
Created April 5, 2018 14:49
Some XSD examples (and reminders!)
<?xml version="1.0" encoding="UTF-8"?>
<bank xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bank.xsd">
<accounts>
<savings_accounts>
<savings_account id="a1" interest="0.03">
<balance>2500</balance>
</savings_account>
<savings_account id="a2" interest="0.03">
<balance>15075</balance>
</savings_account>
@hendisantika
hendisantika / curl.md
Created May 25, 2017 06:08 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hendisantika
hendisantika / MySQL_macOS_Sierra.md
Created May 14, 2018 15:34 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@hendisantika
hendisantika / postgres-cheatsheet.md
Created February 28, 2019 09:52 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

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)
@hendisantika
hendisantika / oracle.md
Created October 17, 2017 23:38 — forked from ddanailov-nmdp/oracle.md
Installing Oracle 11g on OS X 10.11 El Capitan
@hendisantika
hendisantika / StringCompare.md
Created May 7, 2019 23:57 — forked from Yengas/StringCompare.md
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.

@hendisantika
hendisantika / .gitlab-ci.yml
Created July 4, 2019 02:28 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# 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.
@hendisantika
hendisantika / docker-machine-mac-osx.md
Created March 26, 2019 23:52 — forked from Integralist/docker-machine-mac-osx.md
Docker Machine on Mac OS X

VirtualBox

  • https://www.docker.com/toolbox
  • 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
hendisantika / gist:9ab9ba7514befcb322501deee5accc2e
Created April 4, 2020 02:30 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database

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
hendisantika / .gitlab-ci.yml
Created April 7, 2020 06:27 — forked from daicham/.gitlab-ci.yml
A sample of .gitlab-ci.yml for a gradle project
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug