This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :null_session | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('starter.controllers', []) | |
.controller('LogginCtrl', ['$scope', '$rootScope', function($scope, $rootScope) { | |
$rootScope.prop = {}; | |
$rootScope.prop.language = 'es'; | |
$rootScope.prop.strings = {}; | |
$rootScope.prop.strings['title'] = { es: "Calendar K", en: "Canlendar K", jp: "カレンダーケイ" }; | |
$rootScope.prop.strings['name'] = { es: "Nombre", en: "Name", jp: "名前" }; | |
$$rootScope.prop.strings['hola'] = { es: "hola", en: "hello", jp: "こんにちは" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem ‘tumblr_client’ | |
gem ‘simple_oauth’, ‘0.2.0’ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test: &TEST | |
solr: | |
hostname: localhost | |
port: 8981 | |
log_level: WARNING | |
cucumber: | |
<<: *TEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after_initialize :mimetodo | |
def mimeotdo | |
self.atributo ||= 0.0 #seting default | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... in a form tag | |
<%= f.collection_select(:category_id, Category.all, :id, :name, {:include_blank => true}) %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem ‘gruff’ | |
gem ‘rmagick’ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sorted_array = myarray.sort{|p1,p2| p1[:diferencia] <=> p2[:diferencia]} | |
Change p1 and p2 to sort in the other order | |
sorted_array = myarray.sort{|p1,p2| p2[:diferencia] <=> p1[:diferencia]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The next recipe shows how to use cloud vision api https://cloud.google.com/vision/ in order to classify images in one drive folder | |
//process configuration | |
var api_key = "AIzaSyXXXXXXXXXXXX" //api key of a cloud project with vision api enabled | |
var origin_folder_id = "0B4_0XXXXXXXXXXXXE" //Drive id of the origin folder | |
var clasification_tag_one = 'printer'; //first label to classify | |
var clasification_tag_two = 'cat'; //second label to classify | |
var clasification_tag_three = 'laptop';//third label to classify | |
var result_folder_one_id = "0B4_0XXXXXXXXXXXX" //Drive id of the folder to put in the first label images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//based in https://maps-apis.googleblog.com/2017/05/get-your-users-where-they-need-to-go-on.html | |
<!DOCTYPE html> | |
<html> | |
<body> | |
<p><a href="https://www.google.com/maps/search/?api=1&query=pizza+near+rome">See pizza restaurante near roma</a> </p> | |
<p><a href="https://www.google.com/maps/search/?api=1&query=pizza">See pizza restaurante near you</a> </p> |
OlderNewer