Skip to content

Instantly share code, notes, and snippets.

@KayCaesar
KayCaesar / install-varnish.sh
Created October 29, 2017 09:32 — forked from haisum/install-varnish.sh
Varnish Installation on Cpanel or Whm
#!/bin/bash
# This script installs VARNISH Cache along side Apache on cPanel servers.
#This script installs VARNISH, changes the Apache port to 82, writes
# some config files, starts VARNISH, and terminates.
### Made by Shubham Mathur (itseasy21)
#-Colors :D
RED='\033[01;31m'
@KayCaesar
KayCaesar / README.md
Created September 20, 2017 23:39 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@KayCaesar
KayCaesar / ruby-books.rb
Created July 8, 2017 02:53 — forked from begin29/ruby-books.rb
ruby, rails books
# === ruby books
# confident ruby
https://www.dropbox.com/sh/t4xu4t3hitqvqjy/AAAncKJ2s_9R-74WHv8zdVdYa?dl=0
# fareless refactoring
https://www.dropbox.com/sh/pobxg0jpz7ndho1/AACS84n6AAFnx1ppl4M2MNjLa?dl=0
# Sandy Metz Practical ruby design
https://www.dropbox.com/s/p8oejgchshk16ki/Sandi%20Metz%20-%20Practical%20Object-Oriented%20Design%20in%20Ruby.epub?dl=0
# Rails as she is spoke 2012
https://www.dropbox.com/s/jqvlcj15jv11hh3/Docfoc.com-Rails%20as%20She%20is%20Spoke.pdf?dl=0
# lean-publishing-growing-rails-applications-in-practice-2014
@KayCaesar
KayCaesar / ruby-articles.rb
Created July 8, 2017 02:53 — forked from begin29/ruby-articles.rb
ruby, rails useful articles
# factory patern in ruby
http://rubyblog.com.ua/2016/04/factory-method-pattern-in-ruby
#ruby recursion
https://www.leighhalliday.com/recursion-in-ruby
# ruby on rails optimisation tips
https://infinum.co/the-capsized-eight/articles/top-8-tools-for-ruby-on-rails-code-optimization-and-cleanup
# write faster ruby app
@KayCaesar
KayCaesar / gist:7baefca0d0ed4de52a008cfc1b4b0599
Created May 1, 2017 06:38 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

Alex's Rails Cheat Sheet

I think the most confusing thing that I have found about Ruby on Rails so far has been the transition from (trying to) write code myself to the use of the fabled "Rails Magic". So, to help my own understanding of a few core Ruby on Rails concepts, I have decided to write something on what I think is a CRITICAL topic... the idea of Convention over Configuration and why (in my mind) it is the most important thing that helps Rails become magic!

(This may be a topic that we cover in more detail in class but as I said, I'm writing this for my own understanding... I hope it helps someone else understand things too... Perhaps you can give me a hand when I'm crying next week!)

##Convention over configuration ###What does this "actually" mean...

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.