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 'RMagick' | |
class WatermarkMe | |
def initialize(app, args) | |
@app = app | |
@watermark_text, @mime_types = *args | |
@mime_types ||= %w[image/jpeg image/png image/gif] | |
end | |
def call(env) |
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
From e6ec1f637ab3d6c235eef05142abf373e08f5c4b Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Andreas=20Garn=C3=A6s?= <[email protected]> | |
Date: Thu, 2 Sep 2010 12:35:37 +0200 | |
Subject: [PATCH] ActiveModel#to_xml fix (renamed parameter). | |
--- | |
activemodel/lib/active_model/serializers/xml.rb | 2 +- | |
activeresource/test/cases/base_test.rb | 6 ++++++ | |
2 files changed, 7 insertions(+), 1 deletions(-) |
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
da: | |
errors: | |
messages: | |
not_found: "ikke fundet" | |
already_confirmed: "er allerede bekræftet" | |
not_locked: "var ikke låst" | |
devise: | |
failure: | |
unauthenticated: 'Du skal logge ind for at kunne fortsætte.' |
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
class RBLineProfiler | |
WALL_TIME_LIMIT = 10e3 # ms | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
result = nil | |
profile = lineprof(/./) { result = @app.call(env) } |
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
{"script":"(a+b)*c*d", "context": {"a": 3, "b": 5, "c": 7, "d": 11}} |
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
open Core.Std | |
open Async.Std | |
module Ints = struct | |
type t = int | |
let to_string = string_of_int | |
let of_string = int_of_string | |
end | |
module IntCache = Memcached.Make(Ints) |
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
# Start with these | |
[0, [0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0]] | |
[20, [1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]] | |
# Games with a spare | |
[29, [5,5, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]] | |
[38, [5,5, 1,9, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]] | |
# Games with a strike | |
[30, [1,1, 10, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]] |
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 ( | |
"bytes" | |
"crypto/rand" | |
"encoding/gob" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"time" |
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 ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"github.com/graphql-go/graphql" | |
) |
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" | |
"github.com/andreas/podio-go" | |
) | |
func main() { | |
authToken, err := podio.AuthWithUserCredentials("my-client-id", "my-client-secret", "my-username", "my-password") |
OlderNewer