This file contains hidden or 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 "sinatra/base" | |
| require "sinatra/namespace" | |
| require "multi_json" | |
| require "api/authentication" | |
| require "api/error_handling" | |
| require "api/pagination" | |
| module Api | |
| class Base < ::Sinatra::Base |
This file contains hidden or 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
| filter { | |
| grok { | |
| match => [ "message", "%{TIMESTAMP_ISO8601:ts} \[%{USERNAME:spider}\] %{LOGLEVEL:level}: Crawled %{NUMBER:pages2:int} pages \(at %{NUMBER:pages_rate2:int%} pages/min\), scraped %{NUMBER:items2:int} items \(at %{NUMBER:items_rate2:int%} items/min\)" ] | |
| } | |
| } |
This file contains hidden or 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 | |
| module W | |
| class Token | |
| attr_reader :value, :tags | |
| def initialize(value) | |
| @value = value | |
| @tags = [] | |
| end |
This file contains hidden or 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
| class Tag | |
| class << self | |
| attr_accessor :match | |
| attr_accessor :children | |
| end | |
| self.children = [] | |
| def self.inherited(klass) | |
| Tag.children << klass |
This file contains hidden or 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
| uses crt; | |
| type ara=array[1..10,1..10] of integer; | |
| var t:ara; | |
| n:integer; | |
| f:text; | |
| procedure citire(m:integer); | |
| var i,j,k:integer; | |
| begin | |
| k:=1; |
This file contains hidden or 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
| CREATE OR REPLACE FUNCTION process_timetravel_before() RETURNS TRIGGER AS $timetravel_before$ | |
| DECLARE | |
| temp_row RECORD; -- a temporary variable used on updates/deletes | |
| time_now TIMESTAMP; -- get the time now just once.... for consistency's sake | |
| BEGIN | |
| time_now = now(); | |
| IF (TG_OP = 'UPDATE' OR TG_OP = 'DELETE') THEN | |
| -- the user should not be able to update historic rows |
This file contains hidden or 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 | |
| # | |
| # Install Postgres 9.2 on a clean Ubuntu 12.04 | |
| """ | |
| LC_ALL issue | |
| comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file. | |
| sudo apt-get install language-pack-en-base | |
| sudo dpkg-reconfigure locales | |
| comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file. |
This file contains hidden or 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
| [ | |
| {"US":"United States"}, | |
| {"CA":"Canada"}, | |
| {"AF":"Afghanistan"}, | |
| {"AL":"Albania"}, | |
| {"DZ":"Algeria"}, | |
| {"DS":"American Samoa"}, | |
| {"AD":"Andorra"}, | |
| {"AO":"Angola"}, | |
| {"AI":"Anguilla"}, |
This file contains hidden or 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
| /*! normalize.css v2.0.1 | MIT License | git.io/normalize */ | |
| /* ========================================================================== | |
| HTML5 display definitions | |
| ========================================================================== */ | |
| /* | |
| * Corrects `block` display not defined in IE 8/9. | |
| */ |