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
package some.package; | |
import java.io.File; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
import org.apache.log4j.PropertyConfigurator; | |
import org.apache.log4j.LogManager; | |
import org.apache.log4j.xml.DOMConfigurator; | |
/** | |
* ServletContextListener to initialize Logging for the application |
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
import java.io.UnsupportedEncodingException; | |
import java.security.GeneralSecurityException; | |
import java.security.SecureRandom; | |
import java.util.Random; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.apache.commons.codec.binary.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
<?php | |
$apiKey = "apikey"; | |
$secretKey = "secretkey"; | |
// Generates a random string of ten digits | |
$salt = mt_rand(); | |
// Computes the signature by hashing the salt with the secret key as the key |
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
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLEncoder; | |
import java.security.GeneralSecurityException; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.bouncycastle.util.encoders.Base64Encoder; |
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
package test; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.nio.channels.NonWritableChannelException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; |
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
<?php | |
// require 'path/to/vendor/autoload.php'; | |
use Assetic\Asset\FileAsset; | |
$asset = new FileAsset('path/to/file.js'); | |
header('Content-Type: application/javasript'); | |
echo $asset->dump(); |
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
<?php | |
namespace app\extensions\helper; | |
use Assetic\AssetWriter; | |
use Assetic\AssetManager; | |
use Assetic\FilterManager; | |
use Assetic\Asset\AssetCache; | |
use Assetic\Asset\AssetCollection; | |
use Assetic\Asset\FileAsset; |
NewerOlder