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.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipFile; | |
class AndroidXMLDecompress { | |
// decompressXML -- Parse the 'compressed' binary form of Android XML docs | |
// such as for AndroidManifest.xml in .apk files |
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
@Grab("io.vertx:vertx-core:3.3.3") | |
import io.vertx.core.Vertx | |
def schedulerId | |
def vertx = Vertx.vertx() | |
(1..10).each { it -> | |
vertx.setTimer(2000, { | |
println """ | |
Hola, este es ${schedulerId} |
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
#!/usr/bin/env bash | |
#OpenSSL requires the port number. | |
#ws.seur.com | |
#SERVER=80.65.15.72:443 | |
SERVER=54.187.119.242:443 | |
DELAY=1 | |
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g') | |
echo Obtaining cipher list from $(openssl version). |
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
# create an account, create an app | |
# @see https://apps.twitter.com/ | |
# retrieve the access tokens | |
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token | |
# create the file ~/twitter_api | |
nano ~/twitter_api | |
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0" |
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
@Grab(group='org.modelcatalogue', module='spreadsheet-builder-poi', version='0.3.1') | |
@Grab(group='commons-codec', module='commons-codec', version='1.10') | |
@GrabExclude('org.codehaus.groovy:groovy-all') | |
import org.modelcatalogue.spreadsheet.api.Cell | |
import org.modelcatalogue.spreadsheet.builder.poi.PoiSpreadsheetBuilder | |
import org.modelcatalogue.spreadsheet.query.api.SpreadsheetCriteria | |
import org.modelcatalogue.spreadsheet.query.poi.PoiSpreadsheetCriteria | |
File file = new File('report.xlsx') |
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
def profileInfo(username) { | |
final String TOK1 = 'window._sharedData = ' | |
final String TOK2 = ';</script>' | |
def insta = "https://instagram.com/${username}".toURL().text | |
def text = insta.split(TOK1)[1].split(TOK2)[0] | |
def json = new groovy.json.JsonSlurper().parseText(text) | |
[username: username, | |
followers: json.entry_data.ProfilePage[0].user.followed_by.count, | |
media: json.entry_data.ProfilePage[0].user.media.nodes.collect( { item -> item.subMap(['code', 'date', 'caption', 'likes', 'comments']) } ) | |
] |
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 | |
# | |
# Ponerlo en bin/ssh | |
# | |
HOSTNAME=`echo $@ | sed s/.*@//` | |
set_prod_settings() { | |
osascript -e "Tell application \"Terminal\" to set current settings of front window to settings set \"Red Sands\"" | |
} |
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
<?xml version='1.0' encoding='ISO-8859-1'?> | |
<root><main>EL FICHERO INTEGRADO NO HA SUPERADO EL PROCESO DE VALIDACION</main> | |
<errorVal> | |
<codigo>5</codigo> | |
<descripcion>ECB NUMERACIÓN CORRECTA</descripcion> | |
<nombreCampo>cod_barras_ECB</nombreCampo> | |
<nombreCampo>numerador_etiq</nombreCampo> | |
</errorVal> | |
</erroresEnvio> | |
</root> |
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
package com.evandti; | |
import java.io.IOException; | |
import javax.servlet.*; | |
import javax.servlet.http.Cookie; | |
import javax.servlet.http.HttpServletRequest; | |
import com.opensymphony.oscache.base.Cache; | |
import com.opensymphony.oscache.web.ServletCacheAdministrator; |
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
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do. | |
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk: | |
git svn clone -T trunk http://example.com/PROJECT | |
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T: | |
git svn clone -T branches/somefeature http://example.com/PROJECT |