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 have any session variables that should survive a logout, add them to | |
# the except_for array. Usage from a controller: | |
# | |
# ResetsSessionButItsStillThursdayINeedThese.new.reset(self, | |
# except_for: [:has_logged_in_before]) | |
class ResetsSessionButItsStillThursdayINeedThese | |
def reset(receiver, except_for: []) | |
backup = except_for.map { |key| [key, receiver.session[key]] } | |
receiver.reset_session |
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
# Clone llama.cpp | |
git clone https://github.com/ggerganov/llama.cpp.git | |
cd llama.cpp | |
# Build it | |
make clean | |
LLAMA_METAL=1 make | |
# Download model | |
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
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
# Basic key operators to query the JSON objects : | |
# #> : Get the JSON object at that path (if you need to do something fancy) | |
# -> : Get the JSON object at that path (if you don't) | |
# ->> : Get the JSON object at that path as text | |
# {obj, n} : Get the nth item in that object | |
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE | |
# Date | |
# date before today |
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
# Rails production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.2 |
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
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>UnifiedBar</key> | |
<dict> | |
<key>DisclosureRequired</key> | |
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string> | |
<key>Enabled</key> | |
<false/> |
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
// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e | |
// and @levelsio's https://gist.github.com/levelsio/a1ca0dd434b77ef26f6a7c403beff4d0 | |
// HOW TO | |
// 1) Make a new Metabase Question | |
// 2) Make the result an unique number and choose Visualization > Number | |
// 3) Write your metabase domain, your email and password below | |
const domain = "https://metabase.endpoint.com" | |
const username = "[email protected]" | |
const password = "p@ssw0rd" |
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
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: pink; icon-glyph: user; | |
// In order to use the script, you must create a Slack app and install it on your workspace. Go here to create your app: api.slack.com/apps | |
// There's two important configurations you must make to the app: | |
// 1. Add the users.profile:write scope to the app. This scope is necessary to set a Slack status. | |
// 2. Add the following redirect URL, so Slack will redirect to Scriptable after authorizing. | |
// https://open.scriptable.app | |
// Run the script to grant your newly created app authorization to access your Slack account. After you've done this, you can use the script in Shortcuts. |
NewerOlder