Instantly share code, notes, and snippets.

View swagger.json
{
"swagger": "2.0",
"info": {
"version": "v2.2",
"title": "Open Data API",
"description": "Latest Swagger specification for OpenData ATM Locator"
},
"host": "developer.openbanking.org.uk",
"basePath": "/open-banking/v2.2",
"schemes": [
View reverse-recursivly.java
public String reverse(String input) {
if (input.length() == 1) return input;
String lastChar = input.substring(input.length()-1);
String rest = input.substring(0, input.length() - 1);
return lastChar + reverse(rest);
}
View reverse-iterative.java
public static String reverse(String input) {
String output = "";
while(input.length() > 0) {
output += input.substring(input.length()-1);
input = input.substring(0, input.length() - 1);
}
return output;
}
View alias.sh
alias latest='function _latest(){ curl -s "https://rubygems.org/api/v1/versions/$1/latest.json" | cut -d"\"" -f 4 };_latest'
View controller.rb
...
def pay
Volt::Braintree.get_nonce.then do |nonce|
"Send to server to process"
end.fail do
"Handle failure"
end
end
View component.rb
def index_ready
client_token = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI0NmE3NzFlMWNiYTVlODhhNDY3YWJjMTExYWJjOTU3NGU5MzE5NWMwMjM3NGQ1ZWQ5MWNjYWMyNzU2NTY3MTgxfGNyZWF0ZWRfYXQ9MjAxNS0wOC0wM1QxMzowNjo1OC45NTk4Njc2NDYrMDAwMFx1MDAyNm1lcmNoYW50X2lkPWRjcHNweTJicndkanIzcW5cdTAwMjZwdWJsaWNfa2V5PTl3d3J6cWszdnIzdDRuYzgiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvZGNwc3B5MmJyd2RqcjNxbi9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2RjcHNweTJicndkanIzcW4vY2xpZW50X2FwaSIsImFzc2V0c1VybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXV0aFVybCI6Imh0dHBzOi8vYXV0aC52ZW5tby5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIn0sInRocmVlRFNlY3VyZUVuYWJsZWQiOnRydWUsInRocmVlRFNlY3VyZSI6eyJsb29rdXBVcmwiOiJodHRwczovL2FwaS5zYW5kYm94Lm
View Braintree Hosted Fields - Card validation.markdown

Braintree Hosted Fields - Card validation

In this demo I tried to recreate the Braintree v.zero dropin experience of automatically detecting the credit card validity using the Hosted Field SDK.

A Pen by Cristiano Betta on CodePen.

License.

View Braintree Hosted Fields - Card Type detection
Braintree Hosted Fields - Card Type detection
----------------------------------------------
In this demo I tried to recreate the Braintree v.zero dropin experience of auto matically detecting the credit card type using the Hosted Field SDK.
A [Pen](http://codepen.io/cbetta/pen/XbEpGx) by [Cristiano Betta](http://codepen.io/cbetta) on [CodePen](http://codepen.io/).
[License](http://codepen.io/cbetta/pen/XbEpGx/license).
View gist:71af14a2de72cb674337
### Keybase proof
I hereby claim:
* I am cbetta on github.
* I am cbetta (https://keybase.io/cbetta) on keybase.
* I have a public key whose fingerprint is D518 8567 0820 1705 14A5 97C2 25D1 7CB7 AD85 AA59
To claim this, I am signing this object:
View help.sh
dokku help
> backup:export [file] Export dokku configuration files
> backup:import [file] Import dokku configuration files
> config display the config vars for an app
> config:get KEY display a config value for an app
> config:set KEY1=VALUE1 [KEY2=VALUE2 ...] set one or more config vars
> config:unset KEY1 [KEY2 ...] unset one or more config vars
> delete Delete an application
> help Print the list of commands
> logs [-t] Show the last logs for an application (-t follows)