Skip to content

Instantly share code, notes, and snippets.

View gusmantap's full-sized avatar
🎯
Focusing

gusmantap

🎯
Focusing
  • Denpasar, Bali.
View GitHub Profile
@gusmantap
gusmantap / Segitiga.java
Created November 15, 2019 06:22
Segitiga piramid
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package latihan;
/**
*
* @author Bagus
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package latihan;
/**
*
* @author Bagus
@gusmantap
gusmantap / NODE_OPTIONS.bash
Created November 17, 2019 03:34
Node Increase Space SIZE
export NODE_OPTIONS=--max-old-space-size=8192
<center>
<table border="1" width="600" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<td colspan="2" valign="top" height="40">
<center>MIDLE TEST</center>
</td>
</tr>
<tr>
<td width="200">
class Hewan {
String nama;
String jenis;
public void Suara(){
System.out.println(this.nama+" Bersuara!");
}
}
class Unggas extends Hewan {
String keluarga;
@gusmantap
gusmantap / pagination.php
Last active December 24, 2019 02:46
pagination transform laravel
<?php
$all::pagination();
$all->getCollection()->transform(function($v){
return $this->transform($v);
});
@gusmantap
gusmantap / random.php
Created December 24, 2019 04:01
eloquent-random.php
<?php
Models::orderByRaw('RAND()');
@gusmantap
gusmantap / remove-trailing.bash
Created January 3, 2020 17:34
For those who don't have dos2unix installed (and don't want to install it): Remove trailing \r character that causes this error:
sed -i 's/\r$//' filename
@gusmantap
gusmantap / upload-laravel.php
Created January 8, 2020 06:28
Upload Laravel
<?php
$request->file('photo')->move(public_path($target), $name);
/^(?=.*[A-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@])(?!.*[iIoO])\S{6,12}$/
/^ // Start of the string.
(?=.*[A-z]) // must contains a characters (lowercase or uppercase characters).
(?=.*[a-z]) // must contains one lowercase characters.
(?=.*[A-Z]) // must contains one uppercase characters.
(?=.*[0-9]) // must contains one digit from 0-9.
(?=.*[$@]) // must contains one special symbols in this list $ and @.
(?!.*[iIoO]) // match any charcuter except i I o and O.