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
{ | |
"name": "quack" | |
} |
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
#!/bin/bash | |
# Clone or download the sources (it's done for you at below) | |
# You should most definitely read the ANDROID notes to see the exact command. A lot of the scripts online are outdated for the 1.X branches | |
# You basically need to set the ANDROID_NDK_HOME variable for this script to work | |
# Generating the dylibs was failing for me, so disabled it for now | |
#set -v | |
set -ex |
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 Cocoa | |
class _FileIcon: NSView { | |
let image = NSImageView() | |
@objc var url: NSString = "" { | |
didSet { | |
self.setupView() | |
} | |
} |
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 Cocoa | |
import SDWebImage | |
class InternalWebImage: NSView, NSDraggingSource, NSPasteboardItemDataProvider { | |
let image = NSImageView() | |
@objc var url: NSString = "" { | |
didSet { | |
self.setupView() | |
} |
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 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 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 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 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 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(() => { |
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
// If you are using crashlytics and you cannot update to the latest versions of react-native-firebase (or need sourcemaps which is doesn't support) adding middleware to the error handling can at least provide you with an error stack | |
//Define an error handler to upload thet stack to crashlytics | |
const defaultHandler = global.ErrorUtils.getGlobalHandler() | |
const crashlytics = firebase.crashlytics() | |
global.ErrorUtils.setGlobalHandler((...args) => { | |
const error = args[0] || 'Unknown' | |
//console.log('Crashlytics error sent', error); | |
if (error instanceof Error) { |
NewerOlder