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
REVOKE ALL ON DATABASE demo_database FROM demo_user; | |
GRANT CONNECT ON DATABASE demo_database TO demo_user; | |
GRANT USAGE, CREATE ON SCHEMA public TO demo_user; | |
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO demo_user; | |
GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO demo_user; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO demo_user; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE ON SEQUENCES TO demo_user; |
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
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3 | |
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592 | |
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code. | |
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices. | |
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning. | |
- Follow the user’s requirements carefully & to the letter. |
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 domains = ['cnn.com']; | |
const content = 'Nope!'; | |
if (domains.includes(window.location.hostname.replace('www.',''))) { | |
document.body.style.backgroundColor = 'red'; | |
document.body.style.color = 'white'; | |
document.body.style.textAlign = 'center'; | |
document.body.style.fontWeight = 'bold'; | |
document.body.style.fontFamily = 'sans-serif'; | |
document.body.style.textTransform = 'uppercase'; |
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
def filtered_tracks(current_user) | |
tracks = current_user.tracks.limit(500) | |
rules = filters['rules'] | |
if rules.find {|h| h['id'] == 'track_name'}.present? | |
track_name = rules.find {|h| h['id'] == 'track_name'}['value'] | |
tracks = tracks.where('tracks.name ILIKE ?', '%' + track_name + '%') | |
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
class BuildAlbumSpotifyJob | |
include Sidekiq::Worker | |
sidekiq_options :queue => :default | |
def perform(artist_id) | |
artist = Artist.find artist_id | |
albums = RSpotify::Artist.find(artist.spotify_id).albums(limit:50, album_type: 'album,single') | |
albums.each do |album| |
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
// Paste in to Preferences > Sidebar Theme | |
#256BAD,#256BAD,#242E35,#FFFFFF,#242E35,#FFFFFF,#6DA94A,#DECC30 |
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
class LiveController < ApplicationController | |
include ActionController::Live | |
def stream | |
# Set the response header to keep client open | |
response.headers['Content-Type'] = 'text/event-stream' | |
begin | |
100.times { | |
response.stream.write("The temperature is #{ 100*rand} degrees\n") |
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
def animals | |
sheep.each do |horse| | |
# get 'em | |
end | |
cows.each do |cow| | |
# then get these | |
end | |
pigs.each do |pig| |
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
# Example to initialize gridster and handle resizing | |
# Module grid settings | |
WIDGET_BASE_DIMENSIONS_X = WIDGET_DESKTOP_X = 140 | |
WIDGET_BASE_DIMENSIONS_Y = 20 | |
WIDGET_CONTAINER_SELECTOR = '.widget-view' | |
WIDGET_MOBILE_CUTOFF_WIDTH = 768 | |
NUM_WIDGETS = 15 | |
$ -> |
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
Subject: Action Needed: Can't import your finacial data! | |
Hey <first name or friend>! | |
We're having trouble importing your financial bits in to LessAccounting. | |
Seems your login details are outdated for <insert bank name>. | |
So, to keep your financial details spot on, we need to make sure that data gets imported. |
NewerOlder