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
# Fill in multiple form fields using a table. Use it as follows: | |
# | |
# When I fill in the fields | |
# | Field 1 | Value 1 | | |
# | Field 2 | Value 2 | | |
When /^I fill in the fields$/ do |table| | |
table.rows_hash.each {|field, value| fill_in field, :with => value } | |
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
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
type alias Model = | |
{ errorMessage: Maybe String -- This is what Rails would call a "flash": we just show it. | |
, video: Maybe Video.Model -- Information about a video and subtitles. | |
, player: Maybe VideoPlayer.Model -- Player state: URL, playing/paused, time. | |
} | |
type Action | |
= VideoLoaded Video.Model | |
| VideoPlayerAction VideoPlayer.Action |
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++) { |
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
<div class="signes">{{Signes H}}</div> | |
<input type="button" value="Translittération" onclick="document.getElementById('transliteration').className += ' shown'; this.style.display = 'none'; return false;"> | |
<div id="transliteration" class="transliteration">{{Translittération}}</div> |
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 -*- | |
# Ceci n'est pas une entrée. :-) Cette expression rationelle ( ou « | |
# regulière », si on préfère l'anglicisme ) correspond à quelques entrées | |
# fausses. | |
FAUSSES_ENTRÉES = | |
/^10 Natural|(13|19) Creating|15 Nouns|21 Adjectives|2[235] Verbs|24 Use|26 Adverbs/ | |
# Valides parties du discours trouvées dans ce dictionnaire. | |
PARTIES_DU_DISCOURS = {} |
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
package main | |
// Holds any type of value. | |
var mixedSlice = make([]interface{}, 0) | |
// Holds only quaternions. | |
var quaternionSlice = make([]Quaternion, 0) | |
// A huge pass-by-value type: 256 bits wide. | |
type Quaternion struct { |
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
package scratch | |
type Foo struct { | |
} | |
func (f Foo) Frob() { | |
} | |
type Bar interface { | |
Frob() |