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 | |
# Usage: ./generate_clips.sh input_video.mp4 [clip_duration_seconds] | |
# Example: ./generate_clips.sh my_video.mp4 180 | |
# Example: ./generate_clips.sh my_video.mp4 300 | |
# Check if input file is provided | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 <input_video> [clip_duration_seconds]" | |
echo "Example: $0 my_video.mp4 180" |
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
type AirtableFilter = { | |
key: string; | |
operator: 'equals' | 'includes'; | |
value: string | number; | |
}; | |
function getFilterByFormula(filters: AirtableFilter[]) { | |
if (!filters || filters.length === 0) { | |
return null; | |
} |
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 | |
# Manual zsysctl gc | |
clear | |
garbagespace= | |
kernelscount= | |
kernelstrim= | |
check () { | |
garbagespace=$(zpool list | awk -F '[% ]+' '/bpool/ {print $8}') | |
kernelscount=$(zsysctl show --full | grep -c -C 2 Kernel) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<!-- Generated by: TmTheme-Editor --> | |
<!-- ============================================ --> | |
<!-- app: http://tmtheme-editor.herokuapp.com --> | |
<!-- code: https://github.com/aziz/tmTheme-Editor --> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>GitHub Dark</string> |
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
export const getPositionToInsert = ( | |
numbers: number[], | |
numberToInsert: number | |
) => { | |
if (numberToInsert < numbers[0]) return 0; | |
if (numberToInsert > numbers[numbers.length - 1]) return numbers.length; | |
const getIndex = (start: number, end: number): number => { | |
if (numbers[start] === numberToInsert) return start; | |
if (numbers[end] === numberToInsert) return end; |
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
:root { | |
/* Light Theme */ | |
--shiki-color-text: #24292f; | |
--shiki-color-background: #f6f8fa; | |
--shiki-token-constant: #0550ae; | |
--shiki-token-string: #0a3069; | |
--shiki-token-comment: #6e7781; | |
--shiki-token-keyword: #cf222e; | |
--shiki-token-parameter: #116329; | |
--shiki-token-function: #8250df; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Json to PDF</title> | |
<script src="https://unpkg.com/jspdf@2.5.1/dist/jspdf.umd.min.js"></script> | |
</head> | |
<body></body> |
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
// Tick structure reference: https://kite.trade/docs/connect/v3/websocket/#message-structure | |
const parseBinary = (dataView: DataView) => { | |
const numberOfPackets = dataView.getInt16(0); | |
let index = 4; | |
const ticks: { token: number; firstBid: number; firstAsk: number }[] = []; | |
for (let i = 0; i < numberOfPackets; i++) { | |
const size = dataView.getInt16(index - 2); | |
// Parse whatever you need |
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 pool = 151; // use the pool of your choice: 151 for Gen-1, etc. | |
const showName = false; // determines if the name of the Pokemon should be displayed or not | |
// Get data | |
const apiRequest = new Request( | |
`https://pokeapi.deno.dev/pokemon/potd?pool=${pool}` | |
); | |
const pokemon = await apiRequest.loadJSON(); | |
const imageRequest = new Request(pokemon.imageUrl); | |
const image = await imageRequest.loadImage(); |
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
let input = [{ | |
"id": "REPORT1", | |
"application": "APP1", | |
"type": "TYPE1", | |
"title": "" | |
}, | |
{ | |
"id": "REPORT2", | |
"application": "APP1", | |
"type": "TYPE1", |
NewerOlder