Skip to content

Instantly share code, notes, and snippets.

View diegoeche's full-sized avatar

Diego Echeverri diegoeche

View GitHub Profile
;; stuff
(setq search-highlight t)
(setq query-replace-highlight t)
(setq default-fill-column 85)
(setq next-line-add-newlines nil)
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 1241 | 1039 | 11 | 88 | 8 | 9 |
| Helpers | 328 | 286 | 0 | 8 | 0 | 33 |
| Models | 1538 | 1259 | 13 | 127 | 9 | 7 |
| Libraries | 2007 | 1708 | 21 | 189 | 9 | 7 |
| Integration tests | 4243 | 3388 | 28 | 38 | 1 | 87 |
| Functional tests | 105 | 82 | 6 | 7 | 1 | 9 |
| Unit tests | 1084 | 855 | 17 | 13 | 0 | 63 |
require "benchmark"
class TimeoutMeasurerMM
def initialize(obj)
@obj = obj
end
def method_missing(meth, *args, &block)
if @obj.respond_to? meth
begin
author = "John & Diane"
title = "Our Life & Work"
url = "http://somewiki.com/index.php?book=#{author}:#{title}"
encoded = "#{URI.encode(url)}&action=edit"
class AdminUserProvider
FILE_PATH = "authorized"
def load_all
# The real list
{1234 => {:name => "Diego", :role => "admin" }}
end
end
class FakeAdminUserProvider
def save
module Main where
import Data.List
import Control.Parallel
import Control.Parallel.Strategies
import Test.QuickCheck
range x y = [x..y]
naiveSum x y = sum $ range x y
;; then enter the text in that file's own buffer.
require "time"
party_time = Time.parse("5/04/2012 6:00:00 P.M.")
loop do
seconds_left = party_time.to_i - Time.now.to_i
puts "Seconds left to party: #{seconds_left}"
sleep(1)
end

API Documentation

Authentication

All interactions between the server, and the API user must be authenticated using a private token which only the server, and API user know about. In this documentation these two parameters will not be added, but a 401 will be returned if they are not correct supplied.

Two parameters must always be passed to the API.

FakeIdProvider = Class.new do
def default_timeline(_)
"1"
end
end
Nywt::VoucherItem.time_identifier_provider = FakeIdProvider.new