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 -*- | |
"""Tutrial: Detect square markers with OpenCV 2.4 in Python 2.7. | |
(C) 2013 Shintaro Seki | |
MIT License | |
The marker used in this program can be generated by the following script. | |
cv2.imwrite("marker.png", cv2.resize(np.array([ | |
[0, 0, 0, 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
#!/bin/bash | |
set -eu | |
: ${IO_RUNNING_FILE:=.io_running} | |
: ${IO_STDIN_FILE:=.io_stdin} | |
: ${IO_STDOUT_FILE:=.io_stdout} | |
io.help() { | |
cat <<EOT | |
Usage: io <command> [<args>] |
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
(function() { | |
const THRESHOLD = 400; | |
function isEndOfList() { | |
return document.querySelector("#endOfListMarker") !== null; | |
} | |
function scroll(top) { | |
document.scrollingElement.scrollTop = top; |
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 | |
import ( | |
"bufio" | |
"bytes" | |
"compress/gzip" | |
"encoding/binary" | |
"fmt" | |
"io" | |
"log" |
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 | |
import ( | |
"bufio" | |
"bytes" | |
"encoding/binary" | |
"fmt" | |
"io" | |
"log" | |
"net" |
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 | |
import ( | |
"compress/gzip" | |
"io" | |
"log" | |
"net" | |
) | |
type hello 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
#!/usr/bin/env ruby | |
require 'yaml' | |
def puts_sh_kv(key, value) | |
escaped_value = value.gsub(/"/, '\\"') | |
puts %(function #{key}() { echo "#{escaped_value}"; }) | |
end | |
def print_sh(data, key_prefix: '') | |
data.each do |key, value| |
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 'optparse' | |
# @param bytes [String] Byte sequence as needle. | |
# @param io [IO] IO object as haystack. | |
# @param max [Integer, nil] Stop search when `max` number of `bytes` are found. | |
# @return [Array<Integer>] | |
def search(bytes, io, max = nil) | |
buf_size = bytes.size * 10 | |
buf = '' |
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
#include "foo.h" | |
int get_foo_a() { return foo; } |
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 | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/http/httptest" |