# Do with fresh clone
git clone REPO1 A
git clone REPO2 B
cd A
# bundle repo as directory (I hate CONFLICT by structure project, so new repo, new directory)
git filter-repo --to-subdirectory-filter apps/A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to display the postinstall field of package.json if exists | |
display_hook_install() { | |
if [ -f "$1" ]; then | |
postinstall=$(jq -r '.scripts.postinstall' "$1") | |
dir=$(dirname "$1") | |
packagename=$(jq -r '.name' "$1") | |
packageversion=$(jq -r '.version' "$1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Input: 10 | |
-- Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] | |
-- Signature | |
fn :: (Integral a) => a -> [a] | |
-- Solution with pattern-matching | |
fn 0x0 = [] | |
fn n = if n - 1 < 0 then fn 0 else fn (n - 1) ++ [n] | |
-- n = -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
git for-each-ref --sort=taggerdate --format '%(refname:short) %(taggerdate:format:%s)' "refs/tags/*" | while read tag tagdate; do | |
threshold_date=$(date -d '60 days ago' --utc '+%s') | |
if [ -n "$tagdate" ]; then | |
if [ "$tagdate" -lt "$threshold_date" ]; then | |
echo "==> $tag is older than 60 days" | |
echo "==> $tag will be deleted" | |
git tag --delete $tag | |
git push origin --delete $tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# VHS documentation | |
# | |
# Output: | |
# Output <path>.gif Create a GIF output at the given <path> | |
# Output <path>.mp4 Create an MP4 output at the given <path> | |
# Output <path>.webm Create a WebM output at the given <path> | |
# | |
# Require: | |
# Require <string> Ensure a program is on the $PATH to proceed | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.style-scope yt-live-chat-renderer { | |
background-color: rgb(0, 0, 0, 0); | |
} | |
#items.yt-live-chat-item-list-renderer > *.yt-live-chat-item-list-renderer { | |
background-color: rgb(0, 0, 0, 0); | |
} | |
.yt-live-chat-text-message-renderer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _data = (data) => ({ error: null, data }) | |
const _error = (error) => ({ data: null, error }) | |
const mapError = f => ({ error, data }) => ({ error: f(error), data }) | |
const mapData = f => ({ error, data }) => ({ data: f(data), error }) | |
const promiseMapData = f => p => p.then(f) | |
const promiseMapError = f => p => p.catch(f) | |
const promiseMe = (p) => pipe( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
access_by_lua_block { | |
local http = require "resty.http" | |
local httpc = http.new() | |
-- Fetch the JWT token from Authorization header | |
local auth_header = ngx.var.http_Authorization | |
if auth_header then | |
local _, jwt_token = auth_header:find("Bearer%s+(.+)") | |
if jwt_token then | |
-- Perform subrequest to your API endpoint for token validation |
This is a list of my solutions for Functional Programming Challenge in hackerrank and solved with OCaml.