Skip to content

Instantly share code, notes, and snippets.

View tutweb's full-sized avatar

Tutorial Web Design tutweb

  • Tutweb
  • Indonesia
View GitHub Profile
@tutweb
tutweb / CSS-Center-element.html
Created January 26, 2013 16:20
Centering an element with css
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Position Center</title>
<style>
.container{
border:20px solid rgba(0,0,0,.5);
width: 400px;
height: 200px;
@tutweb
tutweb / scroll-play-video.html
Created September 6, 2014 06:29
Scroll to play video using jquery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Scroll untuk play video | Tutorial-Webdesign.com</title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script>
function scrollVideo() {
var video = $('#video').get(0),
videoLength = video.duration,
@tutweb
tutweb / post-receive-json-php-curl.php
Created August 13, 2017 17:09
Mengirim dan menerima data JSON dengan PHP cURL
<?php
//API URL
$url = 'http://www.contohweb.com/api';
//create a new cURL resource
$ch = curl_init($url);
//setup request to send json via POST
$data = array(
@tutweb
tutweb / contact-form-email.php
Last active May 8, 2022 08:37
Contoh form kontak dengan PHP yang terkirim ke email
<?php
$statusMsg = '';
$msgClass = '';
if(isset($_POST['submit'])){
// Get the submitted form data
$email = $_POST['email'];
$name = $_POST['name'];
$subject = $_POST['subject'];
$message = $_POST['message'];
@tutweb
tutweb / jquery-loading.html
Created May 23, 2013 14:44
Jquery Loading Animation While Page Load
<!doctype html>
<html lang="en">
<head>
<meta charset='UTF-8'>
<title>Animasi Loading Saat Pertama Membuka Website</title>
<meta name="description" content="Menampilkan animasi loading saat membuka website" />
<meta name="keywords" content="website animation, loading animation, jquery animation, jquery loading, preloader, animasi loading" />
<link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,200' rel='stylesheet' type='text/css'>
<style>
@tutweb
tutweb / write-json-file.php
Created October 6, 2016 14:36
Write JSON file with PHP
<?php
// array
$array = Array (
"0" => Array (
"id" => "USR1",
"name" => "Steve Jobs",
"company" => "Apple"
),
"1" => Array (
"id" => "USR2",
@tutweb
tutweb / tabel-responsive.html
Last active December 5, 2020 13:02
Contoh tabel responsive dengan css dan html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tabel Responsive dengan CSS dan HTML | Jurnalweb.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: "Times New Roman", serif;
line-height: 1.25;
@tutweb
tutweb / gmail.php
Created May 14, 2014 14:25
Mendapatkan list email dari Gmail dengan PHP
<?php
function check_email($username, $password)
{
//Connect Gmail feed atom
$url = "https://mail.google.com/mail/feed/atom";
// Send Request to read email
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
@tutweb
tutweb / move.php
Created June 20, 2016 08:53
Script transfer file antar CPANEL hosting
<?php
/* Mengambil file dari hosting lama */
/* File juga bisa diambil dari IP tertentu */
$content = file_get_contents("http://DOMAINLAMA.com/FILE_WEB_SAYA.zip");
/* Menyimpan file di hosting baru. pada folder yang diinginkan */
@tutweb
tutweb / og-php.php
Last active May 27, 2019 10:25
Get Open Graph Meta Tag Using PHP
<?php
function fetch_og($url)
{
$data = file_get_contents($url);
$dom = new DomDocument;
@$dom->loadHTML($data);
$xpath = new DOMXPath($dom);
# query metatags dengan prefix og
$metas = $xpath->query('//*/meta[starts-with(@property, \'og:\')]');