Skip to content

Instantly share code, notes, and snippets.

View ngekoding's full-sized avatar
💭
#staysafe

Nur Muhammad ngekoding

💭
#staysafe
View GitHub Profile
@ngekoding
ngekoding / example.php
Last active January 20, 2021 01:31
Getting date start & end for every week (Mon - Sun) by given month
<?php
$weeks = get_week_dates('2021-01');
var_dump($weeks);
// Output:
// array(5) {
// [0]=>
// array(2) {
@ngekoding
ngekoding / index.html
Last active November 4, 2020 08:04
Duplicating jQuery Select2 (supporting add & delete)
<div class="row expert-wrap">
<div class="col-md-6 form-group">
<input type="text" id="expert-field_1" class="form-control" name="expert-field[]" placeholder="Misal: Ahli Teknik Sipil">
</div>
<div class="col-md-6 expert-name-wrap">
<div class="form-group">
<select name="expert-name[]" id="expert-name_1" class="form-control select2">
<option value=""></option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
@ngekoding
ngekoding / rsync-auto
Created October 4, 2020 09:52
rsync bash script to simplify the process (supporting .gitignore, etc...)
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 -s source -d destination"
echo -e "\t-s Source folder"
echo -e "\t-d Destination folder"
echo ""
echo -e "Notes:\t- All files in .gitignore will be ignored"
@ngekoding
ngekoding / generated_column.sql
Created May 9, 2020 13:10 — forked from hidayat365/generated_column.sql
Generated Column Example
-- master table
create table transactions (
id int auto_increment primary key,
code varchar(60) not null unique,
date integer not null,
value decimal(15,2) default 0,
remarks text
);
-- details table without generated column
@ngekoding
ngekoding / gulpfile.js
Created March 22, 2019 10:08 — forked from alxmtr/gulpfile.js
Sass & Pug + BrowserSync
var gulp = require('gulp');
var pug = require('gulp-pug');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
// Compile pug files into HTML
gulp.task('pug', function () {
return gulp.src('src/pug/*.pug')
.pipe(pug())
{"lastUpload":"2018-04-26T00:54:27.440Z","extensionVersion":"v2.9.0"}