Skip to content

Instantly share code, notes, and snippets.

title
Preparatorio - Juego

Crea un Juego!

Ahora que has tenido alguna práctica con Ruby, vamos a seguir practicando usando nuestro editor y terminal juntos.

Preparacion

Update and install required packages:

$ apt-get update -y
$ apt-get install -y g++ gcc make libc6-dev patch openssl ca-certificates libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev

Install ruby-build

$ git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
$ cd /tmp/ruby-build/

$ ./install.sh

@danpariente
danpariente / observer.rb
Last active August 29, 2015 14:07
Observer Pattern
class Subject
def initialize
end
def notify
end
end
attachments: parent_id, asset_id
domain_names: organisation_id
event_memberships: user_id, event_id
events: editor_id
group_actions: user_id, group_id
groups: user_id
icons: parent_id
invitations: sender_id
legacy_actions: item_upon_id
news_items: author_id
@danpariente
danpariente / gist:8153048
Created December 27, 2013 21:43
token authentication
def authenticate_user
@current_user = User.find_by_authentication_token(params[:token])
unless @current_user
respond_with({ error: 'Token is invalid.' })
end
end
@Override
protected JSONObject doInBackground(String... urls) {
DefaultHttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(urls[0]);
JSONObject holder = new JSONObject();
JSONObject userObj = new JSONObject();
String response = null;
JSONObject json = new JSONObject();
try {
package com.apptegy.arkadelphia.questions;
import android.app.ProgressDialog;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
@danpariente
danpariente / git_flow
Last active December 11, 2015 18:38
My Git Flow
git checkout -b feature && git push -u
git commit -am "$COMMIT_MESSAGE"
git add $FILES_TO_ADD
git commit -m "$COMMIT_MESSAGE"
git add -p $PATH_TO_FILE
git diff master feature
@danpariente
danpariente / rspec-syntax-cheat-sheet.rb
Created December 4, 2012 20:14 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@danpariente
danpariente / spanish_stop_words.txt
Created October 9, 2012 16:51
Spanish Stop Words
de
la
que
el
en
y
a
los
del
se