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
### Keybase proof | |
I hereby claim: | |
* I am dagosi on github. | |
* I am dagosi (https://keybase.io/dagosi) on keybase. | |
* I have a public key ASAxw70jG9o2t4_bcNusveASwFZsl6sgidDRrm97Rb4GAwo | |
To claim this, I am signing this object: |
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 class="btn-group" data-toggle="buttons"> | |
<label class="btn green active"><input autocomplete="off" type="radio" value="VISA" checked="checked" name="credit_card[card_type]" id="credit_card_card_type_visa">VISA</label> | |
<label class="btn green"><input autocomplete="off" type="radio" value="Mastercard" name="credit_card[card_type]" id="credit_card_card_type_mastercard">Mastercard</label> | |
<label class="btn green"><input autocomplete="off" type="radio" value="Discover" name="credit_card[card_type]" id="credit_card_card_type_discover">Discover</label> | |
<label class="btn green"><input autocomplete="off" type="radio" value="American Express" name="credit_card[card_type]" id="credit_card_card_type_american_express">American Express</label> | |
</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
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'` | |
CHECKSUM=$(echo -n "application/json,,/transactions,$CURRENT_DATE" \ | |
| openssl dgst -sha1 -binary -hmac "your-secret-key" \ | |
| base64) | |
curl "https://apix.casiregalii.com/transactions" \ | |
-X POST \ | |
-d '{ | |
"account_number": "12345678998", | |
"amount": "2000.0", |
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
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'` | |
CHECKSUM=$(echo -n "application/json,,/bills/<ID>/pay,$CURRENT_DATE" \ | |
| openssl dgst -sha1 -binary -hmac "your-secret-key" \ | |
| base64) | |
curl "https://apix.casiregalii.com/bills/<ID>/pay" \ | |
-X POST \ | |
-d '{"amount":5568.00, "currency":"USD"}' \ | |
-H "Accept: application/vnd.regalii.v3.2+json" \ | |
-H "Content-Type: application/json" \ |
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
CHECKSUM=$(echo -n "application/json,,/account,Wed, 02 Nov 2016 17:26:52 GMT" \ | |
| openssl dgst -sha1 -binary -hmac "verify-secret" \ | |
| base64) | |
# Thus we get: | |
echo $CHECKSUM # => nLet/JEZG9CRXHScwaQ/na4vsKQ= |
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
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'` | |
CHECKSUM=$(echo -n "application/json,,/account,$CURRENT_DATE" \ | |
| openssl dgst -sha1 -binary -hmac "your-secret-key" \ | |
| base64) |
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
scope :show_by_keyword, (word)-> { joins(:keywords).where("keywords.name LIKE %#{word}%") } |
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
var clicked = false; | |
$(document).on('click', function() { | |
clicked = true; | |
}); | |
window.onunload = function() { | |
if($('.full-logout').length > 0 && !clicked) { | |
var logoutPath = $('.full-logout a').attr('href'); |
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
def parse_expressions(initial_expression) | |
expression_regex = /(\(\d[+\-]\d\))/ | |
expressions = initial_expression.scan(expression_regex) | |
expressions.each do |expression| | |
result = calculator(expression.first) | |
initial_expression[expression.first] = result.to_s | |
end | |
calculator(initial_expression) |