Skip to content

Instantly share code, notes, and snippets.

View gmrdad82's full-sized avatar
🎮
Gaming

Catalin Ilinca gmrdad82

🎮
Gaming
  • Castellon de la Plana, Spain
  • 22:10 (UTC +02:00)
  • YouTube @GmrDad82
View GitHub Profile
set encoding=UTF-8
set exrc
set relativenumber
set nu
set hlsearch
set hidden
set noerrorbells
set tabstop=2 softtabstop=2 expandtab
set shiftwidth=2
set smartindent
@cossssmin
cossssmin / gradients.js
Last active June 4, 2021 20:25
Tailwind CSS background-image gradients plugin
const _ = require('lodash');
module.exports = ({e, addUtilities, config}) => {
const gradients = config('gradients', [])
const variants = config('modules.gradients')
const gradientUtilities = _.map(gradients, (colors, name) => {
if (!_.isArray(colors)) {
colors = ['transparent', colors];
}
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"A File Icon",
"Alignment",
"ayu",
{
"atomic_save": true,
"caret_style": "phase",
"color_scheme": "Packages/ayu/ayu-mirage.tmTheme",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
"coverage",
"tmp",
".git",
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@jwicks
jwicks / sidekiq-worker-cloudwatch-queue-size.rb
Last active August 12, 2024 16:39
Sidekiq worker for publishing queue size metric to AWS CloudWatch
class QueueSizeMetricWorker
include Sidekiq::Worker
include Sidetiq::Schedulable
recurrence { minutely }
sidekiq_options retry: false
# Publish a custom metric on CloudWatch with the Sidekiq queue size
def perform
cloudwatch = Aws::CloudWatch::Client.new(

Per-directory Bash history (w/o aliasing cd)

I use Bash’s PROMPT_COMMAND variable:

The value of the variable PROMPT_COMMAND is examined just before Bash prints each primary prompt. If PROMPT_COMMAND is set and has a non-null value, then the value is executed just as if it had been typed on the command line.

The source code should be pretty straight forward, but if not, please ask in the comments. Put this in your .bashrc or similar:

# per-directory Bash history
@chunlea
chunlea / input-group-in-simple-form.md
Last active October 5, 2021 20:03
How to use Boostrap 3 input-group in Simple Form

Finally, Simple Form support Boostrap 3. 👏

But I found it still dosen't support some components in Bootstrap 3. Or may be in the future. But I can't wait, so I find a solution to support them. It was inspired by heartcombo/simple_form#531 (comment) .

This is a final solution and I used in my project.

simple_form

@peterdietz
peterdietz / README.md
Last active September 7, 2015 02:26
Capistrano3 + Rails4 + NGINX + Passenger. After cap deploy restarts the app, we want to warm it up with a ping, so end user never waits

Most instructions for using Capistrano tell you how to make it restart Phusion Passenger by 'touch'ing the restart.txt file, but this doesn't immediately restart the app - instead the first person to try to use the application will cause it to be restarted, so they will see a delay of at least a few seconds.

This shows how to add a post-deploy task to 'ping' the server, to cause it to restart immediately.

Then add a deploy:ping task to config/deploy.rb and set it to run automatically after deploy:restart. Alternatively you could put it into the deploy:restart task directly.

TODO: Test the response HTTP header of the ping, that it is a 200, and not some other error response (404/500).

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 10, 2025 16:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k