Skip to content

Instantly share code, notes, and snippets.

View ronaldaug's full-sized avatar
💻
Working from home

Ronald ronaldaug

💻
Working from home
View GitHub Profile
@ronaldaug
ronaldaug / guzzle.md
Created December 13, 2019 02:45
Guzzle GET POST + Headers example

Guzzle GET POST + Headers example

Guzzle Version 6.0

Installation

Create composer.json and add this below content

{
    "require": {
       "guzzlehttp/guzzle": "~6.0"
 }
{
                "itineraries_id": "MjMyNjEzMzA3Ng==",  // Booking ID နံပါတ်
                "itineraries_summary": {  // Booking Info
                    "currency": "MYR",  // ငွေအမျိုးအစား
                    "total_adult": "1", // လူလတ်
                    "total_child": "0",  // ကလေး
                    "total_infant": "0",  // လသား ကလေးငယ်
                    "origin_city_code": "KUL", // ထွက်ခွါမယ့်မြို့တော် code
                    "origin_city_name": "Kuala Lumpur", // ထွက်ခွါမယ့်မြို့တော်နာမည်
@ronaldaug
ronaldaug / ripple.css
Created August 27, 2019 03:04
Ripple effect ( Just add "ripple" class to your button )
.ripple{position:relative;overflow:hidden;transform:translate3d(0,0,0)}.ripple:after{content:"";display:block;position:absolute;width:100%;height:100%;top:0;left:0;pointer-events:none;background-image:radial-gradient(circle,#000 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:scale(10,10);opacity:0;transition:transform .5s,opacity 1s}.ripple:active:after{transform:scale(0,0);opacity:.2;transition:0s}
@ronaldaug
ronaldaug / add-cors.md
Last active June 17, 2019 08:09
Enable Cors in Laravel API

1 - Create Cors.php in Http/Middleware , add below codes inside Cors.php;

<?php
namespace App\Http\Middleware;
use Closure;

class Cors{
public function handle($request, Closure $next)
    {
@ronaldaug
ronaldaug / finguard.js
Last active September 23, 2022 09:03
Generate unique ID for each browser or client. JS
/* ----------------------------------------
// call finguard() in your app // output will be something like this --> "0821orak0821539ds999.6933.0.76"
---------------------------------------- */
function finguard(){function r(r,e){return(e+9845+window.screen.width+r+window.screen.width).split("").reverse().join("")}var e={};(o=(a=navigator.userAgent.toLowerCase()).match(/msie ([\d.]+)/))?e.ie=o[1]:(o=a.match(/firefox\/([\d.]+)/))?e.firefox=o[1]:(o=a.match(/chrome\/([\d.]+)/))?e.chrome=o[1]:(o=a.match(/opera.([\d.]+)/))?e.opera=o[1]:(o=a.match(/version\/([\d.]+).*safari/))&&(e.safari=o[1]);var a,o;e={};return(o=(a=navigator.userAgent.toLowerCase()).match(/msie ([\d.]+)/))?e.ie=o[1]:(o=a.match(/firefox\/([\d.]+)/))?e.firefox=o[1]:(o=a.match(/chrome\/([\d.]+)/))?e.chrome=o[1]:(o=a.match(/opera.([\d.]+)/))?e.opera=o[1]:(o=a.match(/version\/([\d.]+).*safari/))&&(e.safari=o[1]),e.ie?r("itne",e.ie):e.firefox?r("fyfo",e.firefox):e.chrome?r("karo",e.chrome):e.opera?r("orpr",e.opera):e.safari?r("sfri",e.safari):"zefo4
@ronaldaug
ronaldaug / fnow.js
Last active July 22, 2018 16:58
LightWeight fNow plugin (alternative to moment js's fromNow())
//* ----------------------------------------------
// LightWeight fNow plugin (alternative to moment js's fromNow())
// Author:Ronald Aug
// -------------------------------------------------
// Milliseconds -> 1532234636200 <--- is not a string , so don't add ("") like this ==> fNow.t("1532234636200");
// Correct usage is as below.
// e.g fNow.t(1532234636200) - output -> 10 minutes ago
// e.g fNow.t('22 July 2018 01:21:00') - output -> "a few second ago"
// e.g fNow.t('2018 July 22') - output -> "a month ago"
// e.g fNow.t('22 July 2017') - output -> "a year ago"
@ronaldaug
ronaldaug / Google doc to pretty documentation
Last active June 4, 2020 11:13
Google Doc to pretty documentation with sidebar (table of content)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var design = `<style>
span,
a,
body,
p {
color: #444;
line-height: 28px;
font-family: 'Roboto', sans-serif!important;