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
Escape character is '^]'. | |
GET /foo.txt HTTP/1.1 | |
Host: www.example.com | |
HTTP/1.1 200 OK | |
Transfer-Encoding: chunked | |
0 |
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
Updating git repository `https://github.com/iron/iron.git` | |
fatal: Not a git repository: '.' | |
Unable to update https://github.com/iron/iron.git | |
Caused by: | |
Unable to update https://github.com/iron/iron.git | |
Caused by: | |
Executing `git fetch --force --quiet origin` failed |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>French blogs</title> | |
</head> | |
<body> | |
<outline text="Actualitiés" title="Actualitiés"> | |
<outline type="rss" text="Le Monde.fr - Actualité à la Une" title="Le Monde.fr - Actualité à la Une" xmlUrl="http://www.lemonde.fr/rss/sequence/0,2-3208,1-0,0.xml" htmlUrl="http://www.lemonde.fr/rss/une.xml"/> | |
<outline type="rss" text="LE FIGARO - Le Figaro - Actualité en direct et informations en continu" title="LE FIGARO - Le Figaro - Actualité en direct et informations en continu" xmlUrl="http://www.lefigaro.fr/rss/figaro_une.xml" htmlUrl="http://www.lefigaro.fr/"/> |
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
macro_rules! try_opt( | |
($e:expr) => (match $e { Some(v) => v, None => return None }); | |
) |
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
impl FromStr for LanguageTag { | |
fn from_str(s: &str) -> Option<LanguageTag> { | |
fn parse(s: &str) -> Option<Tag> { from_str(s) } | |
let parsed: Option<Vec<Tag>> = collect(s.split('-').map(parse)); | |
match parsed { | |
Some(components) => Some(LanguageTag { components: components }), | |
None => None | |
} | |
} | |
} |
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
$ heroku run ldd ./lang-detect | |
Running `ldd ./lang-detect` attached to terminal... up, run.9621 | |
linux-vdso.so.1 => (0x00007fff82163000) | |
librustful-9550c8e3-0.1-pre.so => /app/./lib/rustful/lib/librustful-9550c8e3-0.1-pre.so (0x00007f67ee595000) | |
libnative-1fb5e2c0-0.11.0-pre.so => not found | |
libhttp-2cee9fa1-0.1-pre.so => /app/./lib/rustful/lib/libhttp-2cee9fa1-0.1-pre.so (0x00007f67ee283000) | |
libcollections-d412c0c4-0.11.0-pre.so => not found | |
librand-2ea8f361-0.11.0-pre.so => not found | |
libstd-59beb4f7-0.11.0-pre.so => not found | |
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f67ee06b000) |
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
defmodule OcrMap.Parse do | |
use Bitwise, only_operators: true | |
def parse_7bit_encoded_int(rest) do | |
parse_7bit_encoded_int(rest, 0, 0) | |
end | |
def parse_7bit_encoded_int(<< 0::1, bits::7, rest::binary >>, shift, acc) do | |
{ (bits <<< shift) + acc, rest } | |
end |
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
<!-- Mocha test output goes here. --> | |
<div id="mocha"></div> | |
<!-- Handlebars templates for our application. --> | |
<script type="text/x-handlebars"> | |
<h1>Testing Ember.js with Mocha</h1> | |
{{outlet}} | |
</script> | |
<script type="text/x-handlebars" data-template-name="index"> |
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
# -*- coding: utf-8 -*- | |
require "rubygems" | |
require "bundler/setup" | |
require "nokogiri" | |
File.open('verbs-0-2-0.xml') do |f| | |
doc = Nokogiri::XML(f) | |
doc.css('Prototype').each do |p| | |
sprésent = p.attr('SPRÉSENT') |
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
// ==UserScript== | |
// @name HTLAL Fixups | |
// @description Make how-to-learn-any-language.com work a bit better. | |
// @match http://how-to-learn-any-language.com/* | |
// ==/UserScript== | |
// Fix word-wrap in textareas, so URLs don't get broken and posts don't get | |
// formatted strangely. | |
var textareas = document.getElementsByTagName("textarea"); | |
for (var i = 0; i < textareas.length; i++) { |