Skip to content

Instantly share code, notes, and snippets.

void OnTriggerEnter2D(Collider2D other){
if(other.transform.tag == "Player"){
var respawnScript = other.gameObject.GetComponent<Script>();
respawnScript.Respawn();
}
}
if(distancia > 20.0f && distancia < 25.0f)
{
mover(2.0f);
}
else if(distancia < 20.0f && distancia > 5.0f)
{
mover(4.0f);
}
else
{
if (distancia < 25.0f && distancia > 20.0f){
anim.SetBool ("Visto",true);
velocidad = 4.0f;
}
else if (distancia < 20 && distancia > 5.0f){
anim.SetBool("Visible",true);
velocidad = 2.0f;
Globales.vida -= 10 * Time.deltaTime;
else if(distancia < 5.0f){
velocidad = 0.0f;
require 'rest-client'
RestClient.post('http://www.unitec.edu.ve/servlet/unicodeServlets.Login', {:TID => "usuario", :TClave => "contraseña"}){ |response, request, result, &block|
if [301, 302, 307].include? response.code
session_cookie = "JSESSIONID=#{response.cookies["JSESSIONID"]}"
puts session_cookie
response = RestClient.get 'http://www.unitec.edu.ve/indexestudiante.jsp', {:Cookie => session_cookie}
puts response
else
@carlows
carlows / Gemfile.erb
Last active February 17, 2016 16:47
Rails Templates
source 'https://rubygems.org'
gem 'rails', '<%= RAILS_VERSION %>'
gem 'autoprefixer-rails'
gem 'newrelic_rpm'
gem 'pg'
gem 'rack-canonical-host'
gem 'rack-timeout'
gem 'simple_form'
gem 'puma'
@carlows
carlows / rspec_rails_cheetsheet.rb
Created March 15, 2016 15:42 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@carlows
carlows / overview.md
Created April 24, 2016 17:57 — forked from anonymous/overview.md
MainYourMom

MainYourMom

It's an application that will store aggregated stats for each summoner that is looked up. Say someone looks up for 'CarlosEME', the app will fetch its data and store it in the database. Same with every lookup, this way it will construct a huge database of summoners over time.

Will consist on 4 pages:

  • Summoner look up page. This is the page where you search for a summoner
  • Summoner stats page. This is the page that displays the stats for an specific summoner.
  • Global summoner stats page. A page that displays every summoner that has been looked up with a summary.
  • Global mastery stats page. A page that displays stats about the masteries stored in the Database.
@carlows
carlows / index.md
Last active June 2, 2016 22:47
Refactoring nested callbacks

The code for sending a PM to multiple users for review is looking like this:

controller.hears(['pr-review (\\w+/\\w+/\\d+) with ((<@\\w+>\\s?){1,})'], botMessageTypes.ALL,
                 function(bot, message) {
  var repoDataGroup = message.match[1];
  var userIdsGroup = message.match[2];

  var accountName = parseRepoDetails(repoDataGroup).account;
  var repoName = parseRepoDetails(repoDataGroup).repository;
@carlows
carlows / mock.js
Last active June 20, 2016 17:18
Mock example
(function () {
// funcion proveniente de alguna libreria
// realiza un call http (aca lo simulamos con un timeout)
function executeHttpCall(message) {
setTimeout(function () {}, 1000);
}
// nuestra funcion, la que nos interesa probar
function myFunction(http, message, value) {
if(value > 20) {