Skip to content

Instantly share code, notes, and snippets.

View adamgavlak's full-sized avatar

Adam Gavlák adamgavlak

View GitHub Profile

Vim Manipulation Cheat Sheet

Action

Key Result
v select
y copy (yank)
c change
d delete
class BaseClient
class APINotFound < StandardError; end
attr_reader :auth_strategy
def initialize(auth_strategy: :headers, headers: {})
@auth_strategy = auth_strategy
@headers = headers
end
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Unlit/Directional Tint"
{
Properties
{
_MainTex("MainTex", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,1)
_ColorA("ColorA", Color) = (1,1,1,1)
_ColorB("ColorB", Color) = (1,1,1,1)
@lazaronixon
lazaronixon / _form.html.erb
Last active March 28, 2025 10:19
Dropzone.js + Stimulus + Active Storage + CSS Zero (2025)
<%= form_with(model: billboard) do |form| %>
<%= tag.div class: "dropzone", data: { controller: "dropzone", dropzone_param_name_value: "billboard[images][]", dropzone_url_value: rails_direct_uploads_url, dropzone_accepted_files_value: "image/*", dropzone_max_files_value: 3, dropzone_max_filesize_value: 0.300 } do %>
<div class="dz-default dz-message flex flex-col items-center">
<%= image_tag "upload.svg", size: 28, class: "colorize-black", aria: { hidden: true } %>
<h5 class="font-semibold mbs-4">Drop files here or click to upload.</h5>
<p class="text-sm text-subtle">Upload up to 10 files.</p>
</div>
<% end %>
<div class="inline-flex items-center mbs-2 mie-1">
@sleepyfox
sleepyfox / 2019-07-25-users-hate-change.md
Last active September 13, 2024 08:39
'Users hate change'

'Users hate change'

This week NN Group released a video by Jakob Nielsen in which he attempts to help designers deal with the problem of customers being resistant to their new site/product redesign. The argument goes thusly:

  1. Humans naturally resist change
  2. Your change is for the better
  3. Customers should just get used to it and stop complaining

There's slightly more to it than that, he caveats his argument with requiring you to have of course followed their best practices on product design, and allows for a period of customers being able to elect to continue to use the old site, although he says this is obviously only a temporary solution as you don't want to support both.

@adamrdavid
adamrdavid / db_guidelines.md
Last active July 14, 2023 13:03
the darndest things
@joshmn
joshmn / routes.rb
Created September 28, 2018 21:48
actual routes
class SiteConstraint
def matches?(request)
request.subdomain != 'my' && request.domain != 'localhost'
end
end
class AppConstraint
def matches?(request)
request.subdomain === 'my' || request.domain == 'localhost'
end
@kimadactyl
kimadactyl / README.sh
Last active May 10, 2024 14:23
Dokku / Digital Ocean / Rails / Postgres / Let's Encrypt / persistent storage
# Creating a Digital Ocean droplet running Rails + Postgres with persistant storage and https
#--------------------------------------------------------------------------------------------
# For your ctrl-D pleasure...
# SERVER_IP
# APP_NAME
# RAILS_SECRET (generate with `rails secret`)
# ADMIN_EMAIL