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
String result = $(document).find("#result").text(); |
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
$ cat ~/bin/jarindex | |
#!/bin/bash | |
if [ -x /opt/csw/bin/gawk ] | |
then | |
awk=/opt/csw/bin/gawk | |
else | |
awk=awk | |
fi |
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
public class LocaleUtil { | |
private static Pattern pattern = Pattern.compile("^([a-z][a-z])(_([A-Z][A-Z]))?$"); | |
/** | |
* Returns null if the string couldn't be parsed | |
*/ | |
public static Locale parseStringToLocale(String s) { | |
Matcher matcher = pattern.matcher(s); | |
if(!matcher.matches()) { |
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
module Blaze where | |
import CLasH.HardwareTypes | |
type Word = Signed D4 | |
type RegisterIndex = Index D4 | |
data Instruction = | |
Nop | |
| In RegisterIndex |
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
-- This is hledger-lib/Hledger/Read/Format.hs | |
module Hledger.Read.Format where | |
import Numeric | |
import Data.Maybe | |
import Test.HUnit | |
import Text.ParserCombinators.Parsec hiding (spaces) | |
{- |
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
{ | |
object Parser { | |
def apply(name: String): Parser = Parser(name, Nil) | |
} | |
case class Parser(name: String, items: List[Parser]) { | |
// println("parser constructor: " + this) | |
def flatMap(parser: Parser => Parser): Parser = { | |
println("flatMap: " + this) |
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 | |
if [ -z "$SBT_VERSION" ] | |
then | |
SBT_VERSION=0.7.7 | |
fi | |
JAR=$HOME/.sbt/sbt-launch-$SBT_VERSION.jar | |
mkdir -p $HOME/.sbt |
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 | |
first=1 | |
# Skip the first line | |
read junk | |
export IFS="," | |
last_id=abc |
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
// Based off http://jmhofer.johoop.de/?p=292 / https://gist.github.com/2260897 | |
// Put this file under project/Build.scala | |
// Copy Scalatron/bin/Scalatron.jar to lib/ before compiling | |
// Tested with sbt version 0.11.2 | |
import sbt._ | |
import Keys._ | |
object Build extends Build { | |
val botDirectory = SettingKey[File]("bot-directory") |
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
<feed xmlns="http://www.w3.org/2005/Atom" | |
xmlns:os="http://a9.com/-/spec/opensearch/1.1/" | |
xmlns:sort="http://purl.org/opensearch-sort/1.0"> | |
<!-- | |
A sort form lists the fields that can be sorted with the available | |
sorting functions used to sort the field. If a field doesn't list | |
a sorting function the server has a default sort function available. | |
This would normally be numerical order for numbers and lexicographical | |
for text. |
OlderNewer