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
/* | |
* 2016 Jan 29 | |
* | |
* For redirecting to SSL site, from within PHP. | |
* | |
* This is useful if: | |
* - Your site is running behind a load-balancer, which | |
* means you cannot directly infer HTTPS, AND | |
* - you don't have the ability to modify | |
* .htaccess on your hosted site. |
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
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
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
$ brew update | |
$ brew install openssl |
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
$ which openssl | |
/usr/bin/openssl | |
$ openssl version | |
OpenSSL 0.9.8zg 14 July 2015 | |
$ /usr/local/Cellar/openssl/1.0.2e_1/bin/openssl version | |
OpenSSL 1.0.2e 3 Dec 2015 |
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
function computeHttpSignature(config, headerHash) { | |
var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"', | |
sig = template; | |
// compute sig here | |
var signingBase = ''; | |
config.headers.forEach(function(h){ | |
if (signingBase !== '') { signingBase += '\n'; } | |
signingBase += h.toLowerCase() + ": " + headerHash[h]; | |
}); |
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
import java.security.MessageDigest; | |
import org.apache.commons.codec.binary.Base64; | |
... | |
MessageDigest md = MessageDigest.getInstance("SHA256"); | |
byte[] hashBytes = md.digest(stringToHash.getBytes("UTF-8")); | |
String hashB64 = Base64.encodeBase64String(hashBytes); | |
... |
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
development: | |
adapter: mysql2 | |
encoding: utf8 | |
database: my_database | |
username: root | |
roles: | |
- admin | |
- developer | |
- guest | |
password: |
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
<ResponseCache name="Response-Cache-1"> | |
<CacheKey> | |
<Prefix/> | |
<KeyFragment ref="request.uri" type="string"/> | |
</CacheKey> | |
<Scope>Exclusive</Scope> | |
<ExpirySettings> | |
<TimeoutInSec ref="">60</TimeoutInSec> | |
</ExpirySettings> | |
</ResponseCache> |
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
<StatisticsCollector name="Statistics-Collector-1"> | |
<Statistics> | |
<Statistic name="devjam_{your initials}_cityname" | |
ref="city_name" | |
type="STRING">NO_CITY</Statistic> | |
</Statistics> | |
</StatisticsCollector> |
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
<ExtractVariables name="Extract-Variables-1"> | |
<Source clearPayload="false">response</Source> | |
<JSONPayload> | |
<Variable name="city_name"> | |
<JSONPath>$.name</JSONPath> | |
</Variable> | |
</JSONPayload> | |
</ExtractVariables> |