Skip to content

Instantly share code, notes, and snippets.

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
#!/bin/bash
set -e # exit on error
### README
# * installs your desired ruby versions using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
# * put ssh-keys in place
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@stefanosc
stefanosc / gist:7837759
Last active December 30, 2015 13:49
Rails questions

Answers:

  1. Because data sets can be related through the use of foreign keys
  2. Structrured Query Language, it is a stnadard language to query database to retrieve / store data
  3. Schema aka Strucre view which shows the list of the column names, data view whcih shows the actual data (rows of data)
  4. The Primary key, which is usually the id
  5. The forgeing key is used in rows in a table to join other rows from another table, where the foreign key is the primary key
  6. About ActiveRecord pattern we can say that each table is represented by a Class and each row (of that table) by an instance of that Class. The Class usually also provides attr accessor methods to retrieve / store data in each column
  7. crazy_monkeys - we can also use the very useful 'CrazyMonkey'.tableize method which returns => "crazy_monkeys"
  8. Assuming the following:
@stefanosc
stefanosc / gist:7798465
Last active December 30, 2015 07:49
Questions about Rails Associations

I don’t understand how to use the generated methods as described in the various M:M associations: others
others=(other,other,...)
other_ids
other_ids=(id,id,...)

In the HMT association like in our post-it app project I need to first create the post and then in a second line of code assign it the category / categories. It would not be possible to assign categories in the same line / query where the object is created. Is this correct?

What is the :autosave option on a has_one, belongs_to, has_many, or has_and_belongs_to_many association

@stefanosc
stefanosc / show_env
Created November 17, 2013 08:35 — forked from Beengie/show_env
# Sinatra environment
# Make sure that the link to the "bootstrap.min.js" file is correct in your layout.erb (shown below):
<script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
# Put this in your .erb
<%= show_env %>
# Place constant inside of your main.rb
SHOW_ENVIRONMENT = true
What is HTML? What is CSS? What is Javascript?

HTML is a markup language, used to create HTML pages. CSS stands for cascading style sheet and is a language developed to apply styling properties to HTML documents. Javascript is a so called client side programming language that allows to manipulate a webpage after it has already been rendered in the client browser

What are the major parts of an HTTP request?

request line request headers (optional) blank line request message (optional, may contain POST data)