Skip to content

Instantly share code, notes, and snippets.

View jberkel's full-sized avatar

Jan Berkel jberkel

View GitHub Profile
[:/Volumes/tbaplus/projects/enwikt-dump-rs] 86dfd01* ± rust-lldb ./target/debug/wiktionary_dump2 -- dump_parsed_templates --input enwiktionary-20191201-pages-articles-multistream.xml --format cbor --templates templates --namespaces template
error: module importing failed: Missing parentheses in call to 'print'. Did you mean print('Whoops! You are missing the <' + arg.argName + '> argument.')? (fblldb.py, line 98)
File "temp.py", line 1, in <module>
(lldb) command script import "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py"
(lldb) type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
(lldb) type category enable Rust
(lldb) target create "./target/debug/wiktionary_dump2"
Current executable set to './target/debug/wiktionary_dump2' (x86_64).
(lldb) settings set -- target.run-args "dump_parsed_templates" "--input" "enwiktionary-20191201-pages-articles-multistream.xml" "--format" "cbor" "--templates" "templates" "--namespaces" "template"
<?xml version="1.0" encoding="UTF-8"?>
<!-- track-length = 79030 filtered ascend = 1046 plain-ascend = 380 cost=144766 -->
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
creator="BRouter-1.4.11" version="1.1">
<trk>
<name>brouter_trekking_0</name>
<trkseg>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import com.almworks.sqlite4java.SQLiteConnection;
import com.almworks.sqlite4java.SQLiteException;
import com.almworks.sqlite4java.SQLiteStatement;
import de.tudarmstadt.ukp.jwktl.api.IWiktionaryEntry;
import de.tudarmstadt.ukp.jwktl.api.IWiktionarySense;
import de.tudarmstadt.ukp.jwktl.api.WiktionaryException;
import de.tudarmstadt.ukp.jwktl.api.entry.WiktionaryEntry;
import de.tudarmstadt.ukp.jwktl.api.entry.WiktionaryPage;
import de.tudarmstadt.ukp.jwktl.api.util.ILanguage;
import de.tudarmstadt.ukp.jwktl.parser.util.IDumpInfo;
<%
def html = new URL("http://www.gifbin.com/random").getText()
def images = html =~ /img src=['"](http:\/[^"']*\.gif)['"]/
def gif = images.collect { it[1] }[0]
if (gif != null) {
%>
<img src="<%= gif %>"/>
<% } %>
$ java \
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog \
-Dorg.apache.commons.logging.simplelog.showdatetime=true \
-Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG \
-Dorg.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR
@jberkel
jberkel / gist:7574502
Created November 21, 2013 01:27
simulating iOS reachability
$ host api.soundcloud.com
api.soundcloud.com is an alias for api-cdn.l.soundcloud.com.
api-cdn.l.soundcloud.com is an alias for cs97.wac.edgecastcdn.net.
cs97.wac.edgecastcdn.net has address 93.184.220.127
$ sudo route add -host 93.184.220.127 -interface gif0
add host 93.184.220.127: gateway gif0
$ scutil -r api.soundcloud.com
Reachable,Transient Connection,Connection Required
$ scutil
Pod::Spec.new do |s|
s.name = "sqlite3"
s.version = "3.7.16.2"
s.summary = "SQLite is an embedded SQL database engine."
s.homepage = "http://www.sqlite.org"
s.license = "Public Domain"
s.author = {"D. Richard Hipp" => "[email protected]"}
sqlite_version_format = "%.1d%.2d%.2d%.2d" % s.version.to_s.split('.').push(0)
@jberkel
jberkel / xctool.rb
Last active December 17, 2015 00:59
formula for xctool
# to install:
# curl https://raw.github.com/gist/5525293 > /usr/local/Library/Formula/xctool.rb && brew install xctool --HEAD
require 'formula'
class Xctool < Formula
homepage 'https://github.com/facebook/xctool.git'
head 'https://github.com/facebook/xctool.git'
def install
system "./build.sh"