Skip to content

Instantly share code, notes, and snippets.

View rjarteta's full-sized avatar

Ricardo José Arteta Romero rjarteta

View GitHub Profile
@rjarteta
rjarteta / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@rjarteta
rjarteta / stacktrace.log
Created August 22, 2012 15:13
Stack Trace of SymProto InvalidConfigurationException: Unrecognized options "wsse" under "security.firewalls.wsse_secured"
InvalidConfigurationException: Unrecognized options "wsse" under "security.firewalls.wsse_secured"
in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php line 268
at ArrayNode->normalizeValue() in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/BaseNode.php line 195
at BaseNode->normalize() in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php line 225
at PrototypedArrayNode->normalizeValue() in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/BaseNode.php line 195
at BaseNode->normalize() in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php line 260
at ArrayNode->normalizeValue() in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/BaseNode.php line 195
at BaseNode->normalize() in /home/panche/www/symproto/vendor/symfony/src/Symfony/Component/Config/Definition/Processor.php
@rjarteta
rjarteta / security.yml
Created August 21, 2012 23:07
Security.yml on symproto project
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
in_memory:
@rjarteta
rjarteta / gist:757360
Created December 28, 2010 16:06
Jquery to replace target blank
$(document).ready(function(){
$('a[rel="external"]').click(function(){
window.open($(this).attr('href'));
return false;
});
});
Loading development environment (Rails 2.3.5)
>> a = "<span lang='es-CO'></span> <span lang='en'>We are the champions</span"
=> "<span lang='es-CO'></span> <span lang='en'>We are the champions</span"
>> doc = Hpricot(a)
=> #<Hpricot::Doc {emptyelem <span lang="es-CO">} " " {elem <span lang="en"> "We are the champions</span"}>
>> doc.search("//span[@lang='es-co']")
=> #<Hpricot::Elements[]>
>> doc.search("//span[@lang='es-co']").to_s
=> ""
>> doc.search("//span[@lang='es-CO']")
map.with_options :name_prefix => 'parametros_', :path_prefix => "parametros", :controller => "parametros" do |param|
param.editar 'editar', :action => "editar"
end
#Produces:
#parametros_editar /parametros/editar {:action=>"editar", :controller=>"parametros"}
ActionController::Routing::Routes.draw do |map|
#Admin routes
map.namespace "security", :path_prefix => "admin/security" do |security|
security.resources "users"
security.resources "roles"
security.resources "permissions"
end