Skip to content

Instantly share code, notes, and snippets.

Git Cheat Sheet

Basic commands

git init Creates a new git repository in the directory

git add <file name> Adds a specific file to staging

git add . or git add -A Adds the full directory and its contents to staging

@winadiw
winadiw / RAILS_CHEATSHEET.md
Created July 12, 2018 08:51 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@winadiw
winadiw / RAILS_5_CHEATSHEET.md
Created July 12, 2018 08:52 — forked from harrietty/RAILS_5_CHEATSHEET.md
Ruby on Rails 5 Cheatsheet

Ruby on Rails Cheatsheet (5.1)

Architecture

RVM

$ rvm list - show currently installed Rubies

@winadiw
winadiw / MySQL Command Line Cheatsheet.md
Last active August 7, 2018 04:28 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@winadiw
winadiw / webdev_online_resources.md
Created July 31, 2018 05:53 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@winadiw
winadiw / accessing-virtualbox.md
Created August 6, 2018 12:39
Accessing your Virtualbox Guest from your Host OS

Accessing your Virtualbox Guest from your Host OS

As a developer you want to ping and access the webserver on your virtual machine. This is a very simple solution to enable the bridge to the guest VM.

Requirements

  • VirtualBox (latest version)
  • A guest operation system (e.g. Ubuntu)
@winadiw
winadiw / index.js
Created August 9, 2018 07:22 — forked from gs-akhan/index.js
Sending Data from WebView To React Native
//This sends data from WebView to React Native
...
<script>
window.postMessage("Sending data from WebView");
</script>
...
//In order to get data the was sent from WebView use onMessage prop on <WebView>
...

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section
  4. Add a new shared folder
  5. On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM.
@winadiw
winadiw / postgres-cheatsheet.md
Created September 10, 2018 05:49 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.