Skip to content

Instantly share code, notes, and snippets.

View nucreativa's full-sized avatar

Ary Wibowo nucreativa

View GitHub Profile
@nucreativa
nucreativa / docker-compose.yml
Created July 27, 2020 03:52 — forked from Mau5Machine/docker-compose.yml
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@nucreativa
nucreativa / gist:680660f2c418bbd1a04182f45514e3bb
Last active November 29, 2017 06:19
Install ElasticSearch on Debian 9 Fresh Installation

Download and install the public signing key:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

You may need to install the apt-transport-https package on Debian before proceeding:

sudo apt-get install apt-transport-https

##If your vagrant stuck connection timeout retrying

rm .vagrant.d\insecure_private_key

##If your vagrant ask re-import box

vboxmanage list vms
nano .vagrant/machines/default/virtualbox/id
@nucreativa
nucreativa / convert-date.php
Last active January 13, 2016 08:14
Function to convert date format
<?php
function convertDate($oldFormat, $newFormat, $date)
{
$myDateTime = DateTime::createFromFormat($oldFormat, $date);
return $myDateTime->format($newFormat);
}
?>
@nucreativa
nucreativa / excel-formulas.md
Created January 12, 2016 06:47
Excel Formulas

To get last non-empty cell in a column

=OFFSET($A$1;COUNTA(A:A)-1;0)
@nucreativa
nucreativa / CSV2Array.php
Created January 11, 2016 08:31
PHP - One line to parse a CSV file into an array
<?php
$csv = array_map('str_getcsv', file('filename.csv'));
?>
@nucreativa
nucreativa / stop-remove-docker-containers.md
Created October 14, 2015 04:30
One liner to stop / remove all of Docker containers

STOP

docker stop $(docker ps -a -q)

REMOVE

docker rm $(docker ps -a -q)

@nucreativa
nucreativa / sqlsvr2k
Last active April 25, 2018 22:47
How to make connection SQL Server 2000 in PHP 5.4
http://robsphp.blogspot.com/2012/09/how-to-install-microsofts-sql-server.html
https://stackoverflow.com/questions/19783613/how-to-connect-to-mssql-2000-from-php-5-3-and-up/19787528#19787528
https://onedrive.live.com/?cid=669ee24817961774&id=669EE24817961774%21720
@nucreativa
nucreativa / spinner.html
Created May 26, 2015 08:18
Simple CSS Spinner
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<style>
.spinner {
margin: 100px auto;
@nucreativa
nucreativa / open-in-new-window.js
Last active August 29, 2015 14:18
How to open page in new window
// You only need to add class "open-new-window" on link that you want to open in new window
// Function for open link in new browser window
$("a.open-new-window")
.on('click', function () {
var url = $(this).attr('href'),
conf = "height=" + (window.screen.height * 0.9) + ",width=" + (window.screen.width * 0.9);
window.open(url, 'New Window', conf);
return false;
});