Skip to content

Instantly share code, notes, and snippets.

View kikoso's full-sized avatar
💭
Learning things.

Enrique López Mañas kikoso

💭
Learning things.
View GitHub Profile
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
byte[] b = baos.toByteArray();
byte[] keyStart = "encryption key".getBytes();
KeyGenerator kgen = KeyGenerator.getInstance("AES");
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
sr.setSeed(keyStart);
kgen.init(128, sr);
SecretKey skey = kgen.generateKey();
static {
System.loadLibrary("library-name");
}
public native String getSecretKey();
Java_com_example_exampleApp_ExampleClass_getSecretKey( JNIEnv* env,
jobject thiz )
{
return (*env)->NewStringUTF(env, "mySecretKey".");
}
byte[] keyStart = getSecretKey().getBytes();
#!/bin/bash
command="./gradlew clean test"
echo "Executing tests before commit"
$command
result=$?
if [ "$result" -ne 0 ]; then
echo "Failed execution of tests"
exit 1
fi
exit 0
#!/bin/sh
echo "Running detekt"
./gradlew detektCheck
result=$?
if [ "$result" = 0 ] ; then
echo "Detekt found no problems"
exit 0
else
#!/bin/sh
echo "Running detekt"
./gradlew detektCheck
result=$?
if [ "$result" = 0 ] ; then
echo "Detekt found no problems"
exit 0
else
#!/bin/sh
name_of_branch=$(git branch | grep "*" | sed "s/\* //")
if [[ $name_of_branch == "master" ]]; then
read -p "Branch successfully merged on master. Please, specify tag version and click enter: " version
echo Creating tag with version "$version"
git tag -a v$version -m "$version"
fi
#!/bin/sh
read -p "Have the feature been tested? (y/N):" answer
if [[ "$answer" != "y" ]]; then
exit 1
fi
read -p "Have you updated your Jira? (y/N):" answer
if [[ "$answer" != "y" ]]; then
exit 1
fi
read -p "Have you created a test version? (y/N):" answer
;WITH USER_BY_TAG
AS
(
SELECT
ROW_NUMBER() OVER(ORDER BY COUNT(*) DESC) Rank,
u.Location,
COUNT(*) AS UpVotes
FROM Tags t
INNER JOIN PostTags pt ON pt.TagId = t.id