Skip to content

Instantly share code, notes, and snippets.

View dajobe's full-sized avatar

Dave Beckett dajobe

View GitHub Profile
@dajobe
dajobe / gist:10894019
Last active August 29, 2015 13:59
rdfproc print
$ mkdir x
$ cd x
$ rdfproc test parse http://librdf.org/NEWS.rdf
rdfproc: Parsing URI http://librdf.org/NEWS.rdf with default parser
$ ls -l test*
-rw-r--r-- 1 dajobe dajobe 225280 Apr 16 08:26 test-po2s.db
-rw-r--r-- 1 dajobe dajobe 163840 Apr 16 08:26 test-so2p.db
-rw-r--r-- 1 dajobe dajobe 262144 Apr 16 08:26 test-sp2o.db
$ rdfproc test print | head
[[
@dajobe
dajobe / nghttp2-manpages.patch
Created February 14, 2014 18:21
Add manpages fo nghttp2
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 35b22c5..a46c15b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -21,6 +21,8 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+man_MANS = nghttp.1 nghttpd.1 nghttpx.1
+
diff --git a/configure.ac b/configure.ac
index bca01cc..8446316 100644
--- a/configure.ac
+++ b/configure.ac
@@ -399,6 +399,13 @@ AC_CONFIG_FILES([
python/Makefile
doc/Makefile
doc/conf.py
+ doc/_themes/Makefile
+ doc/_themes/sphinx_rtd_theme/Makefile
@dajobe
dajobe / dir.scala
Last active May 22, 2018 14:33
Get the methods on a class / object - aka python dir()
// Inspired by http://stackoverflow.com/questions/2886446/how-to-get-methods-list-in-scala
def dir(x: AnyRef): Unit = println(x.getClass.getMethods.map(_.getName).distinct.sorted.mkString(" "))
scala> dir("")
charAt codePointAt codePointBefore codePointCount compareTo compareToIgnoreCase concat contains contentEquals copyValueOf endsWith equals equalsIgnoreCase format getBytes getChars getClass hashCode indexOf intern isEmpty lastIndexOf length matches notify notifyAll offsetByCodePoints regionMatches replace replaceAll replaceFirst split startsWith subSequence substring toCharArray toLowerCase toString toUpperCase trim valueOf wait
@dajobe
dajobe / doc.md
Created August 27, 2013 18:45
Docker -p formats

Some documentation from reading the docker source code about what -p formats can be given to the docker run -p FORMAT IMAGE

FORMAT can be:

  • -p FRONT:BACK which maps FRONT on the host to BACK in the container
  • -p :PORT which is the same as -p PORT:PORT

This turns into "PortSpecs": [FRONT, BACK] config

It is related to the EXPOSE command in a dockerfile like EXPOSE FRONT:BACK or more typically EXPOSE BACK

NEWS
* Noteworthy changes in release 3.0 (2013-07-25) [stable]
** WARNING: Future backward-incompatibilities!
Like other GNU packages, Bison will start using some of the C99 features
for its own code, especially the definition of variables after statements.
The generated C parsers still aim at C90.
@dajobe
dajobe / thrift-0.9.0.md
Last active December 19, 2015 07:59
Build thrift on Ubuntu 10.04

Set up the development environment

$ mkdir -p ~/dev/thrift
$ cd ~/dev/thrift

Install the dependencies

Get some core development tools that are not direct dependencies below

@dajobe
dajobe / parquet.log
Last active December 14, 2015 21:08
parquet build log
$ git show-ref HEAD
bf1b4944a447de2bf5c39f9f910204da89ad1032 refs/remotes/origin/HEAD
$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)
$ mvn test
[INFO] Scanning for projects...
@dajobe
dajobe / gist:3876338
Created October 11, 2012 23:31
Build thrift 0.8.0 with just python on OSX
./configure '--prefix=/Users/dajobe/lib/thrift-0.8.0' '--enable-gen-cpp' '--disable-gen-java' '--disable-gen-as3' '--disable-gen-csharp' '--enable-gen-py' '--disable-gen-rb' '--disable-gen-perl' '--disable-gen-php' '--disable-gen-erl' '--disable-gen-cocoa' '--disable-gen-st' '--disable-gen-ocaml' '--disable-gen-hs' '--disable-gen-xsd' '--disable-gen-html' '--disable-gen-js' '--disable-gen-javame' '--without-csharp' '--without-java' '--without-erlang' '--with-python' '--without-perl' '--without-php' '--without-php_extension' '--without-ruby' '--without-haskell' 'PY_PREFIX=/Users/dajobe' 'PKG_CONFIG_PATH=/Users/dajobe/lib/pkgconfig' '--with-boost=/Users/dajobe/lib/boost'
@dajobe
dajobe / icu_is_nfc.c
Created March 11, 2012 18:40
icu_is_nfc.c
/*
* 4.8 if the pkgconfig files are present:
* gcc -g -o icu_is_nfc icu_is_nfc.c `pkg-config icu-uc --cflags --libs`
*
* Portable:
* gcc -g -o icu_is_nfc icu_is_nfc.c `icu-config --cppflags-searchpath --ldflags-searchpath` -licuuc
*/
#include <stdio.h>
#include <unicode/unorm.h>