This file contains hidden or 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
sudo apt-get update | |
# Install java | |
sudo apt-get install openjdk-7-jre-headless wget curl -y | |
# Install elasticsearch | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.3.deb | |
sudo dpkg -i elasticsearch-1.0.3.deb | |
sudo service elasticsearch start |
This file contains hidden or 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
source "http://rubygems.org" | |
gem "railties", '4.0.3', require: %w(action_controller rails) | |
gem "grape" |
This file contains hidden or 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
irb(main):010:0> class A; def dupa(x); x; end; end | |
=> nil | |
irb(main):012:0> module Over; def dupa(x); x + 1; end; end | |
=> nil | |
irb(main):013:0> A.new.dupa(1) | |
=> 1 | |
irb(main):014:0> A.new.extend(Over).dupa(1) | |
=> 2 | |
This file contains hidden or 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
.redesign .title { | |
margin-top: 0; | |
margin-left: 0; | |
} | |
.redesign .segment { | |
margin-bottom: 0; | |
} | |
.redesign .segment-content, |
This file contains hidden or 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
/** | |
* State-based routing for AngularJS | |
* @version v0.2.8 | |
* @link http://angular-ui.github.com/ | |
* @license MIT License, http://www.opensource.org/licenses/MIT | |
*/ | |
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return H(new(H(function(){},{prototype:a})),b)}function e(a){return G(arguments,function(b){b!==a&&G(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function h(a,b,c,d){var e,h=f(c,d),i={},j=[];for(var k in h)if(h[k].params&&h[k].params.length){e=h[k].params;for(var l in e)g(j,e[l])>=0||(j.push(e[l]),i[e[l]]=a[e[l]])}return H({},i,b)}function i(a,b){var c={};retu |
This file contains hidden or 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
body body-locker="true" |
This file contains hidden or 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
db = { | |
person: { | |
save: function(obj){ | |
if(obj.id){ | |
return $http.post("/person", obj).then(function(res){ | |
var data = angular.extend({}, obj); // create copy of `obj` + `id` field | |
data.id = res.data.id; | |
return data; | |
}) | |
} else { |
This file contains hidden or 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
[1] pry(main)> ActionController::Parameters.new(:a => 1, :b => [1,2,3], :c => nil).permit(:a, :b => [], :c => []) | |
=> {"a"=>1, "b"=>[1, 2, 3]} | |
[2] pry(main)> ActionController::Parameters.new(:a => 1, :b => [1,2,3], :c => nil).permit(:a, :c => [], :b => []) | |
=> {"a"=>1} | |
[3] pry(main)> ActionController::Parameters.new(:a => 1, :b => [1,2,3], :c => []).permit(:a, :b => [], :c => []) | |
=> {"a"=>1, "b"=>[1, 2, 3], "c"=>[]} | |
[4] pry(main)> ActionController::Parameters.new(:a => 1, :b => [1,2,3], :c => []).permit(:a, :c => [], :b => []) |
This file contains hidden or 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
t.references :contract, index: true # works | |
t.string :actor_uid, index: true # nope | |
t.index :actor_uid # proper way to add index for non-references field |