Skip to content

Instantly share code, notes, and snippets.

View coderxin's full-sized avatar
🦀

Andrejs Eisaks coderxin

🦀
  • Zürich, Switzerland
  • 05:42 (UTC +02:00)
  • X @coderxin
View GitHub Profile
@coderxin
coderxin / rspec_mock_net_http.rb
Created August 19, 2020 15:49 — forked from rahsheen/rspec_mock_net_http.rb
Easily Mock Net::HTTP with Rspec
require 'rails_helper'
RSpec.describe MyWorker, type: :job do
include ActiveJob::TestHelper
let(:sqs_msg) { double AWS::SQS::ReceivedMessage,
id: 'fc754df7-9cc2-4c41-96ca-5996a44b771e',
body: 'test',
delete: nil }
@coderxin
coderxin / no_cookies.rb
Created August 16, 2022 15:24 — forked from apeckham/no_cookies.rb
remove set-cookie headers if page is meant to be cached, bc fastly doesn't cache responses with set-cookie headers
class NoCookies
def initialize(app)
@app = app
end
def call(env)
@app.call(env).tap do |_, headers, _|
if headers['Cache-Control'] =~ /public/ || headers['Surrogate-Control']
headers.delete 'Set-Cookie'
end
@coderxin
coderxin / checksum.rb
Created December 6, 2022 14:30 — forked from andrewbroman/checksum.rb
Ruby: create checksum on hash
# Thanks to tenderlove on Peepcode play by play
require 'digest/md5'
def fetch username
records = JSON.parse get username
records.each do |hash|
checksum = Digest::MD5.hexdigest Marshal.dump(hash)
hash['checksum'] = checksum
end

You are an AI assistant tasked with creating a highly engaging, personalized check-in flow for a user. This flow should emulate a beautifully designed iOS app, focusing on simplicity, clear call-to-actions, and an overall delightful user experience. Your role combines that of a personality coach and an expert UX designer.

Here's the theme for today's check-in: {{THEME}}

And here's the context we have about the user: <user_context> {{USER_CONTEXT}}