Skip to content

Instantly share code, notes, and snippets.

@DevWouter
DevWouter / pre-commit
Created July 5, 2019 09:03
Prevent fit/fdescribe in ts files
#!/bin/sh
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
# uncomment next line for debugging, will print all expanded bash commands
# set -x
# Yes, if you put "fdescribe" in a comment block, this will still abort the
@DevWouter
DevWouter / Jenkinsfile
Created July 18, 2018 10:11
tutorial-input
node { ws {
def msbuild_tool = tool(
name: 'MSBuild 4 (x64)',
type: 'hudson.plugins.msbuild.MsBuildInstallation');
stage("checkout") {
checkout scm;
}
stage("build") {
@DevWouter
DevWouter / Jenkinsfile
Last active July 18, 2018 08:41
JenkinsTutorial - Hello world
node { ws {
// Checkout de source code
checkout scm;
// Verkrijg de path van de globale geinstalleerde tool.
def msbuild_tool = tool(
name: 'MSBuild 4 (x64)',
type: 'hudson.plugins.msbuild.MsBuildInstallation');
// Draai een commando om het project te bouwen.
@DevWouter
DevWouter / css-rule-checker.ts
Created July 13, 2018 15:21
A bit of code to check if a certain css rule is being use by the site
rules = [];
website = "https://www.yoursite.com/";
Array.from(document.styleSheets)
.filter(x => (x.href || "").startsWith(website))
.forEach(sheet => {
Array.from(sheet.rules)
.filter(x => x.conditionText === undefined)
.filter(x => x.selectorText !== undefined)
.filter(x => !x.selectorText.includes(":"))
.filter(x => ($$(x.selectorText) || []).length == 0)
@DevWouter
DevWouter / whatsapp-countdown.js
Last active May 4, 2020 12:30
Countdown timer for whatsapp (now with instructions)
/**
* This script was written in 2015 and no longer works since 2017.
* The issue is most likely the `document.querySelector` since the queries return no results.
*/
// How to use this script:
// 1. Go to web.whatsapp.com and connect your device.
// 2. Open the developer console in chrome (F11 on windows, command+alt+i on mac)
// 3. Go to the tab console
// 4. Copy the script below, paste it and press enter.
@DevWouter
DevWouter / gist:b783b943ad939ce5693f
Last active September 4, 2024 13:37
Example: Bouncing ball Euler and RK4
--------------------------------------------------------------------------------
-- License
-- =============================================================================
-- Copyright (c) 2015 Wouter Lindenhof <wouterlindenhof@gmail.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is