Skip to content

Instantly share code, notes, and snippets.

View cahsowan's full-sized avatar

Taufik Rahman cahsowan

View GitHub Profile
@cahsowan
cahsowan / index.php
Created March 16, 2018 02:40
Contoh sederhana ujian pilihan ganda dengan PHP
<?php
$soal = [
1 => [
'konten' => 'Siapakah sahabat yang menemani Nabi hijrah ke madinah?',
'pilihan' => [
'A' => 'Umar',
'B' => 'Usman',
'C' => 'Ali',
'D' => 'Abu Bakar',
@cahsowan
cahsowan / css-animation.html
Created November 10, 2016 03:54
Belajar CSS Animation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Animation</title>
<style>
.kotak {
width: 100px;
height: 100px;
@cahsowan
cahsowan / hitung_vocal.php
Created November 1, 2016 00:59
Hitung Jumlah Huruf Vocal dengan PHP
<?php
function hitung_vocal($kata){
$arr = str_split($kata);
$vocal = ['a', 'i', 'u', 'e', 'o'];
$found = array_intersect($vocal, $arr);
$count = array_count_values($arr);
$result = [];
@cahsowan
cahsowan / polling.php
Last active November 1, 2016 00:54
Simple example of polling using PHP
<?php
$pertanyaan = "Sistem operasi HP terbaik adalah?";
$pilihan = [
'android' => 'Android',
'ios' => 'iOS',
'wp' => 'Windows Phone'
];
function getData(){
@cahsowan
cahsowan / terbilang.php
Created April 21, 2015 04:16
Fungsi Terbilang Dengan PHP
<?php
function terbilang($x) {
$angka = ["", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas"];
if ($x < 12)
return " " . $angka[$x];
elseif ($x < 20)
return terbilang($x - 10) . " belas";
elseif ($x < 100)
@cahsowan
cahsowan / dblclick.sh
Created April 4, 2015 08:46
Enable Double Click on Pantheon Files Elementaryos
gsettings set org.pantheon.files.preferences single-click false
@cahsowan
cahsowan / install-php.sh
Created April 4, 2015 08:44
Shell script to Install LAMP on Ubuntu and varian
#!/usr/bin/env bash
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time ---"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'

All binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

VERSION PLATFORM OFFSET ORIGINAL CRACKED
3083 Linux x64 0xcbe3 85 39
3083 Linux x86 0xc6f2 85 39
3083 Win x64 0xe21b3 85 3B
3083 Win x86 0x9eb1a 1a 2a
3083 OSX 0x69cf 85 39
@cahsowan
cahsowan / upload.php
Created March 31, 2015 04:49
Example of upload file using PHP
<?php
$data = json_decode(file_get_contents('data.txt'), true) ?: [];
$upload_directory = 'upload/';
if ($_POST) {
$fruit = $_POST['fruit'];
$picture = $_FILES['picture'];
if (! empty($fruit) && file_exists($picture['tmp_name'])) {
$data[$fruit] = $upload_directory . $picture['name'];
@cahsowan
cahsowan / hitung_vocal
Last active August 29, 2015 14:10
Hitung Jumlah Huruf Vocal
<?php
$name = 'taufik rahman';
echo $name;
echo "<br>";
$name_arr = str_split($name);
// AYO HITUNG JUMLAH HURUF VOCAL
$vocal = ['a','e','i','u','o'];