- GitHub Staff
- https://www.smockle.com/
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 zsh | |
# | |
# --- SETUP --- | |
# | |
# 1. Clone https://github.com/ggerganov/llama.cpp. | |
# 2. In the `models` directory, clone https://github.com/facebookresearch/llama. |
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
// To use in the Node.js REPL: | |
// const { getAverage, getStandardDeviation } = await import("./stddev.mjs"); | |
// @ts-check | |
export function getAverage(...values) { | |
return values.reduce((sum, value) => sum + value, 0) / values.length; | |
} | |
export function getStandardDeviation(...values) { | |
const average = getAverage(...values); | |
const squaredDifferences = values.map((value) => |
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 node | |
//@ts-check | |
const branchName = process.argv[2]; | |
if (!branchName) { | |
throw new TypeError(`Expected a branch name but did not receive one.`) | |
} | |
const validCharactersRegExp = /[a-zA-Z0-9\-\_]/; | |
const validCharacters = [ | |
[ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" ], |
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 node | |
//@ts-check | |
const MAX_CONCURRENCY = 3; | |
function sayHiAsync() { | |
console.log("marco"); | |
return new Promise((resolve) => { | |
console.log("polo"); | |
setTimeout(() => { |
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 node | |
// @ts-check | |
const geoip = require('geoip-lite'); | |
function memoryUsageInMegabytes() { | |
const memoryUsageInBytes = process.memoryUsage(); | |
const memoryUsageInMegabytes = {}; | |
for (const key in memoryUsageInBytes) { | |
memoryUsageInMegabytes[key] = `${(memoryUsageInBytes[key] / 1000000).toFixed(2)}MB`; | |
} |
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 node | |
// @ts-check | |
const fs = require("fs"); | |
const { spawn } = require("child_process"); | |
const ipAddressRegExp = /\((?<ipAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\)/; | |
const macAddressRegExp = /(?<macAddress>[a-fA-F\d]{1,2}:[a-fA-F\d]{1,2}:[a-fA-F\d]{1,2}:[a-fA-F\d]{1,2}:[a-fA-F\d]{1,2}:[a-fA-F\d]{1,2})/; | |
function normalizeMACAddress(macAddress) { | |
return macAddress |
# Set timezone
sudo timedatectl set-timezone "America/Los_Angeles"
# DNS servers
sudo vi /etc/dhcpcd.conf
# static domain_name_servers=1.1.1.1 1.0.0.1
# Install kelvin
$ mkdir -p ~/Downloads && cd $_
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 array = []; | |
for (let i = 1; i <= 100; i++) { | |
let x = ''; | |
if (i % 3 === 0) { x += 'Fizz'; } | |
if (i % 5 === 0) { x += 'Buzz'; } | |
if (x.length === 0) { x = i; } | |
array.push(x) | |
} | |
console.log(array.join('\n')); |
NewerOlder