Skip to content

Instantly share code, notes, and snippets.

View gusmantap's full-sized avatar
🎯
Focusing

gusmantap

🎯
Focusing
  • Denpasar, Bali.
View GitHub Profile
CREATE DATABASE IF NOT EXISTS belajar;
USE belajar;
DROP TABLE IF EXISTS customers;
CREATE TABLE IF NOT EXISTS customers(
id int PRIMARY KEY AUTO_INCREMENT,
nama VARCHAR(255) NOT NULL,
alamat VARCHAR(255) NOT NULL,
kota VARCHAR(255) NOT NULL,
private void handleFilterDuplicate() {
this.lists.Clear();
listAll.Items.Clear();
for (int i = 0; i < list1.Items.Count; i++ )
{
string a = list1.Items[i].ToString();
Console.WriteLine(a);
if (isNumExist(Int32.Parse(a)) == false)
{
@gusmantap
gusmantap / sample.json
Created May 20, 2021 09:50
sample.json
{
"data": [
{
"_id": "608a281159277c0a6c189782",
"nama_lengkap": "AAA BBB",
"nama_startup": "EGroceriees",
"jabatan": "CEO",
"kota": "KL",
"handphone": "85565686",
"tahun_berdiri": "2012",
{"lastUpload":"2020-10-11T07:50:50.908Z","extensionVersion":"v3.4.3"}
/^(?=.*[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.
@gusmantap
gusmantap / upload-laravel.php
Created January 8, 2020 06:28
Upload Laravel
<?php
$request->file('photo')->move(public_path($target), $name);
@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 / random.php
Created December 24, 2019 04:01
eloquent-random.php
<?php
Models::orderByRaw('RAND()');
@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);
});
class Hewan {
String nama;
String jenis;
public void Suara(){
System.out.println(this.nama+" Bersuara!");
}
}
class Unggas extends Hewan {
String keluarga;