Skip to content

Instantly share code, notes, and snippets.

View tadast's full-sized avatar

Tadas Tamošauskas tadast

View GitHub Profile
@tadast
tadast / Paint slack black.md
Last active July 14, 2023 04:00
Update the Mac Desktop slack CSS

In the console

export SLACK_DEVELOPER_MENU=true
open /Applications/Slack.app

In slack UI

right-click on anything -> inspect element

@tadast
tadast / with_active_support.rb
Last active December 10, 2018 11:41 — forked from mbyczkowski/with_active_support.rb
session cookie decrypter for Rails 5.1
require 'cgi'
require 'json'
require 'active_support'
def verify_and_decrypt_session_cookie(cookie, secret_key_base = Rails.application.secrets.secret_key_base)
cookie = CGI::unescape(cookie)
salt = 'encrypted cookie'
signed_salt = 'signed encrypted cookie'
key_generator = ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000)
secret = key_generator.generate_key(salt)[0, ActiveSupport::MessageEncryptor.key_len]
@tadast
tadast / ruby.yml
Created April 26, 2020 20:29
Example github actions config for Rails with postgres using DATABASE_URL
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@tadast
tadast / capybara_chrome_download.rb
Created June 3, 2020 10:32
Rails Capybara chromedriver setup for testing downloads
# in rails_helper.rb
driver = if ENV['CHROME_DEBUG'] == 'true'
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
end
:chrome
else
Capybara.register_driver :headless_chrome do |app|
browser_options = ::Selenium::WebDriver::Chrome::Options.new
@tadast
tadast / A gift of life.md
Last active December 9, 2022 12:04
As a teenager I started writing a sci-fi story that I never finished. I was playing around with ChatGPT and decided to explain the plot to it and ask me to write the story. 15mins of edits and I've got my childhood story completed!

A gift of life

As the inhabitants of the planet gazed out at the endless expanse of space from the windows of their spaceship, they knew that their time on their home planet has come to an end. The planet was undergoing a catastrophic mass extinction event, the oceans were boiling, the atmosphere was thinning, and there was no way for the inhabitants to survive.

But, as all live things do, they were not willing to give up just yet. A group of scientists and engineers had been working on a plan to evacuate the remnants of the population using a massive spaceship that was capable of transporting thousands of people to a nearby planet, that, with some help from light terraforming, could become habitable.

After months of preparation, the spaceship was ready to launch. The inhabitants crowded onto the ship, their hearts filled with hope and fear. They knew that the journey would be long and dangerous, but they were determined to make it to their new home.

As the ship blasted off into space, the inhabitants w