Skip to content

Instantly share code, notes, and snippets.

View apaciuk's full-sized avatar
🎯
Focusing

Paul Anthony McGowan apaciuk

🎯
Focusing
View GitHub Profile
@apaciuk
apaciuk / curl.md
Created March 17, 2023 15:58 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@apaciuk
apaciuk / UserProfile.rb
Created February 12, 2023 18:23 — forked from rahul100885/UserProfile.rb
Simple json file upload in rails api
class UserProfile < ActiveRecord::Base
has_attached_file :picture,
styles: {
original: {geometry: '1000x0>'},
thumb: '100x100#',
large: '300x200>',
},
convert_options: {large: "-quality 80 -strip -interlace Plane"},
default_url: "http://s3-ap-southeast-1.amazonaws.com/#{ENV["S3_BUCKET"]}/user_profiles/placeholder.png",
path: (Rails.env == 'test' || Rails.env == 'development') ? ":rails_root/public/images/:class/:id/:style/:filename" : "/:class/:id/:style/:filename",
@apaciuk
apaciuk / cheatsheet-elasticsearch.md
Created January 27, 2023 14:23 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@apaciuk
apaciuk / ui-gradients.css
Created October 17, 2022 06:44 — forked from hising/ui-gradients.css
UI Gradients
.sour-tropical-gradient { background: -webkit-linear-gradient(90deg, #FD6F46 10%, #FB9832 90%); /* Chrome 10+, Saf5.1+ */ background: -moz-linear-gradient(90deg, #FD6F46 10%, #FB9832 90%); /* FF3.6+ */ background: linear-gradient(90deg, #FD6F46 10%, #FB9832 90%); /* W3C */ }
.subtle-gray-gradient { background: -webkit-linear-gradient(90deg, #dee1e1 10%, #f4f4f4 90%); /* Chrome 10+, Saf5.1+ */ background: -moz-linear-gradient(90deg, #dee1e1 10%, #f4f4f4 90%); /* FF3.6+ */ background: linear-gradient(90deg, #dee1e1 10%, #f4f4f4 90%); /* W3C */ }
.epic-bluegreen-gradient { background: -webkit-linear-gradient(90deg, #01a99c 10%, #0698b1 90%); /* Chrome 10+, Saf5.1+ */ background: -moz-linear-gradient(90deg, #01a99c 10%, #0698b1 90%); /* FF3.6+ */ background: linear-gradient(90deg, #01a99c 10%, #0698b1 90%); /* W3C */ }
.golden-face-gradient { background: -webkit-linear-gradient(90deg, #8e7a3f 10%, #b09a51 90%); /* Chrome 10+, Saf5.1+ */ background: -o-linear-gradient(90deg, #8e7a3f 10%, #b09a51 90%); /* Opera 11.
@apaciuk
apaciuk / httparty.rb
Created September 21, 2022 06:37 — forked from jeffdonthemic/httparty.rb
HTTParty Examples
options = { :body =>
{ :username => 'my',
:password => 'password'
}
}
results = HTTParty.post("http://api.topcoder.com/v2/auth", options)
##
## example for post with papertrail and basic auth
##
@apaciuk
apaciuk / install-rbenv.sh
Last active April 15, 2022 05:30 — forked from wadtech/install-rbenv.sh
Reinstall rbenv just how I likes it.
#!/bin/bash
RBENV_LOC=$HOME/.rbenv
if [ -d $RBENV_LOC ]; then
rm -rf $RBENV_LOC
fi
echo 'Cloning rbenv...'
git clone --depth 1 -q https://github.com/rbenv/rbenv.git $RBENV_LOC
@apaciuk
apaciuk / Devise Snippets
Last active April 9, 2022 08:34 — forked from Deanout/Devise Snippets
Devise Snippets
bundle add devise
bundle install
rails g devise:install
class TurboDeviseController < ApplicationController
class Responder < ActionController::Responder
def to_turbo_stream
controller.render(options.merge(formats: :html))
rescue ActionView::MissingTemplate => error
Layout/AccessModifierIndentation:
Enabled: true
Layout/AlignHash:
Enabled: true
EnforcedColonStyle: key
EnforcedLastArgumentHashStyle: always_inspect
Layout/AlignParameters:
Enabled: true
@apaciuk
apaciuk / rails_new_options_help.md
Created August 9, 2021 15:10 — forked from kirillshevch/rails_new_options_help.md
List of "rails new" options to generate a new Rails 6 application

Run rails new --help to view all of the options you can use to generate new Rails application:

Output for Rails 6+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated applications)
@apaciuk
apaciuk / RAILS_CHEATSHEET.md
Created July 17, 2021 07:36 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before