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 | |
#set px for font size with metric | |
perl -pi -e 's/font-size:(\d+);/font-size:$1px;/g' "$1" | |
#replace em metrics with px (this is a bit brittle, as the ems are relative to the container text) | |
#First the @dy=".." (multiply by 8) | |
perl -pi -e 's/dy=\"(\d+(\.\d+)?)em\"/"dy=\"".sprintf("%.1f",$1*8)."px\""/ge' "$1" | |
#Then all the others (multiply by 12, which is the default font size set bu visio export) | |
perl -pi -e 's/(\d+(\.\d+)?)em/sprintf("%.1f",$1*12)."px"/ge' "$1" |
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 | |
# https://gist.github.com/rparree/7562785 | |
PROJECT_NAME="$1" | |
SCALA_VERSION="2.10.2" | |
mkdir $PROJECT_NAME | |
cd $PROJECT_NAME | |
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 sbt._ | |
// import scala.scalajs.sbtplugin.ScalaJSPlugin._ | |
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ | |
object Dependencies { | |
val akkaVersion = "2.3.5" | |
val sprayVersion = "1.3.2" | |
val sprayJsonVersion = "1.3.1" | |
val `spray-can` = "io.spray" %% "spray-can" % sprayVersion |
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
rparree@hp-8570w:jbadmin-setup> vagrant vbguest --auto-reboot --no-provision | |
GuestAdditions versions on your host (4.3.24) and guest (4.3.22) do not match. | |
Loaded plugins: fastestmirror, langpacks | |
Loading mirror speeds from cached hostfile | |
* base: mir01.syntis.net | |
* extras: mirror-fr1.bbln.org | |
* updates: mir01.syntis.net | |
Package kernel-devel-3.10.0-123.20.1.el7.x86_64 already installed and latest version | |
Package gcc-4.8.2-16.2.el7_0.x86_64 already installed and latest version | |
Package 1:make-3.82-21.el7.x86_64 already installed and latest version |
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
<plugin> | |
<groupId>org.bsc.maven</groupId> | |
<artifactId>maven-processor-plugin</artifactId> | |
<version>2.2.4</version> | |
<executions> | |
<execution> | |
<id>process</id> | |
<goals> | |
<goal>process</goal> | |
</goals> |
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 org.w3c.dom.Document; | |
import org.w3c.dom.NodeList; | |
import org.xml.sax.InputSource; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import javax.xml.xpath.*; | |
import java.io.IOException; |
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
char[] buffer = new char[1024]; | |
String chunk = null; | |
while ((read = reader.read(buffer)) != -1) { | |
String s = String.valueOf(buffer, 0, read); | |
/* process the string: Look for "-", keep the part after it | |
for the next iteration. Add part before it to previous | |
chunk | |
*/ | |
} |
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
<!-- | |
Source: https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html | |
Just some nifty regex search/replace | |
--> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> |
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
abstract class MyStringBuilder { | |
def get(): String | |
def append(s: String) | |
} | |
class BasicStringBuilder extends MyStringBuilder { | |
private var value : String = "" | |
def get(): String = value | |
def append(s: String) = value = value + s | |
} |
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
case class PersonalInfo(email: String, twitter: Option[String]) | |
case class Student(username: String, personalInfo: Option[PersonalInfo]) |
OlderNewer