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
// nueva conexion | |
URL url = new URL("http://danbooru.donmai.us/posts.json?tags=setz"); | |
// abrir | |
HttpURLConnection https = (HttpURLConnection) url.openConnection(); | |
// conectar | |
https.connect(); | |
// 200,401,404,500 | |
int code = https.getResponseCode(); | |
// OK, Access denied, Not found, Internal server error | |
String message = https.getResponseMessage(); |
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
/** | |
* Estrategia de exclusion para {@link Gson} para saltarse campos que no sean serializables | |
* @author shujito | |
*/ | |
public class ExcludeFieldsWithoutSerializedName implements ExclusionStrategy | |
{ | |
@Override | |
public boolean shouldSkipClass(Class<?> clss) | |
{ | |
return false; |
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
byte[][] combinations = { | |
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } | |
}; | |
List<Long> crcList = new ArrayList<>(); | |
for (byte[] combination : combinations) { | |
crcList.add(this.crc32(combination)); | |
} | |
Log.i(TAG, "combos:" + crcList); |
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
/** | |
* <p>Title screen, it shows the logo. Makes player join by pressing its center button. | |
* | |
* @author shujito | |
*/ | |
public class ScreenTitle extends Screen { | |
public static final String TAG = ScreenTitle.class.getSimpleName(); | |
private final Music mSndBgm; | |
private final Music mSndStart; | |
private final Sprite tap; |
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
local function recurse(t,lvl) | |
lvl = lvl or 0 | |
for k,v in pairs(t) do | |
print( string.rep(' ',lvl) .. k) | |
if type(v) == 'table' then | |
recurse(v,lvl+1) | |
else | |
print( string.rep(' ',lvl) .. ' ' .. type(v) .. ':') | |
print( string.rep(' ',lvl) .. ' ' .. tostring(v)) | |
end |
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
local STATE_SELECT_SONG = 0 | |
local STATE_SELECT_CHART = 1 | |
local STATE_CONFIRM = 2 | |
local function makeBackgroundOrnaments(self) | |
-- TODO | |
end | |
local function makeForegroundOrnaments(self) | |
-- TODO | |
end |
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
# basic debian vps setup (configurations and security) | |
################# | |
## root config ## | |
# change root password | |
passwd | |
# fix locales (e.g. "Setting locale failed" messages) | |
locale-gen en_US.UTF-8 | |
dpkg-reconfigure locales |
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
local fiveChars = ... or 'weiss' | |
--print('chars:', fiveChars:lower()) | |
local function bitSet(number, offset) | |
local nro = bit32.rshift(number, offset) | |
local nroa1 = bit32.band(nro, 1) | |
--print('nroa1', nroa1) | |
return nroa1 ~= 0 | |
end |
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
if [ $1 ]; then FILENAME=$1; else exit; fi | |
BASENAME=$(basename -- $FILENAME) | |
NAME=${BASENAME%.*} | |
convert $FILENAME -auto-orient +profile "*" -write \ | |
"mpr:source" -resize "1080x1080^" -gravity center -crop "1080x1080+0+0" +repage -write "$NAME-1080.jpg" +delete \ | |
"mpr:source" -resize "720x720^" -gravity center -crop "720x720+0+0" +repage -write "$NAME-720.jpg" +delete \ | |
"mpr:source" -resize "540x540^" -gravity center -crop "540x540+0+0" +repage -write "$NAME-540.jpg" +delete \ | |
"mpr:source" -resize "360x360^" -gravity center -crop "360x360+0+0" +repage -write "$NAME-360.jpg" +delete \ |
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/sh | |
for DEVICE in $(adb devices | grep device$ | awk '{print $1}'); | |
do | |
for APP in $(find . -maxdepth 3 -type f | grep build\.gradle | xargs cat | grep applicationId | awk '{print $2}'); | |
do | |
RESULT=$(echo $APP | xargs -I _ adb -s $DEVICE uninstall _ 2>/dev/null); | |
if [ "$RESULT" == "Success" ]; then | |
echo "Uninstalled $APP from $DEVICE" | |
fi | |
done; |
OlderNewer