Skip to content

Instantly share code, notes, and snippets.


Avi Flax aviflax

View GitHub Profile
aviflax / Feature Request: hide vendored code in PR
Created Aug 25, 2015
GitHub feature request WRT Go projects using gb to vendor dependencies
View Feature Request: hide vendored code in PR

My team uses Go. Most of our repos use the vendoring tool Godep to vendor dependencies. The diff view of Pull Requests conveniently collapses those files, that’s very helpful!

We’re now experimenting with a different tool: gb. With gb, all project dependencies are in the root-level folder vendor. It would be great if you guys would auto-collapse these files as well.

Thanks so much!


PS, Go 1.5, which was recently released, includes an experimental approach to code vendoring which is different from both Godep and gb. You can read about it here:

View profiling nb2.js with node 0.1.21
Statistical profiling result from v8.log, (3315 ticks, 25 unaccounted, 0 excluded).
ticks total nonlib name
25 0.8%
[Shared libraries]:
ticks total nonlib name
2512 75.8% 0.0% /usr/lib/libSystem.B.dylib
668 20.2% 0.0% /usr/local/bin/node
View XmlSanity Performance.story
import com.arc90.xmlsanity.validation.*
/* These scenarios were set up for an aluminum 13" Apple MacBook,
2.4 GHz Intel Core 2 Duo, 4 GB RAM, and an SSD; running OS X 10.6.2, Java 1.6.0_17 64-bit, and easyb 0.9.6 */
scenario "Single-Threaded XSD validation should be fast", {
given "an XSD file", {
xsdFile = new File("resources/schemata/wadl.xsd")
View node_listen.js
// Listens on a port and just prints whatever it receives.
// Very useful for debugging
var net = require('net'),
sys = require('sys');
var server = net.createServer(function (stream) {
stream.addListener('connect', function () {
View pretty-print-xml-string-with-jdom.cfml
<cffunction name="prettyXml">
<cfargument name="xml" required="yes" type="string" />
<!--- initialize sax builder --->
<cfset builder = createObject("java", "org.jdom.input.SAXBuilder").init()>
<!--- initialize the formatter --->
<cfset format = createObject("java", "org.jdom.output.Format").getPrettyFormat()>
<!--- initialize the outputer --->
<cfset out = createObject("java", "org.jdom.output.XMLOutputter").init(format)>
aviflax / client.groovy
Created Jan 20, 2011
A server and client for very simple benchmarking of Restlet 1.1 and 2.0. The focus is on a fixed server using Restlet 2.0.4 with Jetty, being used by various client scenarios — Restlet 1.1 and 2.0, Apache HttpClient 3.1 and 4.0, the Restlet Net connector.
View client.groovy
/*** SETTINGS ***/
requestsToSend = args.length >= 1 ? args[0] as Integer : 1000
concurrency = args.length >= 2 ? args[1] as Integer : 10
port = args.length >= 3 ? args[2] as Integer : 3000
/*** /SETTINGS ***/
aviflax / apache_client_3.groovy
Created Jan 20, 2011
Benchmarking HTTP client performance using Apache HttpClient 3.1 and 4.0 with and without Restlet 1.1 and 2.0. The server is a constant value (always warmed up) and I tried to make the scripts as identical as possible.
View apache_client_3.groovy
#!/usr/bin/env groovy -cp restlet-1.1.10/httpclient/*
/*** SETTINGS ***/
requestsToSend = args.length >= 1 ? args[0] as Integer : 10000
concurrency = args.length >= 2 ? args[1] as Integer : 10
port = args.length >= 3 ? args[2] as Integer : 3000
aviflax /
Created Feb 10, 2011
über-simple screen sharing for anyone running OS X. By Rui Carmo: with a few tweaks by Avi Flax <>
#!/usr/bin/env python
## uber-simple screen sharing for OS X
## by Rui Carmo -
## with a few tweaks by Avi Flax <>
import os, socket, datetime, SimpleHTTPServer, SocketServer, StringIO, sys
if len(sys.argv) >= 2:
PORT = int(sys.argv[1])
aviflax / annotation test.html
Created Feb 13, 2011
Illustrates a problem I'm having with dygraph annotations
View annotation test.html
<html lang="en">
<meta charset="utf-8">
<title>Annotation Test</title>
<meta name="author" content="Avi Flax">
<script src="dygraph-combined.js"></script>
aviflax / clipboardserver.groovy
Created May 9, 2011
Simple little web app for clipboard exchange -- handles text and files
View clipboardserver.groovy
#!/usr/bin/env groovy
@GrabResolver(name='restlet', root='')
@Grab(group='org.restlet.jse', module='org.restlet', version='[2.0,2.1[')
import java.awt.*
import java.awt.datatransfer.*
import java.util.logging.*