Skip to content

Instantly share code, notes, and snippets.

View adibenc's full-sized avatar
🎯
Focusing

M Adib zamzam adibenc

🎯
Focusing
View GitHub Profile
@adibenc
adibenc / fuzzy.php
Created October 27, 2019 13:02
fuzzy.php
<?php
//submit
defined('BASEPATH') OR exit('No direct script access allowed');
class Fuzzy extends CI_Controller
{
public function __construct()
@adibenc
adibenc / Gerak_model.php
Last active November 4, 2019 02:40
Gerak & Gas per waktu per hari
<?php
class Gerak_model extends CI_Model{
function tampil_data(){
$data = $this->db->get('data_gerak');
}
function input_data($data,$table){
$this->db->insert($table,$data);
@adibenc
adibenc / Gerak_model.php
Last active November 9, 2019 02:53
Unique date select
<?php
class Gerak_model extends CI_Model{
function tampil_data(){
$data = $this->db->get('data_gerak');
}
function input_data($data,$table){
$this->db->insert($table,$data);
@adibenc
adibenc / dump.php
Created November 29, 2019 03:26
dump
<?php
$const=[
[0,'Semua'],
[1,'Pending'],
[2,'Diterima'],
[3,'Ditolak']
];
$const2=[
"peg_nama"=>"Nama peg",
"peg_id"=>"Id peg",
#append imgs
# thx for the thread! https://stackoverflow.com/questions/30227466/combine-several-images-horizontally-with-python
from PIL import Image,ImageDraw
images = [Image.open(x) for x in [str(i)+'.png' for i in range(1,901)]]
widths, heights = zip(*(i.size for i in images))
new_im = Image.new('RGB', (12*30, 12*30))
x_offset = 0
@adibenc
adibenc / index.php
Created February 27, 2020 02:48
perfect num
<?php
// $get=$_GET;
$post=$_POST;
$num=isset($post['num'])?$post['num']:0;
?>
<form method="post" action="">
<div>
@adibenc
adibenc / alter_add_column.php
Created March 3, 2020 02:02
base migrate add column
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterAddIdSekolah extends Migration
{
/**
* Run the migrations.
@adibenc
adibenc / extract_image.php
Last active April 22, 2020 14:35
extract_image.php
/*
base : https://chandranrahul.wordpress.com/2017/12/04/extract-images-from-spreadsheet-using-phpexcel/
modified : Rab Apr 22 21:32:00 WIB 2020
- require
composer require phpoffice/phpspreadsheet
- imports
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing;
@adibenc
adibenc / jatim.sql
Last active July 22, 2020 04:09
database wilayah dan kodepos utk jatim. src https://github.com/edwin/database-kodepos-seluruh-indonesia
INSERT INTO `wilayah` VALUES ('41748', 'KEPUTIH', 'SUKOLILO', 'SURABAYA', 'JAWA TIMUR', '60111');
INSERT INTO `wilayah` VALUES ('41749', 'KALISARI', 'MULYOREJO', 'SURABAYA', 'JAWA TIMUR', '60112');
INSERT INTO `wilayah` VALUES ('41750', 'KEJAWEN PUTIH TAMBAK', 'MULYOREJO', 'SURABAYA', 'JAWA TIMUR', '60112');
INSERT INTO `wilayah` VALUES ('41751', 'DUKUH SUTOREJO', 'MULYOREJO', 'SURABAYA', 'JAWA TIMUR', '60113');
INSERT INTO `wilayah` VALUES ('41752', 'KALIJUDAN', 'MULYOREJO', 'SURABAYA', 'JAWA TIMUR', '60114');
INSERT INTO `wilayah` VALUES ('41753', 'MULYOREJO', 'MULYOREJO', 'SURABAYA', 'JAWA TIMUR', '60115');
INSERT INTO `wilayah` VALUES ('41754', 'MANYAR SABRANGAN', 'MULYOREJO', 'SURABAYA', 'JAWA TIMUR', '60116');
INSERT INTO `wilayah` VALUES ('41755', 'GEBANG PUTIH', 'SUKOLILO', 'SURABAYA', 'JAWA TIMUR', '60117');
INSERT INTO `wilayah` VALUES ('41756', 'KLAMPIS NGASEM', 'SUKOLILO', 'SURABAYA', 'JAWA TIMUR', '60117');
INSERT INTO `wilayah` VALUES ('41757', 'MENUR PUMPUNGAN', 'SUKOLILO', 'SURABAYA', 'JAWA TI
@adibenc
adibenc / cyclicAlpha
Created August 3, 2020 07:43
cyclicAlpha
public function cyclicAlpha($size,$n=0){
$arr = range('A','Z');
$gen = [];
$cnt = 0;
$strlen = 1;
for($i=$n;$i<=$size;$i++){
if($cnt >= sizeof($arr)){
$cnt=0;
}
// echo $strlen;