Skip to content

Instantly share code, notes, and snippets.

View jensgro's full-sized avatar

Jens Grochtdreis jensgro

View GitHub Profile
// Stolen from https://stackoverflow.com/a/31615643
const appendSuffix = n => {
var s = ['th', 'st', 'nd', 'rd'],
v = n % 100;
return n + (s[(v - 20) % 10] || s[v] || s[0]);
};
module.exports = function dateFilter(value) {
const dateObject = new Date(value);
/* ***********************************************
Styles for Mastodon
Adapted from different sources
- https://write.as/panais/styles-pour-mastodon-avec-stylus
- https://mastodon.social/@matuzo/109284559864791077
- https://mastodon.social/@matuzo/109284628517006156
- https://gist.github.com/justmarkup/e4f6d52bef604e170815aaf44f459fbc
*********************************************** */
@jensgro
jensgro / flutter_setup.md
Created May 21, 2021 16:36 — forked from bradtraversy/flutter_setup.md
Flutter dev setup & notes
@jensgro
jensgro / oneliners.js
Created May 7, 2019 13:11 — forked from mikowl/oneliners.js
👑 Awesome one-liners you might find useful while coding.
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.
@jensgro
jensgro / dabblet.css
Created May 16, 2018 07:18 — forked from LeaVerou/dabblet.css
Animated line headings
/**
* Animated line headings
*/
h1 {
display: flex;
align-items: center;
width: 100%;
box-sizing: border-box;
@jensgro
jensgro / index.html
Created June 21, 2017 15:16 — forked from danielpost/index.html
Initiate toggle functionality.
<button aria-pressed="false" aria-label="Toggle something">I'm a toggle button!</button>
<button aria-checked="false" role="switch" aria-label="Switch something">I'm a switch!</button>
@jensgro
jensgro / web-servers.md
Created February 6, 2017 16:52 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jensgro
jensgro / SassMeister-input-HTML.html
Created January 10, 2017 10:18 — forked from maddesigns/SassMeister-input-HTML.html
Generated by SassMeister.com.
<article>article</article>
<aside>aside</aside>
@jensgro
jensgro / index.html
Created October 19, 2016 16:51 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/yopofej
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
input.broken {
/* border: 2px solid; */
/* border-width: 2px; */