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 ( | |
"fmt" | |
"reflect" | |
) | |
// Name of the struct tag used in examples | |
const tagName = "validate" |
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
- | |
./pma2/0.1 libwww-perl/5.805 | |
Aghaven/Nutch-1.2 | |
Baiduspider+(+http://www.baidu.com/search/spider.htm) | |
BlackBerry9000/4.6.0.167 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102 ips-agent | |
BlackBerry9330/5.0.0.857 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/105 | |
EMail Exractor | |
Gigabot/3.0 (http://www.gigablast.com/spider.html) | |
Gimmie60/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) | |
Googlebot-Image/1.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
require "json" | |
require "digest" | |
require "logger" | |
class SlowQueryLogger | |
def initialize(output = nil, opts = {}) | |
# will log any query slower than 500 ms | |
@threshold = opts.fetch(:threshold, "500").to_i | |
@logger = Logger.new(output || STDOUT) |
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
require "faraday" | |
require "faraday_middleware" | |
module OpenTable | |
class Error < StandardError ; end | |
module Request | |
API_BASE = "http://opentable.herokuapp.com" | |
def connection |
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 | |
charspool=('a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' | |
'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z' '0' '1' '2' '3' '4' '5' '6' '7' | |
'8' '9' '0' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' | |
'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z' '-' '_'); | |
len=${#charspool[*]} | |
if [ $# -lt 1 ]; then |
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
source :rubygems | |
gem 'terminal-notifier' | |
gem 'pusher-client', :git => 'git://github.com/pusher/pusher-ruby-client.git' |
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
Chain INPUT (policy DROP) | |
target prot opt source destination | |
ufw-before-logging-input all -- anywhere anywhere | |
ufw-before-input all -- anywhere anywhere | |
ufw-after-input all -- anywhere anywhere | |
ufw-after-logging-input all -- anywhere anywhere | |
ufw-reject-input all -- anywhere anywhere | |
ufw-track-input all -- anywhere anywhere | |
Chain FORWARD (policy DROP) |
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
require "nokogiri" | |
class CoverageParser | |
attr_reader :files, | |
:files_count, | |
:coverage_percent, | |
:avg_hit, | |
:lines_total, | |
:lines_relevant, | |
:lines_missed, |
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( | |
"os" | |
"fmt" | |
"net/http" | |
"github.com/jessevdk/go-flags" | |
) | |
type ServerOptions 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 main | |
import( | |
"os" | |
"fmt" | |
"net/http" | |
"io/ioutil" | |
"encoding/json" | |
) |
NewerOlder