Skip to content

Instantly share code, notes, and snippets.

View pvrt's full-sized avatar

Pavel R pvrt

View GitHub Profile
@pvrt
pvrt / public-apis.md
Created February 25, 2021 21:35 — forked from dferrandizmont/public-apis.md
[Public APIs 3] inglés #api

Public-APIs Twitter: @abgbm Build Status PRs Welcome

This is an attempt to categorise different APIs scoured from the web which make their resources available for consumption.

*Items marked with Open Source are open-source *Items marked with 💸 are trial based APIs

Table of Contents

@pvrt
pvrt / GoogleHackMasterList.txt
Created February 24, 2021 18:57 — forked from gabsoftware/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www” domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
@pvrt
pvrt / index.haml
Created March 26, 2019 14:07
Product quantity js counter
.counter
.down{:onclick => "decreaseCount(event, this)"} -
%input{:type => "text", :value => "1"}
.up{:onclick => "increaseCount(event, this)"} +
@media screen and (min-width: 74.9375em) {
.home-content {
position:relative;
}
.main-categories {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
@pvrt
pvrt / rails_models_cheatsheet.md
Created September 18, 2018 13:53 — forked from romchambe/rails_models_cheatsheet.md
Setup of SSL certificate on Heroku with Gandi

SSL setup: https://vimeo.com/209534466

Creating a join table

rails g migration CreateJoinTableGameInvitesInvitees game_invites invitees

  • Models linked together must be in alphabetical order when naming the migration file
  • The columns can be given any names as long as they are correctly associated in the model file:
has_and_belongs_to_many :invitees, class_name: 'User', foreign_key: 'invitee_id', #the associated column and the alien model
                        join_table: 'game_invites_invitees', #name of the join table
                        association_foreign_key: 'game_invite_id' #the name of the domestic model in the join table
@pvrt
pvrt / attachment.rb
Created September 18, 2018 13:47 — forked from madwork/attachment.rb
Polymorphic attachments with CarrierWave and nested_attributes
class Attachment < ActiveRecord::Base
mount_uploader :attachment, AttachmentUploader
# Associations
belongs_to :attached_item, polymorphic: true
# Validations
validates_presence_of :attachment
@pvrt
pvrt / RAILS_CHEATSHEET.md
Created September 17, 2018 10:15 — 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

@pvrt
pvrt / letsencrypt_setup.md
Created March 5, 2018 18:37 — forked from mileandra/letsencrypt_setup.md
Letsencrypt on Ubuntu 16.04 with Nginx, Rails and Capistrano-Unicorn-Nginx

Install Letsencrypt

Install with apt-get

$ sudo apt-get update    
$ sudo apt-get install letsencrypt

Generate a strong DH

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

Configure nginx

@pvrt
pvrt / 1 setup vps
Created March 4, 2018 17:35 — forked from alekpopovic/1 setup vps
Deploy Rails 5.1.1 to VPS(Ubuntu 16.04.2 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 9.6, RVM, Certbot
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev \
libpcre3-dev unzip
// Node.js v7
root# curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -