Skip to content

Instantly share code, notes, and snippets.

@al3x
al3x / update_git_submodules.sh
Created December 7, 2009 22:43
Brute force updates and directories beneath the current directory that might be git submodules (or just cloned repos).
for i in $(find . -d 1 -type d); do cd $i; echo $i; git pull; cd ..; echo ""; done
val scanner = new ThriftFileScanner[YourThriftClassName]
scanner.allRecordsFromFile("/tmp/dump.thrift.gz") { println(_) }
import com.facebook.thrift.{TBase, TDeserializer}
import java.io.{BufferedInputStream, DataInputStream, File, FileInputStream, InputStream}
import java.util.zip.GZIPInputStream
import net.lag.logging.Logger
import scala.reflect.Manifest
// you'll want to import your generated Thrift package too!
class ThriftFileScanner[T <: TBase](implicit man: Manifest[T]) {
val log = Logger.get
var bufferedIn: BufferedInputStream = null
lazy val thrift = task {
val javaDirectoryPath = "src/main/java"
val rubyDirectoryPath = "src/main/ruby"
val thriftFile = "src/main/thrift/YourThriftDealie.thrift"
"thrift --gen java -o %s %s".format(javaDirectoryPath, thriftFile) ! log
"thrift --gen rb -o %s %s".format(rubyDirectoryPath, thriftFile) ! log
None
} describedAs("Build Thrift stuff.")
override def mainClass = Some("com.yourcompany.yourproject.Main")
/**
* In the classpath:
* - all dependencies (via Ivy/Maven and in lib)
* - package classes
* On the filesystem:
* - scripts
* - config
*/
import java.io.{BufferedReader, File, InputStream, InputStreamReader, IOException, PrintWriter, Writer}
import java.net.{InetAddress, ServerSocket, Socket, SocketException}
import java.util.concurrent.Executors
import net.lag.logging.Logger
import scala.actors.Actor
import scala.actors.Actor._
import scala.tools.nsc._
class RemoteDebugServer(port: Int) {
$ irb
>> 1.class
=> Fixnum
>> 1.respond_to?(:dup)
=> true
>> 1.dup
TypeError: can't dup Fixnum
from (irb):3:in `dup'
from (irb):3
Warning: arch-dependent data dir (/Users/ieure/Projects/emacs/nextstep/Emacs.app/Contents/MacOS/libexec/emacs/23.1.50/i386-apple-darwin9.8.0/) does not exist.
Warning: arch-independent data dir (/Users/ieure/Projects/emacs/nextstep/Emacs.app/Contents/Resources/share/emacs/23.1.50/etc/) does not exist.
Error: charsets directory (/Users/ieure/Projects/emacs/nextstep/Emacs.app/Contents/Resources/share/emacs/23.1.50/etc/charsets) does not exist.
Emacs will not function correctly without the character map files.
Please check your installation!
byte-code: Cannot open load file: warnings
10/6/09 2:09:00 PM [0x0-0xc5bc5b].org.gnu.Emacs[27169] dyld: Library not loaded: /opt/local/lib/libdbus-1.3.dylib
10/6/09 2:09:00 PM [0x0-0xc5bc5b].org.gnu.Emacs[27169] Referenced from: /Applications/Emacs.app/Contents/MacOS/Emacs
10/6/09 2:09:00 PM [0x0-0xc5bc5b].org.gnu.Emacs[27169] Reason: no suitable image found. Did find:
10/6/09 2:09:00 PM [0x0-0xc5bc5b].org.gnu.Emacs[27169] /opt/local/lib/libdbus-1.3.dylib: mach-o, but wrong architecture
10/6/09 2:09:00 PM com.apple.launchd.peruser.502[201] ([0x0-0xc5bc5b].org.gnu.Emacs[27169]) Job appears to have crashed: Trace/BPT trap
10/6/09 2:09:00 PM ReportCrash[27171] Saved crash report for Emacs[27169] version ??? (???) to /Users/al3x/Library/Logs/DiagnosticReports/Emacs_2009-10-06-140900_jaya.crash
[al3x@jaya FilePile:master|MERGING]$ git st
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# renamed: tags/5_1_RELEASE/lib/filepile/formatter.rb -> lib/filepile/formatter.rb
# deleted: tags/5_0_1_RC1/RAILS_README
# deleted: tags/5_0_1_RC1/README
# deleted: tags/5_0_1_RC1/Rakefile
# deleted: tags/5_0_1_RC1/app/controllers/account_controller.rb