Skip to content

Instantly share code, notes, and snippets.

/**
* Example `FizzBuzz` with JavaScript (Pattern-Matching Like????????????) λ_(ツ)_/¯
* I Love this tweet
* @see https://twitter.com/cajuinaoverflow/status/1395022027204005889
* JavaScript will make You Crazy (Trust Me!)
*/
const FizzBuzz = n => ({
true: n,
[ n % 5 === 0]: "Buzz",
[ n % 3 === 0]: "Fizz",
@fzn0x
fzn0x / numberToWordsID.php
Last active May 10, 2021 09:47
PHP Programming Number To Words - Indonesia
/**
*
* (C) 2020 Muhammad Fauzan
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@wpscholar
wpscholar / loader.js
Created January 17, 2018 18:56
Vanilla JS loader indicator
function Loader(el) {
el.loader = this;
this.el = el;
this.style = document.getElementById('js-loader-styles');
this.init();
if (!document.body.animate) {
if (!this.style) {
this.style = document.createElement('style');
@ravibhure
ravibhure / git_rebase.md
Last active September 18, 2024 06:34
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream