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
# encoding: utf-8 | |
class EntidadeCte | |
include Mongoid::Document | |
include ROXML | |
class << self | |
# apelida o xml_accessor do ROXML para cte_attr | |
# alias :cte_attr :xml_accessor |
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
[{"_id":11,"nome":"Rond\u00f4nia","pais_id":1058,"sigla":"RO"},{"_id":12,"nome":"Acre","pais_id":1058,"sigla":"AC"},{"_id":13,"nome":"Amazonas","pais_id":1058,"sigla":"AM"},{"_id":14,"nome":"Roraima","pais_id":1058,"sigla":"RR"},{"_id":15,"nome":"Par\u00e1","pais_id":1058,"sigla":"PA"},{"_id":16,"nome":"Amap\u00e1","pais_id":1058,"sigla":"AP"},{"_id":17,"nome":"Tocantins","pais_id":1058,"sigla":"TO"},{"_id":21,"nome":"Maranh\u00e3o","pais_id":1058,"sigla":"MA"},{"_id":22,"nome":"Piau\u00ed","pais_id":1058,"sigla":"PI"},{"_id":23,"nome":"Cear\u00e1","pais_id":1058,"sigla":"CE"},{"_id":24,"nome":"Rio Grande do Norte","pais_id":1058,"sigla":"RN"},{"_id":25,"nome":"Para\u00edba","pais_id":1058,"sigla":"PB"},{"_id":26,"nome":"Pernambuco","pais_id":1058,"sigla":"PE"},{"_id":27,"nome":"Alagoas","pais_id":1058,"sigla":"AL"},{"_id":28,"nome":"Sergipe","pais_id":1058,"sigla":"SE"},{"_id":29,"nome":"Bahia","pais_id":1058,"sigla":"BA"},{"_id":31,"nome":"Minas Gerais","pais_id":1058,"sigla":"MG"},{"_id":32,"nome":"Esp\u00 |
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
[{"estado_id":11,"_id":1100015,"nome":"Alta Floresta D'Oeste"},{"estado_id":11,"_id":1100023,"nome":"Ariquemes"},{"estado_id":11,"_id":1100031,"nome":"Cabixi"},{"estado_id":11,"_id":1100049,"nome":"Cacoal"},{"estado_id":11,"_id":1100056,"nome":"Cerejeiras"},{"estado_id":11,"_id":1100064,"nome":"Colorado do Oeste"},{"estado_id":11,"_id":1100072,"nome":"Corumbiara"},{"estado_id":11,"_id":1100080,"nome":"Costa Marques"},{"estado_id":11,"_id":1100098,"nome":"Espig\u00e3o D'Oeste"},{"estado_id":11,"_id":1100106,"nome":"Guajar\u00e1-Mirim"},{"estado_id":11,"_id":1100114,"nome":"Jaru"},{"estado_id":11,"_id":1100122,"nome":"Ji-Paran\u00e1"},{"estado_id":11,"_id":1100130,"nome":"Machadinho D'Oeste"},{"estado_id":11,"_id":1100148,"nome":"Nova Brasil\u00e2ndia D'Oeste"},{"estado_id":11,"_id":1100155,"nome":"Ouro Preto do Oeste"},{"estado_id":11,"_id":1100189,"nome":"Pimenta Bueno"},{"estado_id":11,"_id":1100205,"nome":"Porto Velho"},{"estado_id":11,"_id":1100254,"nome":"Presidente M\u00e9dici"},{"estado_id":11,"_id":110 |
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 Company | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
has_and_belongs_to_many :users | |
belongs_to :owner, class_name: "User", inverse_of: :owns | |
end | |
class User | |
include Mongoid::Document |
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
@import "jbar.colors"; | |
@import "jbar"; |
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
HttpParams httpParams = new BasicHttpParams(); | |
HttpConnectionParams.setConnectionTimeout(httpParams, 5000); | |
HttpConnectionParams.setSoTimeout(httpParams, 5000); | |
DefaultHttpClient client = new DefaultHttpClient(httpParams); | |
client.getCredentialsProvider().setCredentials( | |
new AuthScope(PROXY_HOSTNAME, PROXY_PORT), | |
new UsernamePasswordCredentials(PROXY_USERNAME, PROXY_USERPWD)); | |
HttpHost proxy = new HttpHost(PROXY_HOSTNAME, PROXY_PORT); | |
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); |
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
PASSWORD | |
changethis | |
SERVER KEYSTORE - used by the server to establish a secure connection (HTTPS) | |
c:\eclipse\jdk1.7.0_05\jre\bin\keytool.exe -genkey -keyalg RSA -alias localhost -keystore localhost.jks -validity 365 -keysize 2048 | |
CLIENT KEYSTORE - used to generate ".cer" file that wil be used in the server's trustore and in the browser to identify the client with the server | |
c:\eclipse\jdk1.7.0_05\jre\bin\keytool.exe -genkey -keyalg RSA -alias jonwelzel -keystore jonwelzel.jks -validity 365 -keysize 2048 |
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
# 1. not working | |
redirect_to contact_path(@message), :flash => { :error => "Captcha error! The image code you informed is incorrect."} | |
# 2. not working | |
flash[:error] = "Captcha error! The image code you informed is incorrect." | |
redirect_to contact_path(@message) | |
# 3. WORKING | |
flash[:error] = "Captcha error! The image code you informed is incorrect." | |
render "new" |
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
<div id="actions"> | |
<form action="@link(0, "name")" method="GET" class="form-search"> | |
<div class="input-append"> | |
<input type="search" id="searchbox" name="f" value="@currentFilter" placeholder="Filter by device name..." class="input-medium search-query"> | |
<button type="submit" id="device-search-submit" class="btn"><i class="icon-search"></i> Search</button> | |
</div> | |
</form> | |
</div> |
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
UPDATE table_name | |
SET column1=value1 | |
WHERE some_column=some_value; | |
ALTER TABLE table_name | |
ADD column_name datatype; | |
/* SQL Server */ | |
alter table DEFAULT_PROPRIED_DOCTO | |
add VERSION bigint not null default 1; |
OlderNewer