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
| #!/bin/sh | |
| # Rewrite's the commit with data from source commit | |
| echo "WARNING: Your TARGET_COMMIT must have in your current branch." | |
| SOURCE_COMMIT=$1 | |
| TARGET_COMMIT=$2 | |
| SOURCE_COMMIT=$(git rev-parse $SOURCE_COMMIT) | |
| if [ $? -ne 0 ]; then |
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
| # Credit http://stackoverflow.com/a/2514279 | |
| for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r |
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.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.function.Function; | |
| public class ReferenceToConstructor { | |
| /** | |
| * @param args the command line arguments | |
| */ |
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
| #!/bin/bash | |
| FILE=$1 | |
| OUTPUT_NAME=$2 | |
| # Export to PKCS12 format | |
| keytool -importkeystore -srckeystore "$FILE" -destkeystore "$OUTPUT_NAME".p12 -deststoretype PKCS12 | |
| # Export certificate in pem format | |
| openssl pkcs12 -in "$OUTPUT_NAME".p12 -nokeys -out "$OUTPUT_NAME"_cert.pem | |
| # Export certificate in x509 format |
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
| word = raw_input() | |
| reduced_word = ''.join( | |
| [char for index, char in enumerate(word) if char not in word[0:index]]) |
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.io.InputStream; | |
| import java.util.ArrayList; | |
| import javax.xml.parsers.DocumentBuilder; | |
| import javax.xml.parsers.DocumentBuilderFactory; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.client.HttpClient; | |
| import org.apache.http.client.methods.HttpPost; | |
| import org.apache.http.impl.client.DefaultHttpClient; |
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
| public class Testa { | |
| private static int fatorial(int numero) { | |
| if (numero == 1) | |
| return 1; | |
| return numero * fatorial(--numero); | |
| } | |
| private static int combinacao(int n, int p) { | |
| return fatorial(n) / (fatorial(n - p) * fatorial(p)); | |
| } |
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
| static class MemoryPropertyBuilder { | |
| StringBuilder builder = new StringBuilder(); | |
| PropertyBuilder add(String param, String value) { | |
| builder.append(param + "=" + value); | |
| return this; | |
| } | |
| Properties properties() { |
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
| # From: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=86912 | |
| # 1. Prepare the USB disk | |
| # Create an ext3 partition using GParted for instance | |
| #2. Configure DD-WRT | |
| #Under Services->Services->Secure Shell: | |
| #* Enable SSHd | |
| #* Click Apply Settings | |
| # |
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
| public class Ipc2014ProblemA { | |
| private static class BaggageBin { | |
| int space; | |
| char destination; | |
| public BaggageBin(int space) { | |
| if (space > 0) { | |
| if (space % 2 == 0) { | |
| this.destination = 'A'; |