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
function getHrefFromAnchors() { | |
// Find all anchor elements with the specified classes | |
const anchors = document.querySelectorAll('a.link-stretched.text-inherit'); | |
// Convert NodeList to Array and extract href attributes | |
const hrefs = Array.from(anchors).map(anchor => { | |
// Type assertion to HTMLAnchorElement since we know these are anchor elements | |
return anchor.href; | |
}); |
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
{ | |
"name": "Weekin WK-50", | |
"vendorId": "0xFEE5", | |
"productId": "0x6036", | |
"lighting": "qmk_rgblight", | |
"matrix": { "rows": 4, "cols": 14 }, | |
"layouts": { | |
"keymap": [ | |
[ | |
{ |
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
[core] | |
sshCommand = ssh -i ~/.ssh/<work_private_key> | |
[user] | |
email=<org email> | |
name = <username> |
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
local hyperShift = { "ctrl", "shift" } | |
hs.hotkey.bind(hyperShift, "`", function() | |
local screen = hs.mouse.getCurrentScreen() | |
local nextScreen = screen:next() | |
local rect = nextScreen:fullFrame() | |
local center = hs.geometry.rectMidPoint(rect) | |
hs.mouse.setAbsolutePosition(center) | |
end) |
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
use petgraph::graph::{UnGraph}; | |
use petgraph::Direction; | |
use petgraph::visit::IntoNodeReferences; | |
#[derive(Debug)] | |
struct Pokemon { | |
name: String | |
} | |
impl Pokemon { |
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 ACTIVE_LINE = 'active-line-number' | |
const LINE_NUMBER = 'div.line-numbers' | |
function setRelativeLineNumber() { | |
let allLines = Array.from(document.querySelectorAll(LINE_NUMBER)) | |
let activeLineIndex = allLines.findIndex(line => line.classList.contains(ACTIVE_LINE)) | |
if (allLines[activeLineIndex].innerHTML == ' ') { | |
return; | |
} | |
for (let i = 0; i < allLines.length; i++) { | |
let line = allLines[i]; |
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
def reverse_each_word(s: str) -> str: | |
l = 0 | |
ss = list(s) | |
length = len(ss) | |
while l < length: | |
if ss[l] == ' ': | |
l+=1 | |
while l < length and ss[l] == ' ': | |
l+=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
# Shows navigable menu of all options when hitting Tab | |
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete | |
Invoke-Expression (&starship init powershell) | |
Import-Module posh-git | |
Import-Module DockerCompletion | |
Import-Module PSReadLine |
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 openai | |
from llama_index import SimpleDirectoryReader, GPTVectorStoreIndex, LLMPredictor, PromptHelper, ServiceContext, StorageContext, load_index_from_storage | |
from langchain import OpenAI | |
import gradio as gr | |
import os | |
openai.api_key = os.environ["OPENAI_API_KEY"] | |
max_input_size = 4096 | |
num_outputs = 512 |
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 games | |
import "fmt" | |
type Game interface { | |
GetName() string | |
Run() []string | |
} |
NewerOlder