Skip to content

Instantly share code, notes, and snippets.

View fatkulnurk's full-sized avatar
🤫
Bernafaslah, agar memberikan makanan bagi tanaman

Fatkul Nur Koirudin fatkulnurk

🤫
Bernafaslah, agar memberikan makanan bagi tanaman
View GitHub Profile
@fatkulnurk
fatkulnurk / .htaccess
Created December 3, 2017 03:54
Expire headers .htaccess code.
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
@fatkulnurk
fatkulnurk / php-Knuth-Morris.php
Created December 4, 2017 14:39
Algoritma Knuth-Morris-Pratt
<?php
// Referensi :
// https://id.wikipedia.org/wiki/Algoritma_Knuth-Morris-Pratt
// https://stackoverflow.com/questions/44081348/is-it-possible-to-use-knuth-morris-pratt-algorithm-for-string-matching-on-text-t
// http://www.elangsakti.com/2013/03/implementasi-algoritma-string-matching.html
// https://stackoverflow.com/questions/29439930/knuth-morris-pratt-string-search-algorithm
// https://stackoverflow.com/questions/5873935/how-to-optimize-knuth-morris-pratt-string-matching-algorithm
// https://stackoverflow.com/questions/13271856/understanding-knuth-morris-pratt-algorithm
//
//
echo "
zone \"fatkul.com\"{
type master;
file \"/var/cache/bind/db.fatkulcom\";
};
zone \"fatkul.edu\"{
type master;
file \"/var/cache/bind/db.fatkuledu\";
};
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$session = Yii::$app->session;
$session->open();
/**
* {@inheritdoc}
*/
public static function findIdentity($id)
{
return static::findOne($id);
}
/**
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 20 Jul 2018 pada 16.23
-- Versi server: 10.1.30-MariaDB
-- Versi PHP: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
<?php
class FuzzyTsukamoto
{
/*
* Object User
*/
var $user;
// besar pinjaman
var $nominalPinjaman;
@fatkulnurk
fatkulnurk / post-receive-json-php-curl.php
Created August 2, 2018 09:08 — forked from tutweb/post-receive-json-php-curl.php
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(
@fatkulnurk
fatkulnurk / StdInLinesScan.go
Created August 29, 2018 06:50
golang: fungsi untuk mendapatkan beberapa baris data inputan user di terminal / stdin
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func ScanLn(rslt *[]interface{}) {
@fatkulnurk
fatkulnurk / gist:d3fbc011a4da4dcc728ac616dd042e84
Created September 3, 2018 06:48
Glut Project Create Windows Example
/*
* GLUT Shapes Demo
*
* Written by Nigel Stewart November 2003
*
* This program is test harness for the sphere, cone
* and torus shapes in GLUT.
*
* Spinning wireframe and smooth shaded shapes are
* displayed until the ESC or q key is pressed. The