Skip to content

Instantly share code, notes, and snippets.

View FauziFerdiansyah's full-sized avatar
💤
Let's overwhelmingly increase productivity

Fauzi Ferdiansyah FauziFerdiansyah

💤
Let's overwhelmingly increase productivity
  • Indonesia, Bogor
View GitHub Profile
Hari raya nyepi
var dateObj = new Date();
var month = ('0' + (dateObj.getMonth() + 1)).slice(-2);
var date = ('0' + dateObj.getDate()).slice(-2);
var year = dateObj.getFullYear();
var shortDate = year + '' + month + '' + date;
// Replace ./data.json with your JSON feed
fetch('https://raw.githubusercontent.com/guangrei/Json-Indonesia-holidays/master/calendar.json')
.then(response => response.json())
.then(data => {
@FauziFerdiansyah
FauziFerdiansyah / btn-hg.html
Created February 13, 2019 09:35
Button Hargadunia
<!-- Button Primary -->
<button className="btn btn-hg">Primary</button>
<!-- Button Secondary -->
<button className="btn btn-gray">Secondary</button>
@FauziFerdiansyah
FauziFerdiansyah / Function.Array-Group-By.php
Created September 9, 2018 07:36 — forked from mcaskill/Function.Array-Group-By.php
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
@FauziFerdiansyah
FauziFerdiansyah / helper.php
Last active January 7, 2020 17:18
Membuat helper tanggal Indonesia di laravel 5.* menggunakan CARBON
// ini diletakan di HELPER atau langsung di controllernya
public static function keIndonesia($tgl) {
$dt = new \Carbon\Carbon($tgl);
setlocale(LC_TIME, 'IND');
return $dt->formatLocalized('%A, %e %B %Y'); // Senin, 3 September 2018
}
@FauziFerdiansyah
FauziFerdiansyah / Add_Class_and_Remove_Class_with_Pure_JS.js
Created July 10, 2018 04:03
Functions for add class and remove class with Pure javascript
var els = document.getElementsByClassName('current-class-name');
removeClass(els, 'current-class-name');
addClass(els, 'new-class-name');
var el = document.getElementById('current-class-name');
removeClass([el], 'current-class-name');
addClass([el], 'new-class-name');
function addClass(elements, className) {
for (var i = 0; i < elements.length; i++) {