Skip to content

Instantly share code, notes, and snippets.

View azdrenymeri's full-sized avatar
:bowtie:

Azdren azdrenymeri

:bowtie:
View GitHub Profile
@azdrenymeri
azdrenymeri / ransack.md
Created September 30, 2022 08:24 — forked from raghubetina/ransack.md
Ransack Cheatsheet

Ransack Cheatsheet

The Ransack gem provides us with a powerful, flexible, easy-to-integrate search/filter form.

Installation

In your Gemfile, include

gem 'ransack'
@azdrenymeri
azdrenymeri / restful_controller.rb
Last active May 12, 2022 09:45
RESTful controller with filterrific integration
module Api
module V1
# This is a module that provides a RESTful action for all API controllers.
# Uses filterrific gem to filter records.
# Uses will_paginate gem for pagination.
module RestfulController
extend ActiveSupport::Concern
included do
before_action :resource_model, only: [:index, :show, :create, :update, :destroy]
Stripe.api_key = "sk_test_51IuYrJETAknCF0ZRNs3Cmjctbi4jsWB4o7hgLGp9Ql7OGe19qXwDPKwqb0D8yRipbZY83SNHycLGvAPUMuJtEhHJ00yqwb7d5Z"
@azdrenymeri
azdrenymeri / README.md
Created May 7, 2021 12:59 — forked from progrium/README.md
Setting up M1 Macs for x86 development with Homebrew

Key Points

  • In general, binaries built just for x86 architecture will automatically be run in x86 mode
  • You can force apps in Rosetta 2 / x86 mode by right-clicking app, click Get Info, check "Open using Rosetta"
  • You can force command-line apps by prefixing with arch -x86_64, for example arch -x86_64 go
  • Running a shell in this mode means you don't have to prefix commands: arch -x86_64 zsh then go or whatever
  • Don't just immediately install Homebrew as usual. It should most likely be installed in x86 mode.

Homebrew

Not all toolchains and libraries properly support M1 arm64 chips just yet. Although

@azdrenymeri
azdrenymeri / default.css
Created December 23, 2020 08:59
defeault.css
#wistia_grid_30_main {
height: 763px;
}
@azdrenymeri
azdrenymeri / heroku_pg_db_reset.md
Created September 29, 2020 14:44 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@azdrenymeri
azdrenymeri / media-query.css
Created November 22, 2019 12:38 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS