Skip to content

Instantly share code, notes, and snippets.

View dominikwilkowski's full-sized avatar
🤖
Working

Dominik Wilkowski dominikwilkowski

🤖
Working
View GitHub Profile
var https = require('https');
// CONFIGURATION #######################################################################################################
var token = '';
var delay = 300; // delay between delete operations in millisecond
// GLOBALS #############################################################################################################
var baseApiUrl = 'https://slack.com/api/';
@jasonlong
jasonlong / example-sparkline.md
Last active May 14, 2018 02:36
Example for generating SVG sparklines – Released under CC0-1.0 (https://creativecommons.org/publicdomain/zero/1.0/)

example-sparkline

@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@dominikwilkowski
dominikwilkowski / Readme.md
Last active September 20, 2023 03:33
How to install a man page into a node.js app

How to install a man page into a node.js app

Cuttlebelle man page

Installing a man page is not easy as there are little infos out there about it.

After a lot of trial and error, google searches and alpha publishing my app I finally have a collection of things I need to do to get it working:

@kitze
kitze / conditionalwrap.js
Created October 25, 2017 16:54
one-line React component for conditionally wrapping children
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
<div>
<ConditionalWrap
condition={shouldLinkToHome}
wrap={children => <a href="/">{children}</a>}
>
@m-richo
m-richo / cf-app-audit.sh
Last active December 12, 2017 22:15
query Cloud Foundry environment for all running applications and dump them into a CSV file
#!/bin/bash
set -eu
set -o pipefail
API_ENDPOINT=$(cf api |grep "endpoint" |awk -F "https://" '{print $2}')
rm -f $API_ENDPOINT.csv
echo "Running audit for $API_ENDPOINT"
echo "Output is in $API_ENDPOINT.csv"
@slightlyoff
slightlyoff / push_payloads_userland.md
Last active September 30, 2022 23:11
Delivering H/2 Push Payloads To Userland

Background

One of the biggest missed opportunities thus far with HTTP/2 ("H/2") is that we are not yet able to sunset WebSockets in favor of H/2. Web Sockets and H/2 both support multiplexing messages bi-directionally and can send both textual and binary data.

Server Sent Events ("SSE"), by contrast, are not bi-directional (they're a "server-push-only" channel) and binary data cannot be sent easily. They are, however, very simple to implement. Adding to the menagerie of options, RTCPeerConnection can also be used to signal data to applications in a low-latency (but potentially lossy) way.

Because H/2 [does not support the handshake (upgrade) that WebSockets use to negotiate a connection](https://daniel.haxx.se/blog/2016/06/15/no-websockets-

@guilhermepontes
guilhermepontes / shuffle.js
Last active October 29, 2023 01:41
Shuffle Array - JavaScript ES2015, ES6
// original gist
const shuffleArray = arr => arr.sort(() => Math.random() - 0.5);
// fully random by @BetonMAN
const shuffleArray = arr => arr
.map(a => [Math.random(), a])
.sort((a, b) => a[0] - b[0])
.map(a => a[1]);
shuffleArray([1, 2, 3]) //[3, 1, 2]
@dominikwilkowski
dominikwilkowski / README.md
Created February 22, 2017 23:11
Flatten javascript objects into a single-depth object with ES6

Flatten a deep javascript object into single-depth object with ES6

Call it via:

const flat = flatten( realDeepObject );

Test case:

@simonswiss
simonswiss / index.js
Last active January 26, 2017 22:56
Hipster Scraper
const fs = require('fs')
const axios = require('axios')
const cheerio = require('cheerio')
const URLS = require('./urls')
const TARGET_FILE = './data.js'
function scrapeData(url) {
axios.get(url).then(response => {