Skip to content

Instantly share code, notes, and snippets.

View ddeveloperr's full-sized avatar
👨‍💻
Doist

Kemal C. ddeveloperr

👨‍💻
Doist
View GitHub Profile
@ddeveloperr
ddeveloperr / clone_rails_app.txt
Last active February 17, 2023 10:31
How to clone and run another user's Rails app
Below are the setups to run Ruby on Rails application on your system.
Make sure Ruby is installed on your system. Fire command prompt and run command:
ruby -v
Make sure Rails is installed
rails -v
If you see Ruby and Rails version then you are good to start, other wise Setup Ruby On Rails on Ubuntu
@ddeveloperr
ddeveloperr / DPC_Watchdog_Violation.txt
Created February 2, 2016 21:11
How to Fix (Temporarry) DPC Watchdog Violation on Windows 10 & 8
DPC Watchdog Violation on Windows 10 can be fix by certain methods shown here.
Message displays "Your PC ran into a problem and needs to restart. We're just collecting some error info, and then you can
restart"
Step 1:Press Windows and R buttons togther
Step2: Type "control sysdm.cpl" and press ok
Step 3: Go to System Properties and select Advanced
Step 4: Go to Start Up and Recovery and remove tick mark near Automatically restart
Step 5: Restart
@ddeveloperr
ddeveloperr / ssh_authentication.txt
Last active September 13, 2024 21:13
Test your ssh terminal connection with github account, (ssh authentication)
1. You mast have a public key from your mashine stored on github as SSH key here:
https://github.com/settings/ssh
How to create ssh key on unix/mac os x:
- Open terminal, go to the root typing: $ cd ~ (recommended)
- Type: ssh-keygen -t rsa -C "your@email.address"
- To secure your ssh key ststem will ask you for passphrase (recommended) but you can skip it also
- That's you have the ssh key
- Check it with: $ ls -al ~/.ssh
@ddeveloperr
ddeveloperr / roman_to_number.rb
Last active February 4, 2016 14:19
How to Convert Roman to any number in Ruby
# Define method
def romanize(num)
# define values with hash
digits = {
1000 => "M",
900 => "CM", 500 => "D", 400 => "CD", 100 => "C",
90 => "XC", 50 => "L", 40 => "XL", 10 => "X",
9 => "IX", 5 => "V", 4 => "IV", 1 => "I"
}
@ddeveloperr
ddeveloperr / fast_push.txt
Last active June 7, 2025 14:49
How to avoid Git push: username, password in my terminal ?
Problem: Every push prompt me to input username and password.
I would like to avoid it for every push, but how to configure to avoid it?
Answer: Using SSH authentication on terminal.
1. Generate an SSH key
Linux/Mac
Open terminal to create ssh keys:
@ddeveloperr
ddeveloperr / ORM_in_ror.txt
Created February 5, 2016 22:56
Explained ORM in Ruby on Rails?
##
* ORM is Object Relational Mapper. It means you don't have to manually call the database yourself; the ORM handles it for you.
* Ruby on Rails uses one called ActiveRecord, and it's a really good one.
* ORM allows you to do things such as:
User.find(50).contacts
Instead of manually writing a SELECT statement with JOINs, WHEREs, etc.
**********
@ddeveloperr
ddeveloperr / API_in_Rails.txt
Created February 5, 2016 23:27
Building an API in Ruby on Rails
An API is an “application program interface”, which basically means a computer program that allows other programs to
communicate with it. In our case, our program will be a web application, and we want to make it easy for other web apps
to connect to it.
Example: let’s say I want to build a simple web app that searches Twitter for tweets that contain certain keywords.
I can use Twitter’s search API to do just that by sending a request for data to their servers and then manipulating or
displaying that data on my app. There are tons of APIs out there that make their data available to developers for things
like movie times, restaurant reviews, social media, any pretty much everything else.
@ddeveloperr
ddeveloperr / Insertion_Sort_in_ruby.rb
Last active February 6, 2016 00:47
Algorithm and Data Structures With Ruby - #1 Insertion Sort
#Algorithm and Data Structures
# More details: http://www.theodinproject.com/ruby-programming/common-data-structures-and-algorithms
# Implementation of Insertion Sort.
# Insertion Sort ************************
# Insertion Sort -> A popular quadratic sorting algorithm with O(n^2) complexity
def insertionSort(arr)
for size in 2..arr.length
# Remember, this is a zero-start array
@ddeveloperr
ddeveloperr / Selection_Sort.rb
Created February 5, 2016 23:59
Algorithm and Data Structures With Ruby - #2 Selection Sort
#Selection Sort
#The Selection Sort is a popular quadratic sorting algorithm, which has been discussed in detail, with examples and C code over here : Arrays and Sorting: Selection Sort ( with C Program source code). In this tutorial, we will take a quick look at the ruby implementation of Selection Sort.
# Selection Sort *************************
# Selection Sort -> A popular quadratic sorting algorithm with O(n^2) complexity
# For Index [i] -> swap the i-th smallest element from (array[i]....array[length-1]) with array[i-1]
def selectionSort(arr)
for index in 0..(arr.length-1)
@ddeveloperr
ddeveloperr / Quick_Sort.rb
Last active February 6, 2016 00:32
Algorithm and Data Structures With Ruby - #3 Quick Sort
#The Quick Sort is a popular sorting algorithm, which has been discussed in detail, with examples and C code over here : Arrays and Sorting: Quick Sort ( with C Program source code). In this tutorial, we will take a quick look at the ruby implementation of Quick Sort.
#1
def partition arr, lo, hi
i,j = lo+1,hi
while true