Skip to content

Instantly share code, notes, and snippets.

View tundal45's full-sized avatar
👻
there is more to life than coding

Ashish Dixit tundal45

👻
there is more to life than coding
View GitHub Profile

I think you might benefit from a detailed study plan when you're a little further along with your studies. For now, I'd recommend following your interests, and taking a project-based approach towards learning.

Start with an idea of something you might want to build, and then make a list of all the stuff you'd need to learn to build it. Then, strip down the idea to make it a little more simple, and redo the list. Keep doing that until you have a list that's small enough to manage

Fair warning: full-scale applications tend to look like "first invent the whole world, then build your app", so you may need to come up with really simple ideas to start on. That's OK! You may also not know what you need to know until you try building things, that's OK too.

Once you have a few ideas, start reading and watching videos related to the technical tools and concepts you need. But only go just as deep into those resources as you need in order to build one small piece of a real project... you can always come back later i

Keep reading and watching videos, but cut that time down in half and use the rest of the time for exploring codebases and writing code of your own. If you do a code reading exercise, make sure you have the code open in your editor, and that you're able to interact with it via a REPL, its tests, etc.

Then from there, I'd recommend starting with very small, tiny projects. Ideally your first one should be something so simple you can do it in an hour or two.

Gradually work your way up from those tiny projects to slightly bigger ones. So start with one that takes an hour or two, then move up to one that might take 5-10 hours, then one that might take 20 hours, then 40 hours, etc. It's OK to stop at the size where you're feeling you're getting the most learning benefit.

Each time you try a new project, make it realistic if you can, but don't worry too much if you'll actually use it. The value is in having a rich context to try out ideas, not in the actual utility of whatever you build.

For each project you wor

###
# This is a demonstration of using SQLite3's Virtual File System API in Ruby.
#
# == Synopsis
#
# This program will store its SQLite database after the __END__ line.
#
# === In Detail
#
# SQLite3 uses the DATABase class as a proxy for our IO object. Upon
@mattyoho
mattyoho / module_overrides.rb
Created December 9, 2010 02:57
Defining methods in an included module inside your class allows modification by modules later.
class Dog
module InstanceMethods
def bark
"Arf arf!"
end
end
include InstanceMethods
end
dog = Dog.new
@patmaddox
patmaddox / 1_before.rb
Created March 7, 2011 07:03
Wondering what people think. Gratuitous refactoring, or marvelous use of Ruby?
module API
class Version1 < Grape::API
version 'v1'
resource :hotels do
get '/' do
if [:latlng, :query].all? {|key| params[key].blank? }
error! 'Please pass in latlng|query'
end
@michaelfeathers
michaelfeathers / methodshark.rb
Created March 9, 2011 15:58
Output the complexity trend of an individual method across its history
#!/usr/bin/env ruby
# Print the complexity over time for a Ruby method in a
# git repository.
#
# Requires: >= bash ?.?
# >= git 1.7.1
# >= ruby 1.9.2
# >= flog 2.5.0
#
require 'net/http'
require 'json'
###
# Stupid simple class for uploading to imgur.
#
# client = Imgur2.new 'my imgur key'
# p File.open(ARGV[0], 'rb') { |f|
# client.upload f
# }
require 'sass'
module Sass::Script::Functions
def svg_circle(radius, color, circle_type)
img = if circle_type.value == "disc"
%Q{<circle cx="#{radius.value}" cy="#{radius.value}" r="#{radius.value}"
stroke-width="0" fill="#{color}"/>}
else
%Q{<circle cx="#{radius.value}" cy="#{radius.value}" r="#{radius.value}"
stroke="#{color}" stroke-width="1" fill="white"/>}

Polymorphism

Sometimes relationships need to be flexible, and that's where we look to polymorphism. Say we want to implement:

  • A Person
  • A Company
  • A PhoneNumber that can connect to a Person or a Company

At the Database Level

@practicingruby
practicingruby / 1_rcat_tests.rb
Last active September 27, 2015 15:47
Implementing a clone of UNIX cat in Ruby
# Task: Implement the rcat utility and get these tests to pass on a system
# which has the UNIX cat command present
# To see Gregory Brown's solution, see http://github.com/elm-city-craftworks/rcat
# Feel free to publicly share your own solutions
rrequire "open3"
working_dir = File.dirname(__FILE__)
gettysburg_file = "#{working_dir}/data/gettysburg.txt"