A Pen by Barrett Sonntag on CodePen.
This file contains 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
/* | |
Given n, i.e. total number of nodes in an undirected graph numbered | |
from 1 to n and an integer e, i.e. total number of edges in the | |
graph. Calculate the total number of connected components in the graph. | |
A connected component is a set of vertices in a graph that are linked | |
to each other by paths. | |
O(E^2 log E) | |
mine un-sorted: 15421ms | |
mine un-sorted and Set nodes: 41ms |
This file contains 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
function extractJobs(linkedInResponse) { | |
const jobs = []; | |
const jobElements = linkedInResponse?.data?.data?.searchDashClustersByAll?.elements?.[0]?.items || []; | |
const jobDetails = linkedInResponse?.included || []; | |
jobElements.forEach(({ item }) => { | |
const entityUrn = item?.["*entityResult"]; | |
if (!entityUrn) return; |
This file contains 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
// expand all folders before running and | |
// zoom out so all guild icons are visible | |
function extractAndProcessIds() { | |
const elements = document.querySelectorAll('[data-list-item-id^="guildsnav___"]'); | |
const uniqueIdsArray = Array.from(elements) | |
.map(el => el.getAttribute('data-list-item-id').replace('guildsnav___', '')) | |
.filter(id => !isNaN(id)) | |
.reduce((acc, id) => { |
This file contains 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 ts-node | |
/** | |
* Used this Huggingface space to create a JSON formatted file | |
* https://huggingface.co/spaces/Xenova/whisper-speaker-diarization | |
* | |
* https://huggingface.co/onnx-community/whisper-base_timestamped | |
* https://huggingface.co/onnx-community/pyannote-segmentation-3.0 | |
* https://huggingface.co/pyannote/segmentation-3.0 | |
*/ |
This file contains 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
/** | |
* Created by Barrett Sonntag barretts@github on 3/2/2015. | |
* http://www.sosuke.com/writing-custom-extensions-for-the-remarkable-javascript-markdown-parser | |
* | |
* A plugin tutorial for Remarkable https://github.com/jonschlinkert/remarkable | |
*/ | |
var markdownParser = new Remarkable(); | |
// open links in new windows |
This file contains 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
$amiInfo = aws ec2 describe-images --owners self --query 'Images[*].{ImageId:ImageId, CreationDate:CreationDate, Name:Name}' --output json | ConvertFrom-Json | |
$amiResults = @() | |
# $count = $amiInfo.Length; | |
# Write-Host "getting data for $count AMIs" | |
foreach ($ami in $amiInfo) { | |
$amiId = $ami.ImageId | |
$creationDate = $ami.CreationDate |
This file contains 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
function CallWhenDoneFunc { | |
$mergedCmd = $args -join " " | |
Invoke-Expression $mergedCmd | |
# use content in payload for discord instead of text | |
$hookUrl = "https://hooks.slack.com/services/yoururlgoeshere" | |
$content = "Finished $mergedCmd" | |
$payload = [PSCustomObject]@{ | |
text = $content | |
} |
This file contains 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
DELIMITER ;; | |
DROP PROCEDURE IF EXISTS Delete_roletouser_Duplicates;; | |
CREATE PROCEDURE Delete_roletouser_Duplicates() | |
BEGIN | |
DECLARE lmt INT DEFAULT 0; | |
DECLARE done INT DEFAULT 0; | |
DECLARE _role_id CHAR(36); |
This file contains 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/python3 | |
# Usage | |
# 0 * * * * /home/badguy90/bin/change_detection.py | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
import difflib | |
import hashlib |
NewerOlder