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 / countChar.js
Created April 1, 2015 10:32
Write a function that takes a string as its argument and count assign char
/*Write a function countBs that takes a string as its only argument and returns a number that
indicates how many uppercase “B” characters are in the string.
Second, write a function called countChar that behaves like countBs, except it takes a second argument that
indicates the character that is to be counted (rather than counting only uppercase "B" characters). Rewrite countBs to make use of this new function.*/
var countBs, countChar;
countBs = function(str) {
return countChar(str, "B");
@ddeveloperr
ddeveloperr / 14_event_eloquentJS.js
Last active October 7, 2015 19:28
Pure JavaScript Examples extracted while I was study Eloquent JavaScript book
/*Exercises
14.1 Censored keyboard
Between 1928 and 2013, Turkish law forbade the use of the letters Q, W, and X in official documents. This was part of a wider initiative to stifle Kurdish culture—those letters occur in the language used by Kurdish people but not in Istanbul Turkish.
As an exercise in doing ridiculous things with technology, I’m asking you to program a text field (an <input type="text"> tag) that these letters cannot be typed into.*/
<!doctype html>
<input type="text">
Railscasts videos all in one:
http://media.railscasts.com/assets/episodes/videos/001-caching-with-instance-variables.mp4
http://media.railscasts.com/assets/episodes/videos/002-dynamic-find-by-methods.mp4
http://media.railscasts.com/assets/episodes/videos/003-find-through-association.mp4
http://media.railscasts.com/assets/episodes/videos/004-move-find-into-model.mp4
http://media.railscasts.com/assets/episodes/videos/005-using-with-scope.mp4
http://media.railscasts.com/assets/episodes/videos/006-shortcut-blocks-with-symbol-to-proc.mp4
http://media.railscasts.com/assets/episodes/videos/007-all-about-layouts.mp4
http://media.railscasts.com/assets/episodes/videos/008-layouts-and-content-for.mp4
@ddeveloperr
ddeveloperr / How_to_use_RVM.txt
Last active August 29, 2015 14:18
Ruby on rails snippets
Basic Syntax
If you've already installed RVM, you should have the rvm command available to you. This is the way we call RVM.
The basic syntax of the command is:
rvm command_options command ruby_to_act_on
There are also RVM flags that can alter the behavior of RVM, which are given in a similar way to command options.
You can get a list of the available commands by typing:
Commit messages:
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
http://who-t.blogspot.com/2009/12/on-commit-messages.html
http://progit.org/book/ch5-2.html#commit_guidelines
Linus on rebasing vs. merging and preserving history:
http://article.gmane.org/gmane.comp.video.dri.devel/34744
http://article.gmane.org/gmane.linux.acpi.devel/32901
http://article.gmane.org/gmane.linux.kernel/638612
http://article.gmane.org/gmane.linux.kernel/638628
@ddeveloperr
ddeveloperr / ssh_101.txt
Last active February 3, 2016 09:14
SSH 101 Tutorial
SSH 101 Tutorial
An SSH key allows you to establish a secure connection between your computer and GitLab. Before generating an SSH key in your shell, check if your system already has one by running the following command:
cat ~/.ssh/id_rsa.pub
If you see a long string starting with ssh-rsa or ssh-dsa, you can skip the ssh-keygen step.
Note: It is a best practice to use a password for an SSH key, but it is not required and you can skip creating a password by pressing enter. Note that the password you choose here can't be altered or retrieved.
@ddeveloperr
ddeveloperr / ruby_questions_answers_101.md
Last active October 7, 2015 19:20
Ruby questions and answers what every developer MUST to know!

Begin!

Senior programmers won't have a problem with these, while junior programmers will usually give only half-answers.

What is a class?

A text-book answer: classes are a blue-print for constructing computer models for real or virtual objects... boring.

In reality: classes hold data, have methods that interact with that data, and are used to instantiate objects.

How I Stay Up to Date on Rails

For last night's UW Advanced Rails last class I put together my short list for staying up to date with Ruby, Rails, and the Web Development community. Here's the list:

@ddeveloperr
ddeveloperr / public_ssh.txt
Last active October 22, 2015 08:07
How to see your ssh public kay in terminal and connect it with github!
1. Check for SSH keys
$ ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
2. See it in terminal
$ cat ~/.ssh/id_dsa.pub
3. Copy your public key and paste it to github, gitbucket...
@ddeveloperr
ddeveloperr / last_node.md
Created October 14, 2015 18:33
How to Upgrade Node.js via NPM

###Upgrade Node.js via NPM

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

The n package represents a Node helper, and running the last command upgrades node to the latest stable version. Instead of using "stable", you could specify a desired version: