Skip to content

Instantly share code, notes, and snippets.

@MiguelDebruyne
MiguelDebruyne / gulp-cjs-to-esm.md
Created April 18, 2024 12:13 — forked from noraj/gulp-cjs-to-esm.md
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

@MiguelDebruyne
MiguelDebruyne / sublime-command-line.md
Created April 16, 2018 06:50 — forked from adrianorsouza/sublime-command-line.md
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@MiguelDebruyne
MiguelDebruyne / scopes.txt
Created May 16, 2017 08:41 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@MiguelDebruyne
MiguelDebruyne / index.html
Created November 30, 2016 18:24
Insert values into css keyframe animation
<h1>Wha<span class="t">t</span> should I do <span class="t2">t</span>oday?</h1>
<ol class="ranking">
<li class="ranking--item">Feed the cat</li>
<li class="ranking--item">Read a book</li>
<li class="ranking--item">Have a nap</li>
</ol>
<div class="buttons">
<button name="remove">Remove</button>
@MiguelDebruyne
MiguelDebruyne / getWindowProperties.js
Last active November 22, 2016 11:27
JS: Get all user defined window properties
(function () {
// create an iframe and append to body to load a clean window object
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
document.body.appendChild(iframe);
// get the current list of properties on window
var currentWindow = Object.getOwnPropertyNames(window);
// filter the list against the properties that exist in the clean window
var results = currentWindow.filter(function(prop) {
return !iframe.contentWindow.hasOwnProperty(prop);
@MiguelDebruyne
MiguelDebruyne / index.html
Last active November 14, 2016 11:01
HTML5
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<form method="post" id="registerForm" action="index.php?page=user&amp;action=register">
<fieldset>
<div>
<label for="username"><span class="boldOnly">U</span>sername</label>
<input type="text" name="register[username]" id="username" accesskey="u" tabindex="1"/>
<div class="errorMessageCon">
<p class="errorMessage">&nbsp;</p>
</div>
<label for="email"><span class="boldOnly">E</span>-mail</label>
@MiguelDebruyne
MiguelDebruyne / Vertical Center Unknown Child (with pseudo el)
Created May 21, 2014 07:28
CSS: Vertical Center Unknown Child (with pseudo el)
/* This parent can be any width and height */
.block {
text-align: center;
}
/* The ghost, nudged to maintain perfect centering */
.block:before {
content: '';
display: inline-block;
height: 100%;
@MiguelDebruyne
MiguelDebruyne / Interval Method
Created May 15, 2014 09:55
JavaScript: Interval Method
function Interval (fn, time)
{
var timer = false;
this.start = function () {
if (!this.isRunning()) {
timer = setInterval(fn, time);
}
};
@MiguelDebruyne
MiguelDebruyne / Internationalization Language
Created May 7, 2014 10:57
CSS: Internationalization Language
:lang(af){quotes:'\201E' '\201D' '\201A' '\2019';}
:lang(ak){font-family:Lucida,"DejaVu Sans",inherit;}
:lang(ar){font-family:Tahoma 12,Nazli,KacstOne,"DejaVu Sans",inherit;}
:lang(bg){quotes:'\201E' '\201C' '\201A' '\2018';}
:lang(bn){font-family:FreeSans,MuktiNarrow,Vrinda,inherit;font-size:1.1em;line-height:1.4em;}
:lang(cs){quotes:'\201E' '\201C' '\201A' '\2018';}
:lang(da){quotes:'\00BB' '\00AB' '\203A' '\2039';}
:lang(de){quotes:'\201E' '\201C' '\201A' '\2018';}
:lang(el){font-family:"DejaVu Sans",inherit;quotes:'\00AB' '\00BB' '\2039' '\203A';}
:lang(en-GB){quotes:'\2018' '\2019' '\201C' '\201D';}