Skip to content

Instantly share code, notes, and snippets.

View alishersadikov's full-sized avatar

Alisher Sadikov alishersadikov

View GitHub Profile
@alishersadikov
alishersadikov / Alisher Sadikov - prework.md
Last active June 26, 2016 20:12 — forked from mbburch/prework.md
Alisher's Turing pre-work Gist

Turing School Prework

Task A- Practice Typing:

  • screenshots of scores will be posted in comments

Task B- Algorithmic Thinking & Logic:

  • screenshots of completed sections will be posted in comments

Task C- Create your Gist:

  • When you think of academic integrity, what are the first three or four things that come to mind?
  • Why does academic integrity matter?
  • What do you think plagaiarism is in context of software development?
class Order
def initialize
@line_items = []
end
def add_line_item(line_item)
@line_items << line_item
end
def total

Module 1 Week 1 Diagnostic

This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.

For these questions, write a short snippet of code that meets the requirement. Fill in your answers on a second sheet of paper or in your notebook. In cases where the question mentions a "given" data value, use the variable given to refer to it (instead of re-writing the information).

Fork this gist. Answer the questions to your best ability and with limited research. No need to post your gist in the comments.

  1. What is the purpose of the router in a Rails project?

    It is like a doorman of the application that knows where to go and what action to take once HTTP request has been received.

  2. What routes would be provided to you with the line resources :items?

    :items routes, I assume, which is probably some controller class

@alishersadikov
alishersadikov / rails-4-new-options
Created October 13, 2016 20:38 — forked from brianpetro/rails-4-new-options
Command line options for ` rails new --help ` (Rails 4.2). Useful for planning new Ruby on Rails app. 'Where can I find options for “rails new” command?'
Because I couldn't find these with a quick Google search on 28 April 2015:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile

JS Exercisms - Alisher Sadikov

Here are 5 JavaScript exercisms, with each exercism starting with a link to my submission. In addition, 5 other solutions for each exercism are reviewed as well, with links and my comments.


1. Leap

My code: link to submission

@alishersadikov
alishersadikov / template-css-challenge-gist.md
Last active January 20, 2017 05:33 — forked from breethomas/template-css-challenge-gist.md
Turing 1611 CSS Challenges Warmups

Challenge 1

I had to change div1 display to inline-block, put the other two divs into a container and floated the whole container to the right.


Challenge 2

Set div2 margin to auto in order to center and gave absolute position to div3 with a right margin of 0.

11/15/2017

Replace a string across files in a directory:

find . -type f | xargs sed -i "s/#{phone}/#{link_to phone, \"tel:#{phone_raw}\", class: 'active-states-state__link'}g"

11/20/2017

Open last command in default editor

fc

11/21/2017

@alishersadikov
alishersadikov / rails_setup.md
Created November 12, 2018 01:35 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)