Skip to content

Instantly share code, notes, and snippets.

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

@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>
@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 / 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 / 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 / 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

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 / family.go
Last active May 10, 2016 23:59
Go api endpoint to handle creating nested structs from json data
/* `go run family.go` to run this on your localhost at port 3000
curl -X POST -d '{"family_name": "Smith", \
"members": [{"role": "parent", "gender": "female" \
, "age": 33}, {"role": "child", "gender": "male", "age": 5}, \
{"role": "parent", "gender": "male", "age": 40}]}' \
http://localhost:3000/family/new
Will print the following to the console:
@ogryzek
ogryzek / translate_json.go
Last active May 17, 2016 06:00
Take a json request and output json with the same data but different keys.
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type Greetings struct {
Greetings []Greeting `json:"data"`
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
var ThirdPartyApi = "http://www.coolsongssite.api"