Skip to content

Instantly share code, notes, and snippets.

View stoneC0der's full-sized avatar

Cedric Megnie N. stoneC0der

View GitHub Profile
@stoneC0der
stoneC0der / Random string in PHP.php
Last active November 28, 2023 09:38
[Generate random string using Randomizer] #php #random string
public function generateRandomUniqueId(
?string $str = null,
?string $prefix = null,
?string $suffix = null,
int $byte = 16
): string
{
$randomizer = new \Random\Randomizer();
$defautl = 'abcdefghijklmnopqrstuvwxyz0123456789';
@stoneC0der
stoneC0der / .htaccess
Created June 24, 2022 12:04 — forked from davemackintosh/.htaccess
Working .htaccess for Single Page Apps
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.html [QSA,L]
</ifModule>
@stoneC0der
stoneC0der / APACHE: .htaccess pushstate
Created June 24, 2022 12:04 — forked from rayfranco/APACHE: .htaccess pushstate
.htaccess for HTML5 Pushstate support
<ifModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</ifModule>
@stoneC0der
stoneC0der / .php_cs
Last active February 19, 2021 09:26 — forked from pierophp/.php_cs
PHP CS Fixer Config File Example
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
[
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration' => true,
'array_syntax' => ['syntax' => 'short'],
<html lang="en"><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Forecefields Ghana Limited</title>
<meta name="keywords" content="HTML5, CSS3, responsive, Template">
<meta name="author" content="Cloud Software">
<meta name="csrf-token" content="ZzJxFFr6jlLFCIyz0s7YBXZEkoDC9lTAurlk6rTT">
<meta name="description" content="Metal- Responsive HTML5/CSS3 Template">
<meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
@stoneC0der
stoneC0der / workbench.colorCustomizations.json
Created March 16, 2020 06:38 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
We can't make this file beautiful and searchable because it's too large.
pattern,cnt
^,1657
-$,376
--,355
root.*/file.*\n,348
(?m)^hello world,338
\s+,296
\s*,278
^[a-z],275
[cg]pu,245
@stoneC0der
stoneC0der / XSSProtection.php
Created May 13, 2019 19:48 — forked from kirkbushell/XSSProtection.php
Laravel 5 XSS protection middleware
class XSSProtection
{
/**
* The following method loops through all request input and strips out all tags from
* the request. This to ensure that users are unable to set ANY HTML within the form
* submissions, but also cleans up input.
*
* @param Request $request
* @param callable $next
* @return mixed
@stoneC0der
stoneC0der / index.html
Created September 5, 2018 23:45
Tribute Page
<div id="main">
<h1 id="title">Kwame Nkrumah</h1>
<div id="tag">One of the African most beloved hero</div>
<div id="img-div">
<img id="image" src="https://upload.wikimedia.org/wikipedia/commons/1/15/President_John_F._Kennedy_Meets_with_the_President_of_the_Republic_of_Ghana%2C_Osagyefo_Dr._Kwame_Nkrumah_%28JFKWHP-AR6409-B%29.jpg" alt="Kwame Nkrumah &amp; JF Kennedy" />
<p id="img-caption">Kwame Nkrumah with U.S. President John F. Kennedy, 8 March 1961</p>
</div>
<div id="tribute-info">
<section>