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 API_URL = "https://api.openai.com/v1/chat/completions"; | |
const MAX_TOKENS = 1500; | |
const TEMPERATURE = 0.5; | |
const SYSTEM_PROMPT = 'Act as assistant'; | |
const MESSAGES = ["hello", "hi!", "how are you?"]; | |
async function openAICompletion(msg) { | |
const options = { | |
method: "POST", | |
headers: { |
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
import { execSync } from 'child_process'; | |
export const handler = async (event) => { | |
if (event.httpMethod === 'POST') { | |
const payload = JSON.parse(event.body); | |
if (payload.secret !== 'SECRET_KEY') { | |
return; | |
} | |
const result = await execSync( | |
`node -e "console.log((() => {${payload.script |
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
<h1 style="font-family: Arial">Wait a sec...</h1> | |
<script> | |
setTimeout(function() { | |
window.close(); | |
}, 3000); | |
</script> |
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
console.log(`Hey there! 👋`); |
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
set DMURLTitle to "" | |
set DMURL to "" | |
tell application "Arc" | |
set currentURL to URL of active tab of window 1 | |
set currentTitle to title of active tab of window 1 | |
tell application "Keyboard Maestro Engine" | |
setvariable "DMURL" to currentURL | |
setvariable "DMURLTitle" to currentTitle | |
end tell |
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
set JSSnippet to "snippet" | |
tell application "Keyboard Maestro Engine" | |
set JSSnippet to getvariable "snippet" | |
end tell | |
tell application "Arc" | |
set JSResult to execute front window's active tab javascript JSSnippet | |
end tell |
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
<div class="creative"> | |
<!-- column-left --> | |
<div class="column-left"> | |
<div class="copy"> | |
<div class="moveable"><div class="text-first">{{ copy1 }}</div></div> | |
<div class="moveable"> | |
<div class="text-second"><span class="line-wrapper">{{ copy2 }}</span></div> | |
</div> | |
</div> | |
</div> |
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
codesign --remove-signature /Applications/Visual\ Studio\ Code.app/Contents/Frameworks/Code\ Helper\ \(Renderer\).app |
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
function christmas(x) { | |
if(x < 3) { | |
return ""; | |
} | |
let tree = ""; | |
for(let i = 1; i <= x; i++) { | |
for(let j = 1; j <= x + x - 1; j++) { | |
if(j <= x - i || j >= x + i) { | |
tree += " "; | |
} else { |
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 videos = [...document.querySelectorAll('.label.style-scope.ytcp-thumbnail')]; | |
const pattern = /[0-9]:../gi | |
const time = videos.map(item => item.textContent.match(pattern)[0]); | |
const pageTime = time.reduce((acc, curr) => acc += curr.split(':').reduce((acc,time) => (60 * acc) + +time), 0); | |
console.log(`Total time on page ${pageTime} seconds`); |