Skip to content

Instantly share code, notes, and snippets.

View mramirid's full-sized avatar

Amir Muhammad Hakim mramirid

View GitHub Profile
@mramirid
mramirid / rupiah.ts
Last active January 7, 2023 02:11 — forked from faisalman/Rupiah.as
Convert a number to a string of its equivalent in rupiah (TypeScript)
// JavaScript Code Snippet
// Convert integer to Rupiah & vice versa
// https://gist.github.com/845309
//
// Copyright 2011-2012, Faisalman
// Licensed under The MIT License
// http://www.opensource.org/licenses/mit-license
/**
* Convert a number to a string of its equivalent in rupiah
@mramirid
mramirid / AppName.php
Created April 5, 2020 14:45 — forked from isluewell/AppName.php
[6.0] Command app:name
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Composer;
use Symfony\Component\Finder\Finder;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
@mramirid
mramirid / slugify.js
Last active January 31, 2022 05:01 — forked from codeguy/slugify.js
Create slug from string in Javascript
/**
* Convert a string to a URL slug
* @param {string} str - The string to be slugified.
* @returns {string} The slugified string.
*/
function toSlug(str) {
str = str.replace(/^\s+|\s+$/g, ""); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc