Skip to content

Instantly share code, notes, and snippets.

View nilesolutions's full-sized avatar

Ahmed Samy nilesolutions

  • Abu dhabi
View GitHub Profile
@tranduongms1
tranduongms1 / quill-figure-with-caption.js
Last active October 2, 2024 07:40
Quill figure with caption, base on BlockEmbed
import Quill from 'quill';
const Module = Quill.import('core/module');
const BlockEmbed = Quill.import('blots/block/embed');
class ImageBlot extends BlockEmbed {
static blotName = 'image';
static tagName = ['figure', 'image'];
static create(value) {
@michaelkornblum
michaelkornblum / semantic-html-ex5.html
Created May 13, 2019 22:09
Simple blogsite markup with Semantic HTML5 tags.
[...]
<div class="wrapper">
<header>
<h1>Logo</h1>
<nav>
<ul>
<li><a href="link-1.html">Link 1</a></li>
<li><a href="link-2.html">Link 2</a></li>
<li><a href="link-3.html">Link 3</a></li>
</ul>
@addyosmani
addyosmani / lazyload.html
Last active November 8, 2022 11:00
Native image lazy-loading with a cross-browser fallback
<img data-src="unicorn.jpg" loading="lazy" alt=".." class="lazyload"/>
<script>
// Select all images with the class "lazyload"
const images = document.querySelectorAll("img.lazyload");
// Check if the browser supports the "loading" attribute
if ('loading' in HTMLImageElement.prototype) {
// If so, we'll update all <img src> to point to the data-src instead
images.forEach(img => {
img.src = img.dataset.src;
@maximuskrm2019
maximuskrm2019 / index.html
Created April 1, 2019 07:26
Using poetry quotes, lists, and testing
<html>
<head>
<title>Poetry, words, and tag test</title>
<blockquote>Poetry is thoughts that breathe, and words that burn.</blockquote> Thomas Gray
<hr>
<h4>Definitions</h4>
<h5>Fare:</h5>
<ul>
@sovietspy2
sovietspy2 / html5.html
Created March 25, 2019 09:18
the best of html5
<header>
<h1>Super duper best blog ever</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/archive">Archive</a>
</nav>
</header>
<main>
<article>
@jarodium
jarodium / sw.js
Created December 25, 2018 15:12
Service Worker
'use strict';
var cacheVersion = 1;
var currentCache = {
offline: 'offline-cache' + cacheVersion
};
const offlineUrl = 'offline.html';
this.addEventListener('install', event => {
event.waitUntil(
@xthesaintx
xthesaintx / export_png.jsx
Created August 19, 2018 23:10
Export all items in INDESIGN file as individual PNG files
// Set resolution options
var rp = [72,150,300];
// Set EXPORT presets
app.pngExportPreferences.exportResolution = 72;
app.pngExportPreferences.antiAlias = true;
app.pngExportPreferences.pngQuality = PNGQualityEnum.MAXIMUM;
app.pngExportPreferences.pngColorSpace = PNGColorSpaceEnum.RGB;
app.pngExportPreferences.pngExportRange = PNGExportRangeEnum.EXPORT_RANGE;
@harrisonde
harrisonde / gist:90431ed357cc93e12b51
Last active May 24, 2021 22:01
Deploy Laravel 5 applications on AWS Elastic Beanstalk
# The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
# Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)
# -------------------------------- Commands ------------------------------------
# Use "commands" key to execute commands on the EC2 instance. The commands are
# processed in alphabetical order by name, and they run before the application
# and web server are set up and the application version file is extracted.
# ------------------------------------------------------------------------------
commands:
01updateComposer:
@thomd
thomd / semantic-layout.html
Last active November 11, 2024 20:30
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>