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
public static void main( String[] args ) { | |
/* | |
* Manifest Dependencies used for this example. | |
* | |
* org.eclipse.emf, | |
* org.eclipse.emf.common, | |
* org.eclipse.emf.ecore, | |
* org.eclipse.emf.ecore.edit, | |
* org.eclipse.emf.ecore.xmi, |
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
/** | |
* Verifies that a HTML content is valid. | |
* @param htmlContent the HTML content | |
* @return true if it is valid, false otherwise | |
* @throws Exception | |
*/ | |
public boolean validateHtml( String htmlContent ) throws Exception { | |
InputStream in = new ByteArrayInputStream( htmlContent.getBytes( "UTF-8" )); | |
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
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
#!/bin/bash | |
ROOT=/data/test | |
for f in $ROOT/my_dir/*.mkv | |
do | |
# Display progress information | |
echo "Processing $f..." | |
date | |
# Remove the file extension (here, .mkv) |
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
// Include our plug-ins | |
var gulp = require('gulp'); | |
var bowerMain = require('bower-main'); | |
var mainBowerFiles = require('main-bower-files'); | |
var exists = require('path-exists').sync; | |
var gulpIgnore = require('gulp-ignore'); | |
// Create some task | |
gulp.task( 'copy-bower-dep', function() { |
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
// Include our plug-ins | |
var gulp = require('gulp'); | |
var mainBowerFiles = require('main-bower-files'); | |
var exists = require('path-exists').sync; | |
// Create some task | |
gulp.task( 'copy-bower-dep', function() { | |
// Replace files by their minified version when possible | |
var bowerWithMin = mainBowerFiles().map( function(path, index, arr) { |
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 whatever; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import org.apache.maven.artifact.Artifact; | |
import org.apache.maven.artifact.DefaultArtifact; | |
import org.apache.maven.artifact.handler.DefaultArtifactHandler; |
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
:: The password candidates. | |
:: FIXME: read them from a file. | |
set list="pwd1" "pwd2" "pwd3" "pwd4" | |
:: Assumption: there is only one RAR file in the directory. | |
:: FIXME: iterate over a list of files? | |
:: The script stops as soon as an extraction succeeds. | |
FOR %%A IN (%list%) DO ( | |
echo "Testing %%A..." |
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 whatever; | |
import static org.ops4j.pax.exam.CoreOptions.mavenBundle; | |
import static org.ops4j.pax.exam.CoreOptions.systemProperty; | |
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureSecurity; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.PrintStream; | |
import java.security.PrivilegedActionException; |
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.IOException; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
import java.util.Objects; | |
import java.util.Set; | |
import com.fasterxml.jackson.core.JsonGenerator; | |
import com.fasterxml.jackson.core.JsonParser; |
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
# Based on https://github.com/wernight/docker-kubectl | |
# Both kubectl and helm are available when we launch the image (docker run -ti this-image). | |
# The best option would be mounting the ".kube/config" file as a volume. | |
FROM wernight/kubectl:1.5.3 | |
# Install Helm | |
USER root | |
RUN cd /home \ | |
&& curl https://storage.googleapis.com/kubernetes-helm/helm-v2.2.3-linux-amd64.tar.gz -o helm.tar.gz \ | |
&& tar -xvf helm.tar.gz \ |
OlderNewer