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
#!/usr/bin/env python3 | |
# <xbar.title>BitGPT</xbar.title> | |
# <xbar.version>v0.1</xbar.version> | |
# <xbar.author>Erik de Bruijn</xbar.author> | |
# <xbar.author.github>ErikDeBruijn</xbar.author.github> | |
# <xbar.desc>Performs ChatGPT prompts on the clipboard and returns the result on the paste buffer.</xbar.desc> | |
# <xbar.image>http://www.hosted-somewhere/pluginimage</xbar.image> | |
# <xbar.dependencies>python</xbar.dependencies> | |
# <xbar.abouturl>https://erikdebruijn.nl/</xbar.abouturl> | |
# <xbar.var>string(OPENAI_API_KEY="your-open-ai-key"): Your openAI key. Find it here: https://platform.openai.com/account/api-keys</xbar.var> |
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
// You can use this as a boost! | |
// This code can be found at: https://gist.github.com/ErikDeBruijn/4d85042d0bd3be54b80e57593dccd20e | |
function showNotice(message) { | |
// Create a new div element for the notice | |
const noticeDiv = document.createElement('div'); | |
noticeDiv.className = 'notice'; | |
noticeDiv.innerHTML = message; | |
// Apply the CSS styles |
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
module TeslaApi | |
module Stream | |
def self.streaming_endpoint_url | |
'wss://streaming.vn.teslamotors.com/streaming/' | |
end | |
def self.streaming_endpoint | |
Async::HTTP::Endpoint.parse(streaming_endpoint_url, alpn_protocols: Async::HTTP::Protocol::HTTP11.names) | |
end |
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
#!/usr/bin/env ruby | |
#BitBar Metadata | |
# <bitbar.title>Power generation and supply to chargers</bitbar.title> | |
# <bitbar.version>v0.1</bitbar.version> | |
# <bitbar.author>Erik de Bruijn</bitbar.author> | |
# <bitbar.author.github>Erik de Bruijn</bitbar.author.github> | |
# <bitbar.desc>Displays the power output of the solar array and supply to the charging stations.</bitbar.desc> | |
require 'net/http' | |
require 'uri' |
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
#!/usr/bin/env ruby | |
#BitBar Metadata | |
# <bitbar.title>Frequency of the synchronous grid</bitbar.title> | |
# <bitbar.version>v0.1</bitbar.version> | |
# <bitbar.author>Erik de Bruijn</bitbar.author> | |
# <bitbar.author.github>Erik de Bruijn</bitbar.author.github> | |
# <bitbar.desc>Displays the current frequency of the grid and the time it is ahead or lagging.</bitbar.desc> | |
# | |
# This script in to be used with Bitbar as a toolbar plugin for OS X. | |
# It will display the grid freqency and time offset compared to the actual time (leading/lagging seconds) |
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
# ZSH functions to quickly make and merge a PR on Github | |
# Use it from a repository, but set up gh first (`brew install gh && gh`) | |
# https://gist.github.com/ErikDeBruijn/a3767e448d82349cbf41561625289cf1/ | |
qmerge () { | |
if [[ "$1" != "NESTED" ]] | |
then | |
echo -n Seeing if we can merge it... | |
fi | |
SLEEP_SECONDS=5 |
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
#!/usr/bin/env ruby | |
# THIS IS A WORK IN PROGRESS TOOL | |
def get_changed_files | |
files = `git diff --name-only |grep .rb`.split("\n").map do |f| | |
f2 = f.split('/') ; f2.shift ; f2.join('/') | |
end | |
files_new = [] | |
files.each do |f| |
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
IRB.conf[:SAVE_HISTORY] = 2000 | |
IRB.conf[:HISTORY_FILE] = '~/.irb-history' | |
def app_prompt | |
rails_klass = Rails.application.class | |
app_name = | |
if rails_klass.respond_to? :module_parent | |
rails_klass.module_parent | |
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
#!/usr/bin/env bash | |
set -eu | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' | |
NO_COLOR='\033[0m' | |
CLEAR_LINE='\r\033[K' |
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
echo "This utility will install an app based on an .aab to your Android device" | |
echo "Plug in your Android device and enable dev mode USB debugging." | |
ls /usr/local/Cellar/bundletool/*/bin/bundletool 1>/dev/null || brew install bundletool | |
bt=$(ls /usr/local/Cellar/bundletool/*/bin/bundletool |head -n1) | |
mkdir /tmp/apks | |
cd /tmp/apks | |
$bt build-apks --bundle $1 --output build.apks | |
echo "Waiting for your device to be connected and authorized..." | |
adb wait-for-usb-any && \ |
NewerOlder