Skip to content

Instantly share code, notes, and snippets.

@ahallora
ahallora / addwish-to-csv.js
Created May 25, 2022
Gem dine ønskelister fra AddWish.com til CSV
View addwish-to-csv.js
/*
Sådan gemmer du dine ønskelister fra AddWish.com til CSV
--------------------------------------------------------
1) Log ind på din ønskeliste på www.addwish.com
2) Start console i din browser (fx. tryk [ctrl+shift+i] i Chrome)
3) Copy/paste dette script ind i console og tryk [enter] for at køre det
4) Kopier CSV-teksten som vises i din browser prompt ind i Google sheets og tryk "Split text to columns" og vælg "Semicolon"
5) Din ønskeliste er nu gemt i Sheets
View index.js
/*
1. Go to a liveScore.com match page showing a FC København game
2. Run this script in the browser console
3. Enjoy FCKKøbenhavnLIVE tweets, liveScore updates and FCK fan banter live chatting
4. Good game.
Disclaimer: Use at own discretion.
*/
(()=>{
const renderGrid = ()=>{
View Cool text effect.html
<a href="#">
COOL TEXT
<span class="outline">COOL TEXT</span>
</a>
<style type="text/css">
body {
background: #000;
@ahallora
ahallora / index.js
Created Sep 18, 2021
Slack API: Get User details based on reactions
View index.js
require('dotenv').config();
const { App } = require('@slack/bolt');
const reaction = process.env.EMOJI;
const url = process.env.URL;
const app = new App({
signingSecret: process.env.SLACK_SIGNING_SECRET,
token: process.env.SLACK_BOT_TOKEN,
});
View unavailable.html
<html dir="ltr" lang="en"><head>
<meta charset="utf-8">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fff">
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no">
<title>www.contractbook.co</title>
<style>/* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
@ahallora
ahallora / A YouTube regExp VideoID and host.md
Last active Feb 17, 2021
Extract video ID and host name from Youtube URL
View A YouTube regExp VideoID and host.md

Extract video ID and host name from Youtube URL

A regular expression to extract video ID and host name from a wide range of different youtube links. Built upon this foundation.

^(?:https?:\/\/)?(?:www\.)?(?:m\.)?((youtu\.be|youtube\.com)(?:\/embed\/watch\\?.+|\/watch\?v=|watch\?.+&v=|.))([\w-]{11})(?:.+)?$

Supported URLs

@ahallora
ahallora / retro.md
Created Feb 11, 2021
How to run a retrospective
View retro.md

How to run retro-spective

Pre-requisites

  1. Make sure you have access to easyretro
  2. Make sure you have access to previous retro board
  3. Create a public retro board in time

How to

  1. send out links to previous + current retro
  2. walk through action points from previous retro (any carry over unfinished action points to current retro)
@ahallora
ahallora / dotPathToObject.js
Last active Feb 4, 2021
Convert string in dot notation into an object with JavaScript
View dotPathToObject.js
const dotPathToObject = (pathStr, value) => pathStr
.split(".")
.reverse()
.reduce((acc, cv, index) => ({
[cv]: index === 1 && value ? {[acc]: value} : acc
}))
console.log("expect:", JSON.stringify({
"a": {
@ahallora
ahallora / README.md
Created Jan 1, 2021
Streambeats Dropbox audio preview snippet
View README.md

Streambeats Dropbox audio preview snippet

Why?

Harris (https://twitter.com/HarrisHeller) has done a remarkable job with Streambeats (https://www.streambeats.com) and the massive library of high quality music for your streaming needs. The library was so vast that I didn't want to just download everything and listen to it locally, so instead I did what every programmer would do. I did a small code snippet to add a preview pane to the Dropbox experience.

How?

  1. Copy the snippet below
  2. Enter a folder in Dropbox containing music files; e.g. https://www.dropbox.com/sh/1cgxqyptl2jq8f5/AAAeQ1i1rwAV6zIDNN2VHJY6a/8.%20White?dl=0&subfolder_nav_tracking=1
  3. Switch to table view in the folder view
  4. Press CTRL+SHIFT+I (Windows) / CMD+SHIFT+I (Mac) to open Chrome Developer Tools
@ahallora
ahallora / s1ep1.md
Created Jul 28, 2020
Math and JavaScript live problem solving with Anders - episode 1
View s1ep1.md

Math and JavaScript live problem solving - episode 1

Welcome to this mini series of me trying to solve a simple math problem with Javascript. I apologize in advance to everyone more capable in both math and javascript.

Today's objective

  • Divide a number by 100 and limit the result's amount of decimals to 5 tops.
  • Expected outcome: 49.95 becomes 0.4995 and 9.95 becomes 0.0995.

That's easy, you might think.