Skip to content

Instantly share code, notes, and snippets.

@ahallora
ahallora / index.js
Last active March 10, 2022 21:41
FCK Grid
/*
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 = ()=>{
@ahallora
ahallora / Cool text effect.html
Created November 18, 2021 07:34
Cool text effect
<a href="#">
COOL TEXT
<span class="outline">COOL TEXT</span>
</a>
<style type="text/css">
body {
background: #000;
@ahallora
ahallora / index.js
Created September 18, 2021 19:58
Slack API: Get User details based on reactions
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,
});
@ahallora
ahallora / unavailable.html
Created February 23, 2021 09:23
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 February 17, 2021 14:53
Extract video ID and host name from Youtube URL

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 February 11, 2021 11:48
How to run a retrospective

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 February 4, 2021 15:01
Convert string in dot notation into an object with JavaScript
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 January 1, 2021 21:28
Streambeats Dropbox audio preview snippet

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 July 28, 2020 19:13
Math and JavaScript live problem solving with Anders - episode 1

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.

@ahallora
ahallora / index.html
Created June 19, 2020 12:18
XSS onerror image example
<img src=x onerror="&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041">