Skip to content

Instantly share code, notes, and snippets.

@Shpigford
Shpigford / .cursorrules
Last active July 22, 2024 19:59
Cursor Rules
# 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.
@Shpigford
Shpigford / content.js
Created August 25, 2022 00:18
Arc Boost for blocking distracting sites
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';
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
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|
@Shpigford
Shpigford / gist:7a1d48013d2dad64873c
Created September 8, 2014 11:21
Slack Sidebar Theme
// Paste in to Preferences > Sidebar Theme
#256BAD,#256BAD,#242E35,#FFFFFF,#242E35,#FFFFFF,#6DA94A,#DECC30
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")
def animals
sheep.each do |horse|
# get 'em
end
cows.each do |cow|
# then get these
end
pigs.each do |pig|
# 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
$ ->
@Shpigford
Shpigford / Failed Bank Import email.
Last active December 24, 2015 12:29 — forked from lessallan/Failed Bank Import email.
Not really any shorter, but definitely less dry and more human.
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.
@Shpigford
Shpigford / gist:6158106
Last active December 20, 2015 15:59
Temper email subject line to PopSurvey.com customers...
Which of these do you think would work best? Emailing this out to all our PopSurvey customers to let them know about Temper. They've never heard of Temper but the product (and "customer happiness") are something most are interested in.
* Track customer happiness with Temper, a new tool by PopSurvey
* Announcing Temper: A new tool to track customer happiness by PopSurvey
* PopSurvey launches new tool to track customer happiness!
* New from PopSurvey - Track Customer Happiness with Temper
* Increase customer satisfaction with Temper, a new tool by PopSurvey
...or something else?