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
openssl req -new -x509 -nodes -out server.crt -keyout server.key |
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
### Perform a search and replace from the commandline | |
$ vim -c '%s`search`replace`g' -c 'wq' *.html |
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
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git |
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 AddIndexForFullTextSearch < ActiveRecord::Migration | |
def up | |
execute "ALTER TABLE users ADD COLUMN tsv tsvector" | |
execute <<-QUERY | |
UPDATE users SET tsv = (to_tsvector('english', coalesce("building"."first_name"::text, '')) || | |
to_tsvector('english', coalesce("building"."last_name"::text, ''))); | |
QUERY | |
execute "CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE | |
ON users FOR EACH ROW EXECUTE PROCEDURE |
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
CREATE EXTENSION fuzzystrmatch; | |
select dmetaphone('filipe'), dmetaphone('phillip'), dmetaphone('felipe'); |
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
localtest.me | |
vcap.me | |
lvh.me |
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
brew install sphinx --mysql |
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
Fonte: http://olhardigital.uol.com.br/noticia/aprenda-a-combater-o-spam-que-chega-por-sms/42460 | |
Como explica a equipe da PSafe, é possível combater esse problema de duas formas. A primeira é solicitando à operadora que bloqueie o envio de ofertas por sms, basta enviar SAIR para 888 (Claro), 55555 (Oi), 4112 (Tim) ou 457 (Vivo). | |
Além disso, sempre que topar com uma mensagem indesejada, o consumidor pode colocar o número na lista negra da Anatel encaminhando o que foi recebido para 7726. |
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
source: http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-locale-en-us-the-chosen-lc-ctype-setting-requires | |
I am answering this because nothing from StackOverFlow worked for me. | |
I combined two solutions from other sites that did the job (this answer works for Ubuntu server 12.04 and PGSQL 9.1): | |
Create a file: | |
nano /etc/profile.d/lang.sh | |
Add the following |
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
# username = "my_username" | |
# pwd = "my_password" | |
# target_path = "my_target_path" | |
# saving auth cookie | |
system %Q{wget --save-cookies /tmp/cookie.txt --keep-session-cookies --post-data "username=#{username}&password=#{pwd}" -O - \ | |
https://rubytapas.dpdcart.com/subscriber/login?__dpd_cart=d08391e6-5fe2-4400-8b27-2dc17b413027} | |
(25..600).each do |i| |