Skip to content

Instantly share code, notes, and snippets.

@JoeyBurzynski
JoeyBurzynski / google-link-disavow.txt
Last active April 20, 2023 03:01
Google Link Disavow / Spam Domains
@mrmartineau
mrmartineau / stimulus.md
Last active February 6, 2026 16:59
Stimulus cheatsheet
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active August 11, 2025 18:58
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@javan
javan / direct-uploads.md
Last active January 9, 2025 01:00
Active Storage direct uploads

direct-uploads

rails/activestorage#81

// direct_uploads.js

addEventListener("direct-upload:initialize", event => {
  const { target, detail } = event
  const { id, file } = detail
@arkadiusjonczek
arkadiusjonczek / gist:8836e724a53ddd55362644745cf8ca4c
Created December 31, 2016 01:30
Start Chrome in App Mode on Mac OS X
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app="http://www.google.de"
@elomagic
elomagic / timemachine-install.sh
Last active May 1, 2020 18:14
Script for installing a Time Machine server
#!/bin/bash
#title : timemachine-install.sh
#description : Script for installing a Time Machine server.
#more : http://www.elomagic.de
#author : Carsten Rambow
#date : 2016-12-02
#usage : /bin/bash timemachine-install.sh
#tested-distros : Ubuntu Server 16.10, Raspbian (Based on Debian)
TIMEMACHINE_USER="timemachine"
@ozgun
ozgun / cards_controller.rb
Created December 9, 2015 16:53
Custom Rails Responder for Service Objects
class Dashboard::Payments::CardsController < ::Dashboard::Payments::BaseController
self.responder = Core::CustomServiceResponder
respond_to :html
before_action :customer_required
def destroy
service = Payments::Stripe::DeleteCreditCard.new(current_user)
status_object = service.call(params[:identifier])
@tristanm
tristanm / README.md
Last active November 22, 2024 15:47
Migrating a Rails project from MySQL to PostgreSQL

Migrating a Rails project from MySQL to PostgreSQL

This brief guide is written from my own experience with migrating a large (~5GB) MySQL database to PostgreSQL for a Rails project.

No warranties, guarantees, support etc. Use at your own risk and, as always, ENSURE YOU MAKE BACKUPS FIRST!

I chose [pgloader][1] because it's extremely fast. YMMV.

  1. Replace mysql2 gem with pg in Gemfile.
  2. Update config/database.yml for PostgreSQL. I used [Rails' template][2] as a starting point.
@vralle
vralle / README.md
Last active July 9, 2025 11:57
jQuery offcanvas.js (based on Bootstrap Modal.js)

offcanvas.js

Usage

The offcanvas plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds .offcanvas-open to the <body> to override default scrolling behavior and generates a .offcanvas-backdrop to provide a click area for dismissing shown offcanvas when clicking outside the offcanvas.

<!-- Button trigger offcanvas -->
<button class="btn btn-primary" data-toggle="offcanvas" data-target="#myOffcanvas" data-fade="false">
 Launch offcanvas
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active February 15, 2026 20:33
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook