Skip to content

Instantly share code, notes, and snippets.

View rwaddin's full-sized avatar
🖥️
Freelance Full-stack web developer

addin rwaddin

🖥️
Freelance Full-stack web developer
View GitHub Profile
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<form class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" placeholder="Enter email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Password:</label>
<div class="col-sm-10">
@rwaddin
rwaddin / Retrieve Contact Google API .php
Created June 17, 2020 08:57
iam use codeigniter depend composer google api client
<?php
public function index()
{
$google_redirect_uri = 'your url callback';
//setup new google client
$client = new Google_Client();
$client -> setApplicationName('My application name');
$client->setAuthConfigFile("./client_secret.json");
<!-- List group -->
<ul class="list-group">
<li class="list-group-item">
Bootstrap Switch Default
<div class="material-switch pull-right">
<input id="someSwitchOptionDefault" name="someSwitchOption001" type="checkbox"/>
<label for="someSwitchOptionDefault" class="label-default"></label>
</div>
</li>
<li class="list-group-item">
@rwaddin
rwaddin / validasi-email.php
Created May 19, 2020 09:02
To validate email with php
<?php
# sample 1
function isValidEmail($email){
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
}
# sample2
function isValidEmail($email) {
return filter_var($email, FILTER_VALIDATE_EMAIL)
&& preg_match('/@.+\./', $email);
@rwaddin
rwaddin / swal-confirm.js
Created May 19, 2020 05:40
Use sweetalert confirm in v 7x. if you use sweetalert v8x must use Swal.fire()
swal({title:"Sukses", text :"Setting berhasil dihapus", type : "success", showCancelButton : true}).then((result)=>{
if (result.value) {
location.reload();
}
})
@rwaddin
rwaddin / json-delete.php
Created May 19, 2020 04:45
Delete data file json with php
<?php
// File json yang akan dibaca
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);
@rwaddin
rwaddin / json-update.php
Created May 19, 2020 04:45
Update file json with php
<?php
// File json yang akan dibaca
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);
@rwaddin
rwaddin / json-insert.php
Created May 19, 2020 04:44
Insert data to file json with php
<?php
// File json yang akan dibaca
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);
@rwaddin
rwaddin / json-read.php
Created May 19, 2020 04:43
Read a file json with php
<?php
// File json yang akan dibaca (full path file)
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);