Skip to content

Instantly share code, notes, and snippets.

View MkDierz's full-sized avatar
🏠
Working from home

syibbran mulaesyi MkDierz

🏠
Working from home
View GitHub Profile
@MkDierz
MkDierz / ARRAY.java
Created December 4, 2019 18:57
java array declaration, find max min and total
public static void main(String[] args) {
int [] data = {3, 2, 0, 8, 10, 15, 13, 6};
int max = 0, min = 0, total = 0;
for(int i = 0; i < data.length; i++)
{
if (max < data[i]) {
max = data[i];
}
if (min > data[i]) {
min = data[i];
@MkDierz
MkDierz / atom-php.md
Created February 15, 2020 08:35 — forked from natanfelles/atom-php.md
Atom PHP Environment + CodeIgniter 3 & 4

Atom PHP Environment + CodeIgniter 3 & 4

Atom Editor

Install

Download and install Atom Editor:

cd ~/Downloads
@MkDierz
MkDierz / img_train_test_split.py
Created June 13, 2020 16:19 — forked from bertcarremans/img_train_test_split.py
Split images randomly over train or validation folder
# Copyright 2014-2017 Bert Carremans
# Author: Bert Carremans <bertcarremans.be>
#
# License: BSD 3 clause
import os
import random
from shutil import copyfile
@MkDierz
MkDierz / random_radio.js
Created June 26, 2021 15:27 — forked from ciamarro/random_radio.js
Randomly select all radio buttons on a form
var a = document.querySelectorAll('input[type=radio]');
for (var i=0; i<a.length; i++)
// from https://stackoverflow.com/a/18066088/8148848
a[i].checked = ( (Math.random()*10) > 5) ? true : false;
{{ $var }} - Echo content
{{ $var or 'default' }} - Echo content with a default value
{{{ $var }}} - Echo escaped content
{{-- Comment --}} - A Blade comment
@extends('layout') - Extends a template with a layout
@if(condition) - Starts an if block
@else - Starts an else block
@elseif(condition) - Start a elseif block
@endif - Ends a if block
@MkDierz
MkDierz / export_all_sheet_name_with_column.cls
Created July 11, 2021 13:21
export all sheet name and folowing colum name by identifier id
Sub ListSheetNamesInNewWorkbook()
Dim objWorkbook As Workbook
Dim objWorksheet As Worksheet
Set objWorkbook = ActiveWorkbook
Set objWorksheet = objWorkbook.Sheets("daftar_isi")
For i = 1 To ThisWorkbook.Sheets.Count
objWorksheet.Cells(i, 1) = i
objWorksheet.Cells(i, 2) = ThisWorkbook.Sheets(i).Name
$config['base_url'] = "http://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])).'/';
@MkDierz
MkDierz / app.py
Last active September 2, 2021 03:46
basic axios example
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class data_api(Resource):
def post(self):
json_data = request.get_json()
print(json_data['data'])
function login() {
if (checker()) {
axios
.post('/api/login', {
username: username.value,
password: password.value
})
.catch(function (error) {
console.log(error);
alert(error)