Skip to content

Instantly share code, notes, and snippets.

@igun997
igun997 / seme_erp.js
Last active March 11, 2018 16:55
Select2 Add Option On Ajax
var dataSelected = {
id: response.result.id_brk,
text: response.result.id_brk+" - "+response.result.nama_ap
};
var newOption = new Option(dataSelected.text, dataSelected.id, false, false);
$('#ea_pekerjaan_id').append(newOption).trigger('change');
@igun997
igun997 / php
Created May 18, 2019 10:47
BE_PHP #1
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$word = strtolower($word);
$temp1 = $word;
$temp2 = strrev($word);
if($temp1 == $temp2){
return true;
@igun997
igun997 / php
Created May 18, 2019 11:03
BE_PHP #2
<?php
class Pipeline
{
public static function make_pipeline()
{
$func_list = func_get_args();
$result = function($arg) use ($func_list)
{
@igun997
igun997 / sql
Created May 18, 2019 11:07
BE_SQL #1
-- Write only the SQL statement that solves the problem and nothing else.
SELECT COUNT(*) FROM students WHERE firstName = 'John'
@igun997
igun997 / sql
Created May 18, 2019 11:20
BE_SQL #2
-- Write only the SQL statement that solves the problem and nothing else.
SELECT name FROM employees WHERE managerId IS NOT NULL
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Sirkulasi extends CI_Controller{
public $dpost;
public function __construct()
{
parent::__construct();
$this->dpost = $this->input->post(null,true);
@igun997
igun997 / PegawaiControl.php
Created July 11, 2019 04:48
PegawaiControl.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Divisi;
use App\Models\Gol;
use App\Models\Pegawai;
use App\Models\Mutasi;
use App\Models\Pensiun;
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* @author Indra Gunanda
*/
class Absensi extends CI_Controller{
/**
* Konstruktor
*
* @return void
@igun997
igun997 / uint8_converter
Last active August 25, 2019 12:23 — forked from borismus/gist:1032746
Convert a base64 string into a binary Uint8 Array
var BASE64_MARKER = ';base64,';
function convertDataURIToBinary(dataURI) {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
@igun997
igun997 / composer.json
Created January 21, 2020 15:59
Boilerplate Package
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {