Skip to content

Instantly share code, notes, and snippets.

React Native on Android

with Brent Vatne, April 19th, 2016


References: ReactNative Docs | web views | slider | make it open | Redux | Relay | Jest

Phone Gap is essentially a wrapper around your web browser in your mobile that takes up your full screen. When you want to make calls to APIs, you use the camera, or something like that, you make calls to the native side. ReactNative is more similar to Titanium, or NativeScript something like that. It actually uses the platform-native UI libraries.

Our First App

@ogryzek
ogryzek / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ogryzek
ogryzek / fundamentals1.md
Last active August 29, 2015 13:59
Fundamentals: Day One

Ruby Fundamentals

The goal of this course is to be able to build a web application using Ruby, HTML, and CSS by the end of the course.

Ruby was created by Yukihiro Matsumoto 'Matz'. Ruby is a general purpose programming language, meaning you can build all sorts of programs with it. It is known as an interpreted language, as opposed to a compiled language.

Open up your terminal and type irb. This will bring us into the interactive shell. To exit the interactive shell, trpe exit.

# comments in ruby use a hash tag
# Let's try some ruby in the terminal
@ogryzek
ogryzek / databases_with_mapper.md
Last active December 7, 2019 08:03
Databases with Mapper

Databases with Mapper

With what we did yesterday, we were saving everything in memory, so after the request response happens, everything is gone.

To save data from the user, we have different options. We can save the data just to a file. The problem with this is it bcomes slow, and becomes problmeatic, because, what if lots of users are opening the same file at the same file, and searching through a file can become quite slow.

With databases, you structure your data, you put it in a structured fashion. You can easily store and retrieve your data. There are two main database structures. One is called a relational database, and the other is called NoSQL. We may go over a NoSQL DB like MongoDB on a Saturday or something, but for the most part, we will be focusing on relational databases.

NoSQL databases use key values, documents, different ways to store data. Relational databases use a langauge called SQL, which is a language used to query, fetch, and store data in databases. The one we are going to

@ogryzek
ogryzek / sinatra.md
Last active August 3, 2019 06:14
Sinatra and Ruby Gems

#Sinatra

Ruby Gems

Ruby Gems
There are over 72,000 gems. There's is probably a gem available for whatever it is you want to do. Let's try installing a gem called "snooby". In your terminal, try gem install snooby.
If you are having difficulty with installing gems, try installing a ruby version management tool, such as RVM

1.) Find a gem that allows you to print something in IRB in color.

gem install colorize
@ogryzek
ogryzek / week1_html_and_css.md
Created March 20, 2014 16:20
Week 1: HTML & CSS with Jay

HTML & CSS

Create a static HTML site with 1 or more external CSS stylesheets linked to from a CSS subfolder. Your HTML files should contains all of the items listed below. It should be made up of a minimum of 4 pages. It does not need to be pretty in any way shape or form, but should be functional. You may not use any prefabricated assets or frameworks with the exception of "normalize.css" which is permitted. For images in your page use the placeholder service "http://placehold.it" For text on your page use "Lorem ipsum" text (http://littleipsum.com). For video on the site, use both a .webm video and an .mp4 video. You may use the files located at: http://codecore.ca/video.

HTML5 elements

<header> 
<nav>
<section>

Settings for IRB colors

To get some nice colors in your irb, you can install the gems awesome_print and interactive_editor. There should be a dot file (hidden file) in your home directory called .irbrc, if not just create it: sublime ~/.irbrc.

gem install awesome_print
gem install interactive_editor
sublime ~/.irbrc

Tam's settings

Classes & Objects

Before object oriented programming, there was what's called 'Procedural Programming'. If I wanted to describe the mundane takss of my day to day routine, I could do so using procedures, such as "I wake up. I brush my teeth, etc."

However, we as humans tend to think of everything as an object. This is why languages like Ruby take objects to the extreme by making everything objects. Object oriented programming is good, because it makes thing easier to understand, and easier to extend. I can just include a library and have access to many more objects and methods.

I get into a car, which is an object. I turn on the car, which is a method on the object. Object interacting with each other is what OOP is all about.

Most modern languages are object oriented. Php, Java, Scala, etc.

Some Differences between a Class and an Object

#Data Structures

Arrays | Hashes

Arrays

In Ruby, we define an aray simply using square brackets []

a = [1, 59, "Hey", "Yo", 200]
a[2]                  # "Hey"

You can put anything inside an array

Week 1: Homework

Ruby Basics

1.) Ask user for a number then print out the number multiplied by 5 and then the same number added to itself

# Ask user for a number then print out the number multiplied by 5 and then the same number added to itself
puts "enter a num"
answer = gets.chomp.to_i
puts "The number: #{answer} The number multiplied by 5: #{(answer*5)+answer}"