Bin e padrões para validação de cartão de crédito.
Bandeira | Começa com | Máximo de número | Máximo de número cvc |
---|---|---|---|
Visa | 4 | 13,16 | 3 |
Mastercard | 5 | 16 | 3 |
{ | |
"snippets": [ | |
{ | |
"match": {"global": true, "pkgname": ".", "fn": ".*_test.go"}, | |
"snippets": [ | |
{"text": "func Test", "title": "", "value": "func Test${1:ObjectName}${2:TestName}(t *testing.T) {\n\t$0\n}"}, | |
{"text": "func Benchmark", "title": "", "value": "func Benchmark${1:ObjectName}${2:BenchmarkName}(b *testing.B) {\n\n\tb.StopTimer()\n\n\t$0\n\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\t\n\t}\n\n}"}, | |
{"text": "func Example", "title": "", "value": "func Example${1:ObjectName}${2:ExampleName}() {\n\n\t$0\n\n\t// Output:\n\t// \n\n}"} | |
] | |
} |
#!/usr/bin/env ruby | |
require 'rack' | |
# Thin SSL workaround | |
module Rack | |
module Handler | |
class Thin | |
def self.run(app, options={}) | |
app = Rack::Chunked.new(Rack::ContentLength.new(app)) | |
server = ::Thin::Server.new(options[:Host] || '0.0.0.0', |
#Heroku, Ruby on Rails and PhantomJS
In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).
Let’s get started. This is a high-level overview of the required steps:
I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)
Note: this was written in April/May 2014 and the API may have changed since
capturaEnderecoUsuario: function() { | |
var me = this; | |
/** | |
* Quando o javascript olha pra Ext.Ajax.request, | |
* ele não tem como prever quando isso retornar. | |
* Por ser uma requisição externa pode ser muito rápido ou demorar muito por demandar processamento. | |
* Então, como ele resolve isso ? | |
* Ele te promete(promisse) que vai te dar uma resposta de sucesso(success) ou erro(failure) assim que acabar a requisição. | |
* e passa para o proximo passo sem bloquear seu codigo. |
<?xml version="1.0" encoding="UTF-8"?> | |
<Context> | |
<Manager pathname=""/> <!-- disables storage of sessions across restarts --> | |
<Resource name="BeanManager" | |
auth="Container" | |
type="javax.enterprise.inject.spi.BeanManager" | |
factory="org.jboss.weld.resources.ManagerObjectFactory"/> | |
</Context> |
<listener> | |
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> | |
</listener> | |
<resource-env-ref> | |
<resource-env-ref-name>BeanManager</resource-env-ref-name> | |
<resource-env-ref-type> | |
javax.enterprise.inject.spi.BeanManager | |
</resource-env-ref-type> | |
</resource-env-ref> |