Skip to content

Instantly share code, notes, and snippets.

View umate's full-sized avatar
🚀
to the moon

Art Litvinau umate

🚀
to the moon
View GitHub Profile
@umate
umate / image_uploader.rb
Last active December 3, 2023 03:05
CarrierWave gaussian blur filter using MiniMagick
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
version :blurred do
process :blur
end
def blur(radius=16)
manipulate! do |img|
original_path = img.path
@umate
umate / 0_reuse_code.js
Created June 2, 2014 12:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@umate
umate / isbn_calculator.rb
Last active August 29, 2015 14:23
ISBN Calculator
class ISBNCalculator
def initialize(barcode)
@barcode = barcode.to_s
end
def ISBN
"#{@barcode}#{check_digit}"
end
private
class Service
def self.instance
@instance ||= self.new
end
def initialize
end
def perform_action
puts 'aciton performing'
@umate
umate / gist:d7a46d716186199ef62e
Last active December 27, 2015 11:08 — forked from afilhodaniel/gist:09a1df8eafeabe1584c6
Upload photos to Instagram via private API with Ruby
class InstagramPrivateController < ApplicationController
def initialize(username, password, photo, caption)
@username = username
@password = password
@photo = photo
@caption = caption
@cookiepath = Tempfile.new('cookies').path
@user_agent = generate_user_agent()