Skip to content

Instantly share code, notes, and snippets.

View nusendra's full-sized avatar
🎯
import { brain } from "head";

Nusendra Hanggarawan nusendra

🎯
import { brain } from "head";
View GitHub Profile
@nusendra
nusendra / admin.blade.php
Last active June 3, 2021 03:49
Pelatihan Laravel BKD Sidoarjo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ config('app.name') }} | @yield('title', 'Dashboard')</title>
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome -->
#! /bin/bash
php artisan route:clear
php artisan view:clear
php artisan config:clear
php artisan clear-compiled
composer dumpautoload
@nusendra
nusendra / mysql-docker.sh
Created May 13, 2020 04:05 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@nusendra
nusendra / pagination.ts
Created March 12, 2020 17:53
Pagination algorithm (only show some of the page from total page)
const pagingRange = (currentPage: number, { min = 1, totalPage = 20, length = 3 } = {}): Array<number> => {
if (length > totalPage) length = totalPage;
let start: number = currentPage - Math.floor(length / 2);
if (currentPage === totalPage) {
start = currentPage - Math.ceil(length / 2);
}
start = Math.max(start, min);
start = Math.min(start, min + totalPage - length);
@nusendra
nusendra / sitemap.xml.js
Created February 14, 2020 14:50
Sitemap for Svelte / Sapper blog with Markdown. https://github.com/nusendra/blog
const fs = require('fs');
const path = require('path');
const cwd = process.cwd();
const matter = require('gray-matter');
const formatDate = require('date-fns/format');
const BASE_URL = 'https://nusendra.com'; // Change this with ur domain
const pages = [''];
const POSTS_DIR = path.join(cwd, 'src/routes/post/posts/');
const EXCERPT_SEPARATOR = '<!-- more -->';
@nusendra
nusendra / extractLetterOrChinese.ts
Last active December 12, 2019 19:48
Extract normal letter and chinese character using regex
const mixedLetter: string = "what is this 肌肤困扰 means?";
/*
* Extract only the normal text (without chinese)
*/
const extractNormalText = (text: string): string => {
return text.replace(/[^a-z\d\s]+/gi, '');
}
/*
@nusendra
nusendra / popper.min.js
Created July 24, 2019 23:46
popper for PT.DWP
/*
Copyright (C) Federico Zivolo 2017
Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
*/(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:window.document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}
@nusendra
nusendra / Cara pake nya
Created November 29, 2018 03:07
Reusable Vue Table
<template lang="pug">
div
br
.container-fluid
my-table(:fields="table.tableFields" :button="table.actionButton" :url="table.url" :modules="modules")
template(slot='header')
filter-search(:modules="modules" :length="table.tableFields.length + 2" :filter-width='8')
el-button.pull-right(v-if="isAuthorized" type="primary" plain size="medium" @click="addNew") Input Kegiatan Baru
</template>
@nusendra
nusendra / tahapan-pembuatan-website.md
Created November 29, 2018 02:38 — forked from nafiesl/tahapan-pembuatan-website.md
Tahapan Pembuatan Website

Tahapan Pembuatan Website

Dalam mengerjakan suatu proyek website atau aplikasi berbasis web, kami (JasaWebsiteBanjarmasin.com) bagi dalam 4 tahap pengerjaan sejak persiapan hingga selesai. Ke empat tahap tersebut adalah:

1. Analisis

Dalam tahap ini, kami mempersiapkan pengerjaan proyek dengan terlebih dahulu melakukan inteview kepada klien. Yaitu untuk mendiskusikan apa saja hal atau fitur sistem yang ingin dituangkan ke dalam website atau aplikasi web yang ingin dibuat.

Kemudian hasil inteview tersebut kami buat menjadi sebuah konsep tertulis, untuk di-review atau dianalisis oleh klien. Analisis ini diperlukan sebagai feedback dari klien, apakah konsep yang kami buat sudah sesuai dengan harapan dan keinginan klien.

@nusendra
nusendra / .vimrc
Last active November 13, 2018 06:44
12 Nov 2018
set nocompatible
set tabstop=2
set shiftwidth=2
set expandtab
set number
set autoindent
set hlsearch
set background=dark
syntax enable