Skip to content

Instantly share code, notes, and snippets.

View majksner's full-sized avatar
👋

Nikola Majksner majksner

👋
View GitHub Profile
@milushov
milushov / .gitlab-ci.yml
Last active June 7, 2024 02:52
Kamal (Ex Mrsk) deploy with Gitlab CI (docker in docker)
services:
- docker:24.0.5-dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "" # don't start over TLS
meta-build-image:
interruptible: true
@palkan
palkan / mailers_preview_spec.rb
Created July 8, 2022 16:15
mailers_preview_spec.rb
# frozen_string_literal: true
require "rails_helper"
# Automatically smoke-test all mailer previews
describe "/rails/mailers" do
subject { response }
ActionMailer::Preview.all.each do |preview|
next if preview.emails.empty?
@frabert
frabert / COPYING
Last active December 21, 2023 13:35
Favicons for HN
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@yahonda
yahonda / ruby31onrails.md
Last active April 9, 2024 20:46
Ruby 3.1 on Rails

Ruby 3.1 on Rails

Actions required to use Ruby 3.1.0 with Rails

Rails 7.0.Z

  • Rails 7.0.1 is compatible with Ruby 3.1.0.
  • Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
  • thor 1.2.1 has been released. You will not see DidYouMean::SPELL_CHECKERS.merge deprecate warnings anymore.

Rails 6.1.Z

  • Use Rails 6.1.5 to support database.yml with aliases and secrets.yml with aliases.
@leastbad
leastbad / README.md
Last active November 11, 2022 17:27
stimulus-youtube preview

My goal with this was to wrap the terrible YouTube Embed API in a Stimulus controller that would allow me to access the underlying API while providing some convenience methods. One key outcome is that the controller emits youtube events which contain the current position in the video. This means that other code can now respond to the position you are at in the video.

<div data-controller="youtube" data-youtube-code-value="Lo_1pyQ7xvc">
  <button data-action="youtube#play">Play</button>
  <button data-action="youtube#pause">Pause</button>
  <button data-action="youtube#stop">Stop</button>
  <br>
  <div data-youtube-target="frame"></div>
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@PierreThiollent
PierreThiollent / Readme.md
Last active March 26, 2024 19:14
iTerm2 and Oh-my-zsh config

Setup iTerm2 and oh-my-zsh

Enjoy ! 😄

Install iTerm 2

Download iTerm2 here.

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@derekmd
derekmd / Optional.php
Last active October 17, 2021 10:25
Laravel global helper function `optional()`
<?php
namespace App\Support;
class Optional
{
/**
* The target being transformed.
* Use _ prefix to avoid namespace conflict on __get()
*
@jhoff
jhoff / Enums.php
Last active November 18, 2023 20:47
Laravel Model Enumeration Trait
<?php
namespace App\Traits;
use Illuminate\Support\Str;
use App\Exceptions\InvalidEnumException;
trait Enums
{
/**