Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ismael G Marin C igmarin

🏠
Working from home
View GitHub Profile
View first_excercise.rb
require 'minitest/autorun'
require 'minitest/pride'
# Will return a single code and code set if one exists in the code sets that are
# passed in. Returns a hash with a key of code and code_set if found, nil otherwise
def preferred_code(preferred_code_sets, codes_attribute=:codes, value_set_map=nil)
codes_value = send(codes_attribute)
preferred_code_sets = value_set_map ? (preferred_code_sets & value_set_map.collect{|cs| cs["set"]}) : preferred_code_sets
matching_code_sets = preferred_code_sets & codes_value.keys
#if matching_code_sets.present? <= present is only used in rails empty? is the ruby version of present?
@igmarin
igmarin / first_exercise.js
Last active Aug 29, 2015
first_exercise.js
View first_exercise.js
//my variables to test
var preferred_code_sets = ['set', 'first', 'code', 'a'];
var codes_attribute = {'set': 1, 'dos': 3, 'a': 4};
function codes_attribute(){
{'set': 1, 'dos': 3, 'a': 4};
}
function preferred_code(preferred_code_sets, codes_attribute, value_set_map=null){
var code_value = function(code_attributes){try {
View exercise_one.js
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $hash2 = $opal.hash2;
$opal.add_stubs(['$send', '$&', '$collect', '$[]', '$keys', '$empty?', '$each', '$compact', '$flatten', '$==', '$first']);
return ($opal.Object._proto.$preferred_code = function(preferred_code_sets, codes_attribute, value_set_map) {try {
var $a, $b, TMP_1, $c, TMP_2, self = this, codes_value = nil, matching_code_sets = nil, code_set = nil;
if (codes_attribute == null) {
codes_attribute = "codes"
}
if (value_set_map == null) {
View path
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
@igmarin
igmarin / err.log
Created Feb 27, 2014
Error Section Items
View err.log
➜ techscenemx git:(task-49) ✗ rspec spec/controllers/section_items_controller_spec.rb
SectionItemsController
#index
========== section: #<Section id: 3, name: "services", title: "services for Cancun", subtitle: nil, description: "Event soon", city_id: 2, created_at: "2014-02-27 22:54:03", updated_at: "2014-02-27 22:54:03">, section_items: [#<SectionItem id: 4, title: "iTuesday", content: "Free technology networking event hosted by Dennis v...", photo: "gallery/playa/tulum.jpg", link: "http://test.com", highlighted: true, section_id: 3, created_at: "2014-02-27 22:54:03", updated_at: "2014-02-27 22:54:03", name: "iTuesday">, #<SectionItem id: 5, title: "iTuesday", content: "Free technology networking event hosted by Dennis v...", photo: "gallery/playa/tulum.jpg", link: "http://test.com", highlighted: true, section_id: 3, created_at: "2014-02-27 22:54:03", updated_at: "2014-02-27 22:54:03", name: "iTuesday">, #<SectionItem id: 6, title: "iTuesday", content: "Free technology networking event hosted by Dennis
@igmarin
igmarin / messages
Created Feb 27, 2014
messages error
View messages
➜ techscenemx git:(task-49) ✗ rspec spec/controllers/messages_controller_spec.rb
MessagesController
GET index
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
assigns all messages as @messages (FAILED - 1)
GET show
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
assigns the requested message as @message (FAILED - 2)
GET new
View .tmux.conf
set -g default-terminal "xterm-256color"
setw -g window-status-current-bg default
setw -g window-status-current-attr underscore
set -g message-fg white
set -g message-bg black
set -g message-attr bright
setw -g mode-mouse on
setw -g utf8 on
set -g utf8 on
View keybase.md

Keybase proof

I hereby claim:

  • I am igmarin on github.
  • I am igmarin (https://keybase.io/igmarin) on keybase.
  • I have a public key whose fingerprint is E7A7 6361 B3EF C3E4 6ACC D0FF 0DA4 2AFB C167 6C51

To claim this, I am signing this object:

@igmarin
igmarin / example
Created May 9, 2014
county_yield.json
View example
> [
[0] #<Static::CountyYield:0x007f2d61d5cdd0> {
:id => 1,
:county => "Adams",
:five_year_yield_average => 145.0,
:five_year_yield_average_ten_percent => 160.0,
:yield_highest => 154.0,
:crop_lookup_id => 1,
:created_at => Tue, 18 Feb 2014 14:15:18 CST -06:00,
:updated_at => Tue, 18 Feb 2014 14:15:18 CST -06:00
@igmarin
igmarin / output
Created May 13, 2014
Test, clone database
View output
psql:/Users/igmarin/Code/Praxik/mmp360site/db/structure.sql:304: ERROR: type "public.geometry" does not exist
LINE 33: map_coords public.geometry(Polygon,3857),
^
psql:/Users/igmarin/Code/Praxik/mmp360site/db/structure.sql:323: ERROR: relation "feeding_operation" does not exist
psql:/Users/igmarin/Code/Praxik/mmp360site/db/structure.sql:363: ERROR: type "public.geometry" does not exist
LINE 12: map_coords public.geometry(MultiPolygon,3857),
^
psql:/Users/igmarin/Code/Praxik/mmp360site/db/structure.sql:382: ERROR: relation "field" does not exist
psql:/Users/igmarin/Code/Praxik/mmp360site/db/structure.sql:802: ERROR: type "public.geometry" does not exist
LINE 7: map_coords public.geometry(LineString,3857),
You can’t perform that action at this time.