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
// hack to get a Stream with a cursor-backed query because anorm doesn't combine the two | |
private def resultSetToStream(sql: SimpleSql[Row])(implicit c: Connection): Stream[SqlRow] = { | |
val stmt = sql.getFilledStatement(c, getGeneratedKeys = false) | |
stmt.setFetchSize(1000) | |
val rs = stmt.executeQuery() | |
val rsMetaData = Sql.metaData(rs) | |
val columns = List.range(1, rsMetaData.columnCount + 1) | |
def data(rs: java.sql.ResultSet) = columns.map(nb => rs.getObject(nb)) | |
Useful.unfold(rs)(rs => if (!rs.next()) { rs.getStatement.close(); None } else Some((new SqlRow(rsMetaData, data(rs)), rs))) | |
} |
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
java -version 2>&1 | head -1 | sed "s/[^0-9\.\_\-]*//g" |
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
--- ./openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c 2013-03-04 21:51:01.000000000 +0000 | |
+++ ./openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c 2013-04-02 22:35:56.000000000 +0000 | |
@@ -1127,7 +1127,7 @@ | |
uint8_t ipv6addr[16]; | |
if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) { | |
- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n", | |
+ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n", | |
addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7], | |
&if_idx, &plen, &scope, &dad_status, devname) != EOF) { |
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
$ cd $ICEDTEA_PATH | |
$ find . -name NetworkInterface.c | |
./openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c | |
... | |
$ cp ./openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c ./NetworkInterface.c | |
$ vi NetworkInterface.c | |
/fscanf | |
note: fscanf should only match one line | |
replace first 02x with 08x | |
:wq |
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
irb(main):001:0> class Request; end | |
=> nil | |
irb(main):002:0> Request.class | |
=> Class | |
irb(main):003:0> Request.new.class | |
=> Request | |
irb(main):004:0> Request.new.class.to_s | |
=> "Request" |
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
drop schema public cascade; | |
drop extension plv8; | |
create schema public; |
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
$ curl https://api.heroku.com/apps/naaman-iter/builds -n -k -H 'Accept: application/vnd.heroku+json; version=3' -d '{"source_blob":{"url":"http://github.com/naaman/barebones-jetty/archive/master.tar.gz"}}' -X POST -H 'Content-Type: application/json' | |
{ | |
"id": "e2ee83c8-7c28-499d-bbe3-9249e2ec7b96", | |
"status": "started", | |
"created_at": "2014-02-28 00:19:19 +0000", | |
"source_blob": { | |
"url": "http://github.com/naaman/barebones-jetty/archive/master.tar.gz" | |
} | |
}% |
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
package main | |
import ( | |
"foo/v3" | |
v1 "baz/v1" | |
"baz/v2" | |
) | |
func main() { | |
bourbon.Run(foo.Server, v1.Server, baz.Server) |
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
irb(main):001:0> cc = "\x91" | |
=> "\x91" | |
irb(main):002:0> cc.include?(cc) | |
=> false |
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
Builds::UserEnvCompileEnabledTest user-env-compile enabled | |
Initializing repository, done. | |
-----> Fetching custom tar buildpack... done | |
-----> TEST app detected | |
USER=u9674 | |
SSH_CLIENT=10.200.57.229 49615 24578 | |
MAIL=/var/mail/u9674 | |
TEST_KEY=TEST_VALUE |