Skip to content

Instantly share code, notes, and snippets.

Ary Wibowo nucreativa

Block or report user

Report or block nucreativa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nucreativa
nucreativa / gist:680660f2c418bbd1a04182f45514e3bb
Last active Nov 29, 2017
Install ElasticSearch on Debian 9 Fresh Installation
View gist:680660f2c418bbd1a04182f45514e3bb

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
View if-you-stuck-with-your-vagrant.md

##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 Jan 13, 2016
Function to convert date format
View convert-date.php
<?php
function convertDate($oldFormat, $newFormat, $date)
{
$myDateTime = DateTime::createFromFormat($oldFormat, $date);
return $myDateTime->format($newFormat);
}
?>
View excel-formulas.md

To get last non-empty cell in a column

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

STOP

docker stop $(docker ps -a -q)

REMOVE

docker rm $(docker ps -a -q)

@nucreativa
nucreativa / sqlsvr2k
Last active Apr 25, 2018
How to make connection SQL Server 2000 in PHP 5.4
View sqlsvr2k
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
Simple CSS Spinner
View spinner.html
<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 Aug 29, 2015
How to open page in new window
View open-in-new-window.js
// 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;
});
@nucreativa
nucreativa / pph21.php
Last active Dec 27, 2017
Code Hitung PPH21
View pph21.php
<?php
echo "\n";
echo "Berapa pendapatan (gaji dan lainnya) Anda per bulan? ";
$handle = fopen ("php://stdin","r");
$gaji = fgets($handle);
echo "Berapa pengeluaran (asuransi, jamsostek, dll) Anda per bulan? ";
$handle = fopen ("php://stdin","r");
$pengurangan = fgets($handle) ? : 0;
echo "Berapa bonus dan THR Anda peroleh dalam setahun? ";
$handle = fopen ("php://stdin","r");
You can’t perform that action at this time.