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
$env:OPENAI_API_KEY = "my-key" | |
function q { | |
[CmdletBinding()] | |
param( | |
[string]$File, | |
[switch]$Code, | |
[string]$Model, | |
[switch]$Help, | |
[Parameter(Position = 0, ValueFromRemainingArguments = $true)] |
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
docker run -it --rm --entrypoint /bin/bash -v /mnt/c/code:/tmp/code node:latest | |
npm install -g pnpm | |
export SHELL="bash" | |
pnpm setup | |
source /root/.bashrc | |
pnpm i -g @openai/codex | |
export OPENAI_API_KEY="key" | |
git config --global --add safe.directory /tmp/code | |
cd /tmp/vol | |
codex --model gpt-4.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
import guid from "./guid"; | |
import { ToastPluginApi, ActiveToast, useToast, ToastProps } from "vue-toast-notification"; | |
import { toastProps } from "./toastProps"; | |
export class ReusableToast { | |
private toast: ToastPluginApi = useToast(toastProps()); | |
private toastId: string = guid(); | |
private el = document.createElement("span"); | |
private instance: ActiveToast | null = 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
# Data from https://download.geonames.org/export/dump/readme.txt | |
# Add -c to compact and > for output. | |
# To simple array | |
jq -Rsn '[inputs | |
| . / "\n" | |
| (.[] | select(length > 0) | . / "\t") as $input | |
| {"location": $input[1], "lat": $input[4], "lon": $input[5], "country": $input[8]}] | |
' < data.txt | |
# Grouped by country |
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
# https://community.tp-link.com/us/home/forum/topic/553172?sortDir=ASC&page=5 | |
# https://github.com/qca/open-plc-utils | |
# Info | |
plcstat -i eth0 -t | |
plcstat -i eth0 -m | |
# Get PIB (Parameter Information Block) | |
plctool -i eth0 -p backup_local.pib AA:BB:CC:DD:EE:FF |
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
// date-extension.d.ts | |
interface Date { | |
getISOWeekNumber(): number; | |
} | |
// date-extension.ts | |
Date.prototype.getISOWeekNumber = function (): number { | |
const date = new Date(this.getTime()); // Create a copy of the current date | |
date.setUTCDate(this.getUTCDate() + 4 - (this.getUTCDay() || 7)); // Set to nearest Thursday (ISO 8601 week starts on Monday) | |
const yearStart = new Date(Date.UTC(date.getUTCFullYear(), 0, 1)); // Get the first day of the year |
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
#In PowerShell | |
$env:DISPLAY="127.0.0.1:0.0" | |
ssh -Y <your_user_id>@<server_address> | |
#In Linux | |
export DISPLAY=localhost:10.0 |
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
configure | |
delete protocols static route [ip-addr]/32 next-hop 192.168.2.99 disable | |
set protocols static route [ip-addr]/32 next-hop 192.168.2.99 disable | |
commit |
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
import { define } from '@selectize/selectize'; | |
define('autofill_off', function (options) { | |
// eslint-disable-next-line @typescript-eslint/no-this-alias | |
var self = this; | |
self.setup = (function () { | |
var original = self.setup; | |
return function () { | |
original.apply(self, arguments); | |
self.$control_input.attr({ autocomplete: "one-time-code", autofill: "no" }); |
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
# finding expired passwords | |
$userid = 'user@domain.com' | |
$user = Get-MgUser -UserId $userid | |
Get-MgUserOwnedObjectAsApplication -UserId $user.Id | Select-Object DisplayName,Id,AppId,@{e={$_.PasswordCredentials?[0].EndDateTime}} | |
# cleaning passwords | |
$app = Get-MgApplication -ApplicationId app-guid | |
Update-MgApplication -ApplicationId $app.Id -BodyParameter @{ PasswordCredentials = @() } | |
# updating redirect uris (for spa) |
NewerOlder