Skip to content

Instantly share code, notes, and snippets.

View Aziz-Rahman's full-sized avatar

Aziz Rahman Aji Aziz-Rahman

View GitHub Profile
@Aziz-Rahman
Aziz-Rahman / drptdwnhvrbtstrp.js
Created September 29, 2015 02:48
drptdwnhvrbtstrpvbxdbdfbrghrhfgnvm
jQuery(document).ready(function($) {
$('ul.nav li.dropdown').hover(function(){
$('dropdown-menu',this).fadeIn();
},function(){
$('dropdown-menu',this).fadeOut('fast');
});
});
@Aziz-Rahman
Aziz-Rahman / ajax-registration.js
Last active September 17, 2020 21:11
Register user with ajax (WP)
jQuery(document).ready(function($) {
/**
* When user clicks on button...
*
*/
$('#btn-new-user').on("click",function() {
/**
* Prevent default action, so when user clicks button he doesn't navigate away from page
@Aziz-Rahman
Aziz-Rahman / style-wp.css
Created August 10, 2015 03:56
Basic WordPress Blog Styles
/* --------------------------------------------------------------
Basic WordPress Blog Styles
-------------------------------------------------------------- */
/* Images
-------------------------------------------------------------- */
.wp-smiley {
max-height: 1em;
@Aziz-Rahman
Aziz-Rahman / dltvbdbh.php
Created April 29, 2015 09:00
To delete automatic
<?php
$conn = // bla2...
// setting timer
$long_time = 2; // long time 2 days
// proccess delete
$query = mysqli_query( $conn, "DELETE FROM table_name WHERE DATEDIFF( CURDATE(), field_date ) > $long_time" );
@Aziz-Rahman
Aziz-Rahman / kodeunix.php
Created April 17, 2015 09:20
Kode unix automatic in form input
<?php
$conn = mysqli_connect( "localhost", "root", "", "no_urut" ) or die ( "Error !".mysqli_error( $conn ) );
// Date
date_default_timezone_set( 'Asia/Jakarta' );
$date = date( 'Y' );
$get3number = substr( $date,-3 ); //get 3 number of years from right
// Random of the character
function random_char( $panjang ) {
<?php
$page = isset( $_GET['p'] ) ? $_GET['p'] : '' ;
// etc ...
?>
@Aziz-Rahman
Aziz-Rahman / save-ft.php
Created March 31, 2015 07:37
Menggunakan fungsi end(), uniqid, explode, & md 5
<?php
// Connection
$conn = mysqli_connect( "localhost", "root", "", "gallery" ) or die ( 'Error !'. mysqli_error( $conn ) );
$pure_image = $_FILES['image']['name']; // nama ft
$files = end( explode( '.', $pure_image ) ); // memecah nm ft dan extention'nya, diambil kata dr titik paling belakang ( utk mengambil nm extention )
$file_name = $pure_image; // nama ft setelah dipecah/ dipisahkan dg extention'ny
$file_ext = $files; // ext
@Aziz-Rahman
Aziz-Rahman / tbl.php
Created March 13, 2015 09:03
Tb warna - warni
<?php
include( "koneksi.php" );
$baris = 1;
echo "<table width=\"400\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#ffffff\">";
echo "<tr bgcolor=\"#00CC00\">"; echo "<th>NIM</th>";
echo "<th>Nama</th>";
echo "<th>Alamat</th>";
echo "</tr>";
$myquery = "select nim,nama,alamat from tb_mahasiswa";
@Aziz-Rahman
Aziz-Rahman / rnd.php
Last active August 29, 2015 14:17
Random Character
<?php
function acakangkahuruf( $panjang ) {
$karakter= 'ABCDEFGHIJKL1234567890^()';
$string = '';
for ($i = 0; $i < $panjang; $i++) {
$pos = rand(0, strlen( $karakter )-1);
$string .= $karakter{$pos};
}
return $string;
}
@Aziz-Rahman
Aziz-Rahman / constructor_destructor.php
Last active August 29, 2015 14:16
Construtor & Destructor ( OOP PHP )
<?php
class motor{
private $model = "bebek";
private $warna = "hitam";
public function __construct(){
echo "method konstruktor di jalankan"."<br/>";
}
public function __destruct(){
echo "method destruktor di jalankan"."<br/>";