Ernest Bursa dla SKN Atena.
rails new euro2012
cd euro2012/
#lib/paperclip_processors/loseless_reduce.rb | |
require 'reduce' | |
## LoseLessReduce | |
# This module is able to reduce js, css, jpg, png or gif files | |
# thanks to gem reduce by grosser (via yui compressor or punnyPng) | |
# https://github.com/grosser/reduce | |
module Paperclip | |
class LoselessReduce < Processor |
# -*- encoding : utf-8 -*- | |
module UrlHelper | |
def with_subdomain(subdomain) | |
subdomain = (subdomain || "") | |
subdomain += "." unless subdomain.empty? | |
domain_woport = request.domain.gsub(/:{1}\d*/, '') | |
[subdomain, request.domain].join #request.port_string | |
end | |
def url_for(options = nil) |
# encoding: utf-8 | |
class SimpleCipher | |
def initialize(randomized) | |
alphasum = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a + [' '] | |
@map = alphasum.zip(randomized).inject(:encrypt => {} , :decrypt => {}) do |output,(a,b)| | |
output[:encrypt][a] = b | |
output[:decrypt][b] = a | |
output | |
end |
require 'stilts-stomp-client' | |
require 'json' | |
client = Stilts::Stomp::Client.new("localhost:8675") | |
client.connect | |
# Using headers due to missing TorqueBox stomp username and password functionality | |
headers = org.projectodd.stilts.stomp::DefaultHeaders.new | |
headers.putAll({ 'api_key' => 'tpG8jY1SnbSeQvS9Ip2dhQ' }) |
# Get Sudo. | |
if [ $EUID != 0 ]; then | |
sudo "$0" "$@" | |
exit $? | |
fi | |
# Install Xcode first - https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 | |
# Install Xcode command line tools. | |
xcode-select --install |
Hi 👋! Thank you for taking the time to participate in this coding challenge to develop a backend service. The following task is going to show us your skills, experience and coding style. Please remember that you can use as many tools as you feel comfortable with.
We expect that it will take 3-8 hours to complete this exercise. While you're welcome to take as much extra time as you'd like to clean up or improve the codebase, it's not required. If there's something that you would have done in a "real" production environment, feel free to add details to your README
, so we can better understand what next steps that you'd take.
const functions = require('@google-cloud/functions-framework'); | |
const { Storage } = require('@google-cloud/storage'); | |
const ExifTransformer = require('exif-be-gone'); | |
const stream = require('stream'); | |
const util = require('util'); | |
const storage = new Storage(); | |
const pipeline = util.promisify(stream.pipeline); |