Skip to content

Instantly share code, notes, and snippets.

View m0shiurX's full-sized avatar

Moshiur Rahman m0shiurX

View GitHub Profile
import path from 'path'
import vue from '@vitejs/plugin-vue'
import icons from 'vite-plugin-svg-icons'
import inspect from 'vite-plugin-inspect'
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'
import createDebugger from 'debug'
import { defineConfig } from 'laravel-vite'
export default defineConfig()
@jeffochoa
jeffochoa / Response.php
Last active February 4, 2026 06:20
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@xfateless
xfateless / color object
Last active January 3, 2022 07:28
Every color contained in an object with its corresponding hexa value for O(1) time lookup, find function below object
var colors = {
ALICEBLUE: '#F0F8FF',
ANTIQUEWHITE: '#FAEBD7',
AQUA: '#00FFFF',
AQUAMARINE: '#7FFFD4',
AZURE: '#F0FFFF',
BEIGE: '#F5F5DC',
BISQUE: '#FFE4C4',
BLACK: '#000000',
BLANCHEDALMOND: '#FFEBCD',
<?php
function backup_mysql_database($options){
$mtables = array(); $contents = "-- Database: `".$options['db_to_backup']."` --\n";
$mysqli = new mysqli($options['db_host'], $options['db_uname'], $options['db_password'], $options['db_to_backup']);
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$results = $mysqli->query("SHOW TABLES");
@fathyar
fathyar / gothamrounded.css
Created March 17, 2017 15:22
Base 64 Gotham Rounded Web Font
@font-face{font-family:"Gotham Rounded";src:url(data:application/x-font-woff;base64,d09GRk9UVE8AAEZTAA0AAAAAc2wAAQAAAABELAAAAicAAAaAAAAAAAAAAABDRkYgAAAI2AAAL7AAAD52S18d6UdERUYAADiIAAAAHgAAACAA+wAER1BPUwAAOKgAAAkaAAAgTN+RyvtHU1VCAABBxAAAAFoAAACA6jAts09TLzIAAAGMAAAATwAAAGBV3iT6Y21hcAAABmQAAAJfAAADXNxoa2RnYXNwAABCIAAAAAgAAAAIAAAAC2hlYWQAAAEwAAAANAAAADYDPdDzaGhlYQAAAWQAAAAgAAAAJAfUBChobXR4AABCKAAAAgMAAAM42zQ05m1heHAAAAGEAAAABgAAAAYAzlAAbmFtZQAAAdwAAASGAAALqRC7YCNwb3N0AAAIxAAAABMAAAAg/7gAMnjaY2BkYGBgZHDU3G4ZG89v85WBm/kFUIThAtuxZhj9/95/CxZj5n4gl4OBCSQKAFVNDHR42mNgZGBgPvBfgIGBJfv/vf/3WIwZgCIo4BwAm2YHAwAAUAAAzgAAeNpjYGL8wujKwMrAwrSHqYuBgaEHQjPeZTBi+MWABBYwMNQHMDB4wfgeas75QErpgRCzwn8LhhPMBxg+APncIDkmVqY9DApAyAQA+/8PRQB42rVUTW/bRhAdWXJsJ7GRGCgKBEWxQFM3KSRZFPwRBz0UMOo4xzpGgJyKFbkS6YhcYrm0QjSHAr30D/TQU/9Ff0D/Qf9OT307XMVUnAguipqg93F2Zt97swMR0cPWH9Si+u9bvDVu0Rf4qvEKrVHocZs+pwuPO42cVdqkXzy+hZ1fPV4jSb95vI6cvz3eaODbK1utNY/v0Hb7E4/vNvBmI2eLvm5/5fG9hob7DbzNuE2tzga+fmp/73GLTtp/ebxCW51PPW7TN50vPe40clbpQUd6fIvWOz96vEZ/dn72eJ0erH7n
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active March 7, 2026 11:26
Vanilla JavaScript Quick Reference / Cheatsheet
@telekosmos
telekosmos / uniq.js
Last active December 26, 2025 08:37
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@Nickology
Nickology / array_merge_recursive_numeric()
Last active August 1, 2021 17:17
[PHP] Merge N arrays AND sum numeric values of identical keys
<?php
/**
* array_merge_recursive_numeric function. Merges N arrays into one array AND sums the values of identical keys.
* WARNING: If keys have values of different types, the latter values replace the previous ones.
*
* Example:
*
* $a = array( "A" => "bob", "sum" => 10, "C" => array("x","y","z" => 50) );
* $b = array( "A" => "max", "sum" => 12, "C" => array("x","y","z" => 45) );
* $c = array( "A" => "tom", "sum" => 8, "C" => array("x","y","z" => 50, "w" => 1) );
@iwek
iwek / tsv-to-json.js
Last active March 20, 2023 02:46
TSV to JSON Conversion in JavaScript
//var tsv is the TSV file with headers
function tsvJSON(tsv){
var lines=tsv.split("\n");
var result = [];
var headers=lines[0].split("\t");
for(var i=1;i<lines.length;i++){
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);