Skip to content

Instantly share code, notes, and snippets.

@shoaiyb
shoaiyb / README.md
Last active April 16, 2022 23:59
The simplest PHP Hook

Hook

The simplest PHP Hook System.

How it works

This Hook System store all the hooks and there values in an array.

How can I use

This Hook is the simplest Hook ever made.

How can I set something?

Project Title

The project description.

npm-v npm-d npm-l

NPM

@gavin-asay
gavin-asay / regex_html_tag.md
Last active July 4, 2024 11:22
Regex and You: Matching an HTML Tag

Regex and You: Matching an HTML Tag

Regular expressions, ever versatile, will help up locate HTML tags in a string today.

Summary

Pattern matching HTML strings serves at least one crucial function in web dev: sanitizing user input. Allowing user-submitted strings opens one's application to significant vulnerability. Supposing, for example, some ne'er-do-well on the internet submitted a comment that includes <script src="[path]/stealYourData.js"></script>. Regular expressions allow us to match HTML tags in a string, because HTML tags conform to a certain pattern:

  • begin and end with brackets (<>)
  • contain a string name consisting of one or more lowercase letters, like p, a, div, strong, script
@lqez
lqez / summernote-lite.css
Created November 30, 2018 03:41
Beautified summernote-lite.css
@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("./font/summernote.eot?4c7e83314b68cfa6a0d18a8b4690044b");src:url("./font/summernote.eot?4c7e83314b68cfa6a0d18a8b4690044b#iefix") format("embedded-opentype"),
url("./font/summernote.woff?4c7e83314b68cfa6a0d18a8b4690044b") format("woff"),
url("./font/summernote.ttf?4c7e83314b68cfa6a0d18a8b4690044b") format("truetype")
}
[class^="note-icon-"]:before,
[class*=" note-icon-"]:before {
display: inline-block;
font: normal normal normal 14px summernote;
font-size: inherit;
-webkit-font-smoothing: antialiased;
@ondrek
ondrek / gist:7413434
Created November 11, 2013 13:48
Smallest Base64 image
data:image/gif;base64,R0lGODlhAQABAAAAACw=
@mpezzi
mpezzi / inc.language.php
Created March 29, 2010 20:39
PHP Simple Translation Engine
<?php
define('LANG_ENGLISH', 'en');
define('LANG_FRENCH', 'fr');
define('LANG_SPANISH', 'es');
// Look for l in query string and set as language.
$language = isset($_GET['l']) ? $_GET['l'] : LANG_ENGLISH;
/**