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.lang.System | |
import java.io.File | |
import java.util.regex.Pattern | |
val Path = System.getenv("PATH") | |
val PathSep = File.pathSeparator | |
val pathFolders = Path.split(PathSep).toList.map(new File(_)).filter { file => | |
if(file.isDirectory) { |
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(2 != args.length) { | |
System.err.println("Usage: change-path-element in-elem out-elem") | |
System.exit(1) | |
} | |
val In = args(0) | |
val Out = args(1) | |
//println("In = " + In) | |
//println("Out = " + Out) |
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(args.isEmpty) Array("build.xml") else args) foreach { file => | |
try { | |
print(file + ": ") | |
println(scala.xml.XML.loadFile(file) \ "target" map (target => target \ "@name") filter (!_.isEmpty) mkString ", ") | |
} catch { | |
case e => println(e.getClass + ": " + e.getMessage) | |
} | |
} |
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
$ curl -I http://www.gsis.gr/diagonismos_ELLAK.html | |
HTTP/1.0 404 Not Found | |
Date: Fri, 19 Mar 2010 17:34:11 GMT | |
Server: Apache | |
Last-Modified: Thu, 14 Apr 2005 10:53:27 GMT | |
ETag: "2ebe1-34cc-55dcf7c0" | |
Accept-Ranges: bytes | |
Content-Length: 13516 | |
Content-Type: text/html; charset=ISO-8859-7 |
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.zip._ | |
import java.io._ | |
class InMemZip(compressionLevel: Int) { | |
private val _outBytes = new ByteArrayOutputStream | |
private val _zipOutStream = { | |
val s = new ZipOutputStream(_outBytes) | |
s.setLevel(compressionLevel) | |
s | |
} |
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
// expecting the https:// url on the command line | |
import java.net.URL | |
val url = new URL(args(0)) | |
val con = url.openConnection() | |
con.connect() | |
val certs = con.asInstanceOf[javax.net.ssl.HttpsURLConnection].getServerCertificates | |
certs.zipWithIndex.foreach { case (cert, 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
# program may be a soft-link | |
PRG="$0" | |
while [ -h "$PRG" ] ; do | |
ls=`ls -ld "$PRG"` | |
link=`expr "$ls" : '.*-> \(.*\)$'` | |
if expr "$link" : '/.*' > /dev/null; then | |
PRG="$link" | |
else | |
PRG=`dirname "$PRG"`/"$link" |
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 final class HttpStatus { | |
private HttpStatus() { | |
} | |
public static final int CONTINUE = 100; | |
public static final int SWITCHING_PROTOCOLS = 101; | |
public static final int OK = 200; | |
public static final int CREATED = 201; | |
public static final int ACCEPTED = 202; | |
public static final int NON_AUTHORITATIVE_INFORMATION = 203; |
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
-XX:+UseConcMarkSweepGC | |
-XX:+UseParNewGC | |
-Xms512m | |
-Xmx512m | |
-XX:MaxPermSize=250m | |
-XX:ReservedCodeCacheSize=64m | |
-XX:+DoEscapeAnalysis | |
-XX:NewRatio=1 | |
-XX:+DisableExplicitGC | |
-XX:+AggressiveOpts |
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 net.liftweb.util.CssSel | |
/** | |
* A great invention that allows to always write our CSS transforms with an & | |
* at the end and have this one as the last case. | |
* | |
* https://gist.github.com/gists/1248378 | |
*/ | |
object EndOfCssSel { |
OlderNewer