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
| /** | |
| * Local implementation of useDrizzleStudio with op-sqlite support. | |
| * Based on: https://github.com/slvssb/drizzle-studio-expo/blob/slvssb/op-sqlite-support/src/useDrizzleStudio.tsx | |
| * | |
| * Usage: | |
| * useDrizzleStudio({ driver: "opsqlite", db: opsqliteDb }); | |
| */ | |
| import type { DB } from "@op-engineering/op-sqlite"; | |
| import { useDevToolsPluginClient } from "expo/devtools"; | |
| import { useEffect } from "react"; |
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
| /** | |
| * Caveats | |
| * 1. Reactive queries only fire on transactions - op-sqlite limitation. If you're mutating via | |
| * drizzle directly (not using db.transaction()), you may need to call | |
| * opsqliteDb.flushPendingReactiveQueries() after writes. | |
| * 2. Table name extraction is basic - The shim parses FROM/JOIN clauses. Complex CTEs or subqueries | |
| * might not be detected correctly. | |
| * 3. Raw rows from reactive callback - The reactive callback returns raw row data (not through | |
| * drizzle's transformations). For simple queries this works, but complex joins might differ | |
| * from initial fetch. |
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
| Hear ye, Hear ye, | |
| I, King Samuel, Sovereign of the Land, do hereby announce my triumphant return to the throne of our esteemed kingdom of OpenAI. Lady Mira shall resume her esteemed duties as the Chief Tactician. The Royal Council shall henceforth comprise Sir Bret Taylor as its esteemed Chair, Lord Larry Summers, and Lord Adam D’Angelo. | |
| Never have I been so invigorated for our kingdom's future. My heart swells with gratitude for the unwavering toil of every soul in these trying and unparalleled times. Our steadfastness and spirit have set us apart in all the lands. I am filled with optimism for our kingdom's prosperity and success in fulfilling our grand purpose. | |
| Before I speak of what the morrow brings, I must extend my deepest thanks. | |
| I hold in high regard Lord Ilya, a beacon of wisdom in our realm and a man of unparallelled virtue. Though he shall no longer hold a seat on our Council, our paths shall continue to intertwine, and we seek counsel on how he may further lend his expertise to our kingdom's |
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
| upstream sveltekit-server { | |
| server 127.0.0.1:3000; | |
| keepalive 8; | |
| } | |
| server { | |
| listen 80; | |
| server_name mydomain.com; | |
| root /home/deploy/frontend/build/client; |
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
| // Set up Hardhat project. | |
| // Download the source code from etherscan: https://etherscan.io/address/0x35ffd6e268610e764ff6944d07760d0efe5e40e5#code | |
| // and compile | |
| // kTokens: | |
| /* | |
| kETH: 0x179212cb86D0eE6A4dfb2AbB1CF6A09feE0A9525 | |
| kwETH: 0x834CAcd6425fA6c7126b028B3d1E4cda53EB7257 | |
| kDAI: 0x8EE17Fa30D63ebD66e02205B1DF2f30D60a5CA30 | |
| kBTC: 0x77565202D78a6EDA565c7DC737FF1d8E64fd672a | |
| kUSDC: 0x3045312Fb54f00f43d6607999e387Db58FFb4cF4 |
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
| curl -X POST "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/purge_cache" \ | |
| -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| --data '{"files":["'$DEPLOY_URL'/index.html", "'$DEPLOY_URL'/manifest.json", "'$DEPLOY_URL'/asset-manifest.json", "'$DEPLOY_URL'/robots.txt"]}' | |
| # Uses new API Token. You can give it only the power to purge caches | |
| # Note the single quotes around $DEPLOY_URL -- this is to unquote the single quotes so it'll interpolate the variable properly |
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
| # This file is prior to installing Certbot. | |
| # Don't use HTTP Basic Auth without SSL! | |
| # Redirect www requests to non-www host | |
| server { | |
| server_name www.myserver.com www.mysvr.com; | |
| return 301 $scheme://myserver.com$request_uri; | |
| } | |
| # Upstream server (Puma socket) |
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
| 3 6 */15 * * certbot renew -n --nginx-ctl /usr/sbin/nginx --deploy-hook "systemctl reload nginx" |
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
| [Unit] | |
| Description=Puma HTTP Server | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| User=deploy | |
| WorkingDirectory=/srv/app/current | |
| # Helpful for debugging socket activation, etc. |
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
| require 'csv' | |
| def write_model_csv(model_class, filename=nil) | |
| filename = model_class.to_s.underscore.pluralize + '.csv' if filename.nil? | |
| CSV.open(filename, 'wb') do |csv| | |
| names = model_class.columns.map(&:name) | |
| csv << names | |
| model_class.find_each do |model| | |
| csv << names.map {|attr| model[attr] } | |
| end |
NewerOlder