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 override = (name, func, callback) => { | |
return (...args) => { | |
let ret = func(...args); | |
callback(name, func, args, ret) | |
return ret; | |
}; | |
}; | |
console.error = override("console.error", console.error, (name, func, args, ret)=>{ |
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
all=*/ | |
for i in $all | |
do | |
if [ -d $i ]; then | |
cd $i | |
git pull | |
cd .. | |
fi | |
done |
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
alias pastesafsata='curl -s https://api.openai.com/v1/engines/text-davinci-002/completions \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer !!!!!!!! ENTER YOUR TOKENNN" \ | |
-d "{ | |
\"prompt\": \"Tweet: $(pbpaste)\n\n/\/\What kinda logical fallcy this tweet includes? Why?\n\", | |
\"temperature\": 0.5, | |
\"max_tokens\": 60, | |
\"top_p\": 1, | |
\"frequency_penalty\": 0, | |
\"presence_penalty\": 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
package main | |
import ( | |
"bufio" | |
"context" | |
"fmt" | |
"io" | |
"os/exec" | |
) |
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
package main | |
import ( | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
"os/signal" | |
"syscall" |
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
javascript:(()=>{let e,t=document.getElementsByTagName("p"),n=document.getElementsByTagName("font");e=t.length>n.length?t:n;var o=document.createElement("style");o.textContent="b { font-weight: bold; !important }",document.head.appendChild(o);for(let t of e){const e=t.innerText.split(" ").map((e=>{const t=e.length,n=Math.round(t/2);return`<b>${e.slice(0,n)}</b>${e.slice(n)}`}));t.innerHTML=e.join(" ")}})(); |
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 problem = { | |
operators: { | |
has: (possibility, numbers, has) => possibility.reduce((acc, cur) => numbers.includes(cur) ? acc + 1 : acc, 0) === has, | |
rightPlace: (possibility, numbers) => possibility.some(x => possibility.indexOf(x) === numbers.indexOf(x)), | |
}, | |
possibilities: Array.from(Array(1000).keys()).map(x => x.toString().padStart(3, '0').split('').map(x => parseInt(x))), | |
sets: [ | |
{ numbers: [6, 9, 0], has: 1, rightPlace: true }, // One number is correct and right place | |
{ numbers: [7, 4, 1], has: 1, rightPlace: false }, // One number is correct but wrong place | |
{ numbers: [5, 0, 4], has: 2, rightPlace: false }, // Two numbers are correct but wrong place |
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 axios = require('axios'); | |
const url = "https://www.mediaserver.express/" | |
const rtmp = "rtmp://ingest.mediaserver.express/live/" | |
const player = "https://www.mediaserver.express/v/" | |
const hls = "https://www.mediaserver.express/live/streamId/index.m3u8" | |
const ffmpegTest = "ffmpeg -r 30 -f lavfi -i testsrc -vf scale=1280:960 -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -f flv" | |
const serializeStream = (streamkey) => { | |
let streamId = streamkey.split("?")[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
gh repo list myorgname --limit 1000 | while read -r repo _; do | |
gh repo clone "$repo" "$repo" -- -q 2>/dev/null || ( | |
cd "$repo" | |
git checkout -q main 2>/dev/null || true | |
git checkout -q master 2>/dev/null || true | |
git pull -q | |
) | |
done |
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
kubectl get pods -A -o json | jq -r '.items[] | "\(.metadata.name) \(.metadata.namespace) \(.spec.containers[]?.ports[]?.containerPort)"' | awk '{print $1"."$2".svc.cluster.local:"$3}' | grep -v null | |
kubectl get svc -A -o json | jq -r '.items[] | "\(.metadata.name) \(.metadata.namespace) \(.spec.ports[]?.port)"' | awk '{print $1"."$2".svc.cluster.local:"$3}' | grep -v null | |
kubectl get endpoints -A -o json | jq -r '.items[] | "\(.metadata.name) \(.metadata.namespace) \(.subsets[]?.ports[]?.port)"' | awk '{print $1"."$2".svc.cluster.local:"$3}' | grep -v null |