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
#!/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 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 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 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 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 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 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 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", |
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
// .../api-data/data/createPokeData.js | |
import { readdirSync, readFileSync, writeFileSync } from 'fs'; | |
import { dirname, join } from 'path'; | |
import { fileURLToPath } from 'url'; | |
const baseDir = dirname(fileURLToPath(import.meta.url)); | |
const pokemonDir = join(baseDir, 'api', 'v2', 'pokemon'); | |
const outDir = join(baseDir, 'out'); |
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
# Install Postgres if not exists | |
which psql | |
if [ "$?" -ne 0 ] | |
then | |
echo "Installing Postgres..." | |
sudo apt-get install postgresql --yes | |
echo "Altering password for user 'postgres'" | |
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'password';" | |
else |
NewerOlder