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
(defvar ant-command-history nil | |
"Ant command history variable") | |
(defun ant(&optional args) | |
"Runs ant in the current project. Starting at the directory | |
where the file being visited resides, a search is made for | |
build.xml recursively. A maven command is made from the first | |
directory where the build.xml file is found is then displayed in | |
the minibuffer. The command can be edited as needed and then | |
executed. Errors are navigate to as in any other compile mode" |
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
type Bar = String // <-- compiler error | |
class Foo { | |
def get: Bar = "hello" | |
} | |
class Baz { | |
val foo = new FooImpl() | |
def bar: Bar = foo.get() // <-- compiler error if type Bar is defined inside of Foo | |
} |
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
class Foo { | |
type Bar = Map[String, Map[String, Any]] | |
def bar(): Bar = Map() | |
} | |
class Baz { | |
val foo = new Foo() | |
import foo._ | |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'json' | |
dir = ARGV.shift | |
def readfile(filename) | |
return '[]' if File.directory?(filename) | |
body = '' |
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
#!/usr/bin/ruby | |
# usage: ./atom_timeseries.rb file | |
# For a big file filled with atom entries, spit out | |
# the epoch of each atom entry's updated timestamp. | |
# Output to stdout. so pipe it to your file. | |
require 'Time' | |
file = File.new(ARGV[0], "r") | |
while (line = file.gets) |
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 machine is a new MacBook Pro, 2.8Ghz Intel Core 2 Duo, 7200RPM drive with 4G RAM. | |
$ ./Bonnie -m lambdanew -s 8192 | |
File './Bonnie.13603', size: 8589934592 | |
Writing with putc()...^C | |
lambda:bonnie-64-read-only stevej$ ./Bonnie -m lambdanew -s 8192 | |
File './Bonnie.13604', size: 8589934592 | |
Writing with putc()...done | |
Rewriting...done | |
Writing intelligently...done | |
Reading with getc()...done |
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
# These are the results of running bonnie64 on my old MacBook Pro (Model 2,2) 2.3Ghz, 3G RAM, and 5400 RPM drive. | |
$ ./Bonnie -m lambdaold -s 8192 | |
File './Bonnie.628', size: 8589934592 | |
Writing with putc()...done | |
Rewriting...done | |
Writing intelligently...done | |
Reading with getc()...done | |
Reading intelligently...done | |
Seeker 2...Seeker 3...Seeker 1...start 'em...done...done...done... | |
-------Sequential Output-------- ---Sequential Input-- --Random-- |
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
scala> def foo!@$# = null | |
<console>:1: error: '=' expected but identifier found. | |
def foo!@$# = null | |
^ | |
scala> def foo_!@$# = null | |
<console>:1: error: '=' expected but identifier found. | |
def foo_!@$# = null | |
^ | |
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
#!/usr/bin/ruby | |
# | |
# Testing whether sorting then reversing is faster than sorting "the right way". | |
# Short answer: sort/reverse are written in C, your own sort function will be written in Ruby. | |
require 'benchmark' | |
n = 1_000 | |
ids = (0..10_000).to_a.sort_by { rand } |
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
# Used in conjuction with mysqlbinlog, this awk script will print out | |
# the SQL operation and the table being modified. | |
# Collate with sort | uniq -c | sort -rn | |
/^UPDATE/{ print $1, $2 } | |
/^INSERT|^DELETE/{ print $1, $3} |
OlderNewer