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
/* | |
* GNU GENERAL PUBLIC LICENSE | |
* Version 3, 29 June 2007 | |
* | |
* Copyright (C) [2023] [Captain Vincent] | |
* Original Source: https://gist.github.com/CaptainVincent/74a15cd9d9c450e961b867f69008ee6e | |
* | |
* Everyone is permitted to copy and distribute verbatim copies of this license document, | |
* but changing it is not allowed. | |
* |
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": "quack" | |
} |
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
#!/bin/bash | |
# This script builds openSSL from source for the Android platform | |
# while patching some hand-written assembly that fails on Android | |
# It's useful when trying to use OpenSSL in Rust which tries to | |
# from the official sources and will therefore fail when launching | |
# your crate on Android | |
# Link to the main PR that fixes the sources: |
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 Cocoa | |
class _FileIcon: NSView { | |
let image = NSImageView() | |
@objc var url: NSString = "" { | |
didSet { | |
self.setupView() | |
} | |
} |
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 Cocoa | |
import SDWebImage | |
class InternalWebImage: NSView, NSDraggingSource, NSPasteboardItemDataProvider { | |
let image = NSImageView() | |
@objc var url: NSString = "" { | |
didSet { | |
self.setupView() | |
} |
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 fs = require("fs"); | |
const graph = {}; | |
const file = fs.readFileSync("output2").toString(); | |
file | |
.split("\n") | |
.map(l => l.trim()) | |
.map(l => l.split(" -> ")) |
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
#!/opt/homebrew/bin/zsh | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title BodyFast Workspaces | |
# @raycast.mode compact | |
# Optional parameters: | |
# @raycast.icon ♻️ |
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
#!/bin/bash | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Show WiFi Password | |
# @raycast.mode silent | |
# Optional parameters: | |
# @raycast.icon 📶 | |
# @raycast.packageName Show WiFi Password |
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
export function useEventListener(eventName: string, handler: () => void) { | |
let savedHandler = useRef<() => void>() | |
useEffect(() => { | |
savedHandler.current = handler | |
}, [handler]) | |
useEffect(() => { | |
let eventListener = () => savedHandler.current?.() | |
[Your event emitter here].addListener(eventName, eventListener) |
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
export function useInterval (callback: () => void, delay: number) { | |
const savedCallback = useRef() | |
// Remember the latest callback. | |
useEffect(() => { | |
savedCallback.current = callback | |
}, [callback]) | |
// Set up the interval. | |
useEffect(() => { |
NewerOlder