Skip to content

Instantly share code, notes, and snippets.

View alun's full-sized avatar

Alex Lunacharskii alun

View GitHub Profile
@alun
alun / p.cmd
Created September 13, 2011 06:38
Cmd file to run the putty via Win-R (example <Win-R>p server<ENTER> will start the connection to the server)
@echo off
set ARG=-load %1
if "%1" == "" set ARG=
start putty %ARG%
@alun
alun / .gitignore
Created October 18, 2011 14:18
Apparat script for letting google maps swc access stage through proxy
bin/*.class
*.swp
RECOVER_*.fla
test
*.swc
*.swf
@alun
alun / cpall
Created November 28, 2011 09:13
Bash copy all files with given name to new name with same extensions
#!/bin/sh
[ -z "$1" ] && {
echo "What to copy?"
exit 1
}
[ -z "$2" ] && {
echo "Where to copy?"
exit 2
@alun
alun / Main.scala
Created November 20, 2012 09:02
SBT fork connect input mini sample
object Main extends App {
println("Press any key")
System.in.read()
println("Thank you")
}
@alun
alun / .gitignore
Created November 23, 2012 07:35
Simple weekly report personal tool
target
.idea*
@alun
alun / .gitignore
Created December 9, 2012 11:55
SBT launcher sample
.idea*
project
target
find . -name "*.as" | xargs -I FILE perl -pi -e 's/\r(\n)?/\n/g' FILE
@alun
alun / CSVParser.scala
Last active December 15, 2015 12:39
Scala CSV parser and XML generator for proprietary use
import io.Source
import java.io.{File, Reader}
import scala.Left
import scala.Predef._
import scala.Right
import util.parsing.combinator.RegexParsers
class CSVParser(source:Reader) extends RegexParsers {
lazy val result:Either[String, CSVArray] = parse(root, source) match {
case Success(result, _) => Right(result)
import java.io.{UnsupportedEncodingException, InputStreamReader, IOException}
import java.net.{ProtocolException, MalformedURLException, HttpURLConnection, URL}
import util.control.Exception._
object URLPrinter extends App {
val defaultEncoding = "CP1251"
val targetURL = "http://google.com"
var readerOpt = Option.empty[InputStreamReader]
val catchingErrors = Seq(
@alun
alun / console.xml
Last active December 17, 2015 03:49
My Console2 config
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="40" columns="120" buffer_rows="1000" buffer_columns="0" shell="" init_dir="" start_hidden="0" save_size="0">
<colors>
<color id="0" r="238" g="232" b="213"/>
<color id="1" r="38" g="139" b="210"/>
<color id="2" r="133" g="153" b="0"/>
<color id="3" r="42" g="161" b="152"/>
<color id="4" r="220" g="50" b="47"/>
<color id="5" r="211" g="54" b="130"/>