Use :remote => true option on link_to and paginate Region index page
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
VERSION=0.20.6 | |
sudo apt-get update | |
sudo apt-get install openjdk-6-jdk | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb | |
sudo dpkg -i elasticsearch-$VERSION.deb | |
# be sure you add "action.disable_delete_all_indices" : true to the config!! |
#How to apply 2 solr search index on same object (Celebrity)
It's apparently impossible to index twice same object with sunspot solr and 2 searchable block.
##1st idea Create another model (Speaker) that inherits the searchable's model, and apply on Speaker's model another searchable block. This configuration doesn't work because Speaker's searchable block doesn't totally override Celebrity's model block, it's possible to add index on fields that don't be indexed yet but it's impossible to delete indexed fields
##2nd Idea Create a second model (Speaker) that uses the table's first model ( Celebrity ). We can add a searchable block on Speaker and create new indexes .
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
# Install command line developer tools if necessary ( like if consular-item gem can't be installed ) | |
xcode-select --install | |
gem install consular | |
gem install consular-iterm | |
consular init | |
# Open the newly created ~/.consularc file and add a require statement for your core to the top. | |
# The project page for each core will have this snippet. For iTerm it’s require 'consular/iterm'. |
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
require 'savon' | |
# Get wsdl | |
client = Savon.client(wsdl: "http://localhost:8080/axis/services/USD_R11_WebService?wsdl") | |
#login | |
response = client.call(:login, message: {username: "servicedesk", password: ""}) | |
sid = response.body[:login_response][:login_return] |
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
# Downcase accented chars | |
"Île de France".mb_chars.downcase.to_s | |
# => "île de france" | |
# Downcase and remove accented chars | |
I18n.transliterate("Île de france").downcase | |
# => "ile de france" |
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
.circular { | |
width: 300px; | |
height: 300px; | |
border-radius: 150px; | |
-webkit-border-radius: 150px; | |
-moz-border-radius: 150px; | |
background: url(http://link-to-your/image.jpg) no-repeat; | |
box-shadow: 0 0 8px rgba(0, 0, 0, .8); | |
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, .8); | |
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8); |
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
use strict; | |
use warnings; | |
use utf8; | |
use Unicode::Normalize; | |
my $test = "Vous avez aimé l'épée offerte par les elfes à Frodon"; | |
my $decomposed = NFKD( $test ); | |
$decomposed =~ s/\p{NonspacingMark}//g; |
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
use strict; | |
use warnings; | |
use Encode qw( encode decode ); | |
my $code_points = decode('UTF-8', 'é'); # This is a 'é' char | |
my $cp1252 = encode('cp1252', $code_points); | |
print $cp1252; |
OlderNewer