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
ok.xml | |
fail.xml | |
run-me.o | |
run-me |
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/env ruby | |
require 'nokogiri' | |
input = <<EOF | |
<title> The journey </title> | |
</head> | |
<body> | |
<h1> The <index class = "estimate"> Trip </index> </h1> | |
<p> Our scavenger hunt consists of several stages, starting with the <index class = "treasure"> crossing </index> & mdash; how do we actually get to those islands. The nice thing about an intellectual quest is that we can be in all kinds of places at the same time. If we ever want to revisit a previous episode, all we have to do is click there, and even though we haven't finished a particular stage yet, we can already look ahead to the next. We can also keep in touch with fellow travelers who are in completely different places in the world of thought. |
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/env ruby | |
require "nokogiri" | |
xml = <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<kml xmlns="http://www.opengis.net/kml/2.2"> | |
<Document> | |
<name>Document.kml</name> | |
<Placemark> |
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
foo | |
foo.o | |
*.prof |
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
FROM ruby:2-alpine3.10 | |
RUN apk add build-base imagemagick6-dev bash | |
WORKDIR /app | |
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
CFLAGS=$(shell pkg-config libxml-2.0 --cflags) | |
LDFLAGS=$(shell pkg-config libxml-2.0 --libs) | |
foo: foo.o | |
$(CC) -o foo foo.o $(LDFLAGS) | |
foo.o: foo.c | |
$(CC) $(CFLAGS) -c -o foo.o foo.c |
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
# parsing a document 6731 bytes long | |
Warming up -------------------------------------- | |
nokogiri 488.000 i/100ms | |
rexml 21.000 i/100ms | |
Calculating ------------------------------------- | |
nokogiri 6.150k (±23.4%) i/s - 28.792k in 5.067345s | |
rexml 208.195 (± 5.3%) i/s - 1.050k in 5.056578s | |
Comparison: | |
nokogiri: 6150.3 i/s |
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
$ sudo apt-get remove libxml2 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
<snip> | |
The following packages will be REMOVED: | |
adobe-flashplugin apturl avahi-daemon avahi-utils banshee baobab bind9-host | |
bluez-gstreamer brasero brasero-cdrkit caribou cinnamon cinnamon-bluetooth | |
cinnamon-control-center cinnamon-screensaver cinnamon-session | |
cinnamon-settings-daemon cmake colord default-jre dnsutils dropbox emacs24 |
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
local tok = require("proxy.tokenizer") | |
function read_query(packet) | |
if (string.byte(packet) == proxy.COM_QUERY) then | |
local replacement_tokens = {} | |
local tokens = tok.tokenize(packet:sub(2)) | |
local modified_p = false | |
print("-----") | |
print(packet:sub(2)) | |
print(tok.normalize(tokens)) |
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/env ruby | |
# | |
# Script to turn "pomodoro mode" on/off in Gnome. | |
# | |
# Gnome has a little-known feature to put a timer around "typing | |
# breaks". This script makes it easy to turn on and off from the | |
# command line (or gnome-do, or what-have-you). | |
# | |
current_value = %x{gconftool --get /desktop/gnome/typing_break/enabled}.chomp |