Skip to content

Instantly share code, notes, and snippets.

View webketje's full-sized avatar
🏠
Working from home

Kevin Van Lierde webketje

🏠
Working from home
View GitHub Profile
@webketje
webketje / README.md
Created November 27, 2022 22:39
Metalsmith auto-rebuild and browser sync

An example of how to implement (full) auto-rebuilds and browser sync with Metalsmith

@webketje
webketje / with-initial-scale.html
Last active September 29, 2021 08:34
How <meta name="viewport"> matters
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style>
* { box-sizing: border-box; }
html, body { background: #ccc; padding: 0; margin: 0; position: relative; }
#container { width: 960px; max-width: 100%; padding: 32px; margin: 32px auto; }
#contents { width: 600px; max-width: 100%; padding: 32px; margin: 0px auto; background: white; }
@webketje
webketje / package.json
Created August 14, 2020 17:00
metalsmith-resume
{
"name": "metalsmith-resume",
"version": "0.0.1",
"description": "A professional online & print resume powered by metalsmith",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "node_modules/.bin/serve dist",
"start": "node index && npm run serve"
},
@webketje
webketje / README.md
Last active May 6, 2024 17:37
Soundcloud Downloader Clean - Tampermonkey userscript OR bookmarklet

Tampermonkey userscript - Soundcloud Downloader Clean

An ad-less, multilingual, clean Soundcloud downloader with robust code. Adds a 'Download' button to all single track views.

Features

  • No third-party embeds, redirects or ads, directly uses the Soundcloud API.
@webketje
webketje / README.md
Last active May 11, 2023 11:50
Notepad++ extension: "Open Folder as workspace" context menu entry

Notepad++ extension: "Open Folder as workspace" context menu entry

Adds a context menu entry upon right-clicking folders to open the folder as a clean workspace in Notepad++, like many other modern editors allow.
Requires Notepad++ 7.8 or higher.

Screenshot

Install

Run install.cmd as administrator, or open regedit and manually import the .reg file.

@webketje
webketje / i18n_base.php
Last active February 10, 2017 23:19
GS UsrMgr - plugin permissions
<?php
if (myself(false) === 'load.php' && @$_GET['id'] === 'i18n_base') {
add_action('page-access', 'i18n_base_pages_access');
}
add_filter('permissions-css', 'i18n_base_permissions_css');
function i18n_base_pages_access() {
$usermgr = usermgr();
$current_user = current_user();
@webketje
webketje / CSS.css
Last active January 11, 2019 01:16
Anchorize JS - a Javascript plugin which turns HTML headings into clickable anchors for easy bookmarking and navigation
/* standard CSS. Add position:relative to elements which get an anchor hash */
html { scroll-behavior: smooth; }
.anchorize-hash { outline: none; text-decoration: none; position: absolute; left: 0; cursor: hand; cursor: pointer; color: inherit; opacity: 0.3; transition: opacity .1s; }
.anchorize-hash:hover { opacity: 1; }
h2, h3 { position: relative; padding-left: 1em; }
@webketje
webketje / create-element.js
Last active December 5, 2016 22:15
Superminimal virtual DOM utility
var vEl = function(element, options) {
var root = document.createElement(element);
for (var option in options) {
if (option === 'events') {
for (var event in options.events)
root.addEventListener(event, options.events[event], false);
} else if (option === 'children') {
for (var i = 0, len = options.children.length; i < len; i++)
root.appendChild(options.children[i]);
} else if (root.hasOwnProperty(option)) {
@webketje
webketje / ko.extenders.filters.js
Last active December 13, 2015 12:48
Knockout cumulative array filters extender
/**
* @module ko.extenders.filters
* @desc Allows for cumulative filters on Knockout observable arrays
* @version 1
* @author Kevin Van Lierde (Tyblitz)
* @license MIT license, Copyright (c) 2015, Kevin Van Lierde (https://opensource.org/licenses/MIT)
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd)
@webketje
webketje / index.html
Created May 20, 2015 23:15
CKEditor Toolbar code generator
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CKEditor Toolbar builder</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body { font-family: sans-serif; font-size: 14px; padding: 0; margin: 0;}
#statusbar { position: absolute; right: 0; background: white; padding: 5px; width: 200px; border: 1px solid #c0c0c0; border-top-width: 0; border-right-width: 0; border-bottom-left-radius: 3px; height: 1em; top: 0;}