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
You can't use $0 because that gives only a relative path if the script is run with a command like ./myscript.sh. | |
The method below works well for both Linux and Mac OS X. It's a bit weird, but works. | |
#!/bin/bash | |
#========================== | |
# bash - find path to script | |
#========================== | |
abspath=$(cd ${0%/*} && echo $PWD/${0##*/}) |
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
You can't use $0 because that gives only a relative path if the script is run with a command like ./myscript.sh. | |
The method below works well for both Linux and Mac OS X. It's a bit weird, but works. | |
#!/bin/bash | |
#========================== | |
# bash - find path to script | |
#========================== | |
abspath=$(cd ${0%/*} && echo $PWD/${0##*/}) |
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.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.security.KeyStore; | |
import javax.net.ssl.KeyManagerFactory; | |
import javax.net.ssl.TrustManagerFactory; | |
import org.apache.http.HttpEntity; |
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 | |
# | |
# @author: jorge.vila@gmail.com | |
# 2013 | |
if [ $# -ne 1 ] | |
then | |
echo "Usage: checkGWConnectivity.sh [FILE]" | |
fi |
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
SQLiteDatabase database = dbHelper.getWritableDatabase(); | |
Cursor c = database.rawQuery( | |
"SELECT name FROM sqlite_master WHERE type='table'", null); | |
Assert.assertNotNull(c); | |
String actual = ""; | |
if (c.moveToFirst()) { | |
while (!c.isAfterLast()) { | |
actual += c.getString(0) + ","; | |
c.moveToNext(); |
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.util; | |
import org.junit.Assume; | |
import org.junit.internal.AssumptionViolatedException; | |
import org.junit.rules.MethodRule; | |
import org.junit.runners.model.FrameworkMethod; | |
import org.junit.runners.model.Statement; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; |
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
java -Xms128m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m |
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 | |
adb backup -f data.ab -noapk com.package | |
dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf |
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
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
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.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.UnsupportedEncodingException; | |
import java.math.BigInteger; | |
import java.security.InvalidKeyException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Arrays; |
OlderNewer