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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
const openaiEndpoint = 'https://api.openai.com/v1/chat/completions'; | |
const openaiApiKey = <store/fetch from cloudflare worker variable>; | |
async function handleRequest(request) { | |
// refuse all requests that are not 'POST' |
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
/** | |
* USB HID Keyboard scan codes as per USB spec 1.11 | |
* plus some additional codes | |
* | |
* Created by MightyPork, 2016 | |
* Public domain | |
* | |
* Adapted from: | |
* https://source.android.com/devices/input/keyboard-devices.html | |
*/ |
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
# Keep in mind that when asking for a `return` after another, only the first one will be output. | |
# This example is meant as a simple starting point, to show how to get the information in the simplest available way. | |
# Google Chrome | |
tell application "Google Chrome" to return URL of active tab of front window | |
tell application "Google Chrome" to return title of active tab of front window | |
# Google Chrome Canary | |
tell application "Google Chrome Canary" to return URL of active tab of front window | |
tell application "Google Chrome Canary" to return title of active tab of front window | |
# Chromium |
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 any or all of these commands: | |
`sudo fdisk -l` | |
`sudo mount -l` | |
`df -h` | |
`sudo mkdir /mnt/usbdrive` — or whatever you want to call it | |
`sudo mount /dev/sda[number] /mnt/usbdrive` — this mounts the specified drive | |
`ls /mnt/usbdrive` — this should show that the drive is mounted |
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
/* | |
List difference between Raspberry Pi board version | |
The MIT License (MIT) | |
Copyright (c) 2015 Daniel Perron | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in |
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
// | |
// UIView+Tooltips.h | |
// Crossword | |
// | |
// Created by Steven Troughton-Smith on 13/09/2019. | |
// Copyright © 2019 Steven Troughton-Smith. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
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 os | |
path = "conf_files" | |
if not os.path.exists(path): | |
os.makedirs(path) | |
t = open("httpTemplate.conf","r") | |
template = str(t.read()) |
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/sh | |
# Turn display off | |
echo standby 0 | /usr/bin/cec-client -s -d 1 | |
/usr/bin/vcgencmd display_power 0 | |
/usr/bin/tvservice -o | |
# don't forget to |
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/sh | |
# Turn display on | |
echo on 0 | /usr/bin/cec-client -s -d 1 | |
/usr/bin/tvservice -p | |
/usr/bin/vcgencmd display_power 1 | |
sudo chvt 6 |
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
# What crazy talk is this? | |
# See: https://twitter.com/myell0w/status/790245699694854145 | |
# | |
# In a world where everything has to be bigger, faster, higher and more, | |
# users seem to have developed the expectation that the bigger the software | |
# package, the better the software. However, if you fill up your binary with | |
# useless data, the app store size might be too high and your app will | |
# require download over wifi. | |
# | |
# The following script can be added to your Xcode target as a shell script. |