Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
import { brain } from "head";

Nusendra Hanggarawan nusendra

🎯
import { brain } from "head";
View GitHub Profile
View phpartisanjing
#! /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 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# 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 Mar 12, 2020
Pagination algorithm (only show some of the page from total page)
View pagination.ts
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 Feb 14, 2020
Sitemap for Svelte / Sapper blog with Markdown. https://github.com/nusendra/blog
View sitemap.xml.js
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 Dec 12, 2019
Extract normal letter and chinese character using regex
View extractLetterOrChinese.ts
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 Jul 24, 2019
popper for PT.DWP
View popper.min.js
/*
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 Nov 29, 2018
Reusable Vue Table
View Cara pake nya
<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>
View tahapan-pembuatan-website.md

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 Nov 13, 2018
12 Nov 2018
View .vimrc
set nocompatible
set tabstop=2
set shiftwidth=2
set expandtab
set number
set autoindent
set hlsearch
set background=dark
syntax enable
View toc-vue-bab-1-8
- [Table of Content](#table-of-content)
- [Mengenal Vue](#mengenal-vue)
- [Apa itu Vue?](#apa-itu-vue)
- [Sejarah Vue](#sejarah-vue)
- [Mengapa Memilih Vue?](#mengapa-memilih-vue)
- [Framework Javascript Populer](#framework-javascript-populer)
- [Didukung Banyak Pustaka](#didukung-banyak-pustaka)
- [Bukan One Man Show](#bukan-one-man-show)
- [Digunakan Perusahaan Besar](#digunakan-perusahaan-besar)
- [Mudah Dipelajari](#mudah-dipelajari)
You can’t perform that action at this time.