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
public static string GetResourceValue(string text) | |
{ | |
var prefix = text.Split('-')[0].Trim(); | |
if (String.IsNullOrEmpty(prefix)) | |
return estrategia; | |
var resource = ResourceFileName.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true); | |
var dictionaryEnumerator = resource.GetEnumerator(); |
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
//Para utilizar os comandos abaixo não esqueça de utilizar os seguintes imports | |
const { driver } = require('../support/web_driver'); | |
const { By } = require('selenium-webdriver'); | |
//Acessar um URL | |
driver.get("https://localhost:5001/"); | |
//Pesquisar por um elemento utilizando o xpath e clica no mesmo | |
await driver.findElement(By.xpath('//*[@id="cookieConsent"]/div/div[2]/div/button')).click(); | |
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
npm install -g eslint eslint-plugin-react babel-eslint eslint-config-defaults | |
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
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
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
Download the certificate with: | |
`wget -O config/rds-combined-ca-bundle.pem http://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem` | |
Then connect with: | |
`postgres://user:password@amazon-host/db_name?sslmode=require&sslrootcert=config/rds-combined-ca-bundle.pem` | |
References: | |
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL | |
https://github.com/jeremyevans/sequel/issues/897 | |
http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT | |
http://dba.stackexchange.com/questions/77811/how-to-connect-to-an-amazon-postgresql-database-using-ssl |
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
public class Profile { | |
public static final String USER_NAME = "_username"; | |
public static final String TOKEN_ENVITED = "_token_envited"; | |
public static void write(final Context context, final String key, final String value){ | |
Thread t = new Thread(new Runnable() { | |
@Override | |
public void run() { |
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
angular.module('App').directive("actionButton", ['$compile', function ($compile) { | |
function addButton(scope, element, attrs) { | |
var id = element.attr('id'); | |
var button = '<div class="ui-grid-footer-action">' + | |
'<button type="button" class="btn btn-danger btn-sm" ng-click="{scope}.Crud.deleteBatch()">' + | |
'<span class="glyphicon glyphicon-trash"></span> Remover</button>' + | |
'<button type="button" class="btn btn-success btn-sm" ng-click="{scope}.Crud.insert()">' + |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
#resolve o erro ao ativar rsync no windows | |
ENV["VAGRANT_DETECTED_OS"] = ENV["VAGRANT_DETECTED_OS"].to_s + " cygwin" | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. |
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
// show hide subnav depending on scroll direction | |
//original post: https://jsfiddle.net/ZzaichikK/MUvsG/ | |
var position = $(window).scrollTop(); | |
$(window).scroll(function () { | |
var scroll = $(window).scrollTop(); | |
if (scroll > position) { | |
//only piece that matters |
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
package Util; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ListAdapter; | |
import android.widget.ListView; | |
/** | |
* Created by JeffersonAlves on 28/09/2015. | |
*/ |
NewerOlder