Skip to content

Instantly share code, notes, and snippets.

View jpalumickas's full-sized avatar
🚀
Hacking

Justas Palumickas jpalumickas

🚀
Hacking
View GitHub Profile
@jpalumickas
jpalumickas / mysql2-mojave.md
Created December 2, 2019 16:07 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@jpalumickas
jpalumickas / memory.rb
Created July 10, 2018 08:19
Check memory usage for Process in Ruby
require 'benchmark'
def print_memory_usage
memory_before = `ps -o rss= -p #{Process.pid}`.to_i
yield
memory_after = `ps -o rss= -p #{Process.pid}`.to_i
puts "Memory: #{((memory_after - memory_before) / 1024.0).round(2)} MB"
end

Keybase proof

I hereby claim:

  • I am jpalumickas on github.
  • I am jpalumickas (https://keybase.io/jpalumickas) on keybase.
  • I have a public key ASAf0-1QmH7XuIEFN6csCSxI1Rh74yhfgiCGTYfj_qvpcQo

To claim this, I am signing this object:

@jpalumickas
jpalumickas / README.md
Last active August 29, 2015 14:07
Rails Girls 2014
@jpalumickas
jpalumickas / baruco2014_presentations.md
Last active August 29, 2015 14:06
Baruco 2014 Presentations

Baruco 2014

Friday

Yukihiro Matsumoto (mruby: AltRuby)

Piotr Szotkowski (Standard Library, Uncommon Uses) http://talks.chastell.net/baruco-2014

Pat Shaughnessy (Twenty Thousand Leagues Under ActiveRecord)

@jpalumickas
jpalumickas / devise.lt.yml
Last active October 5, 2023 12:23
Devise 3.2 Lithuanian translation
lt:
devise:
confirmations:
confirmed: "Jūsų el. pašto adresas sėkmingai patvirtintas."
send_instructions: "Už kelių minučių el. paštu gausite instrukcijas, kaip patvirtinti savo vartotoją."
send_paranoid_instructions: "Jei jūsų el. pašto adresas yra mūsų duomenų bazėje, kelių minučių bėgyje gausite laišką su patvirtinimo instrukcijomis."
failure:
already_authenticated: "Jūs jau esate prisijungęs."
inactive: "Jūsų vartotojas dar nepatvirtintas."
invalid: "Neteisingas el. paštas arba slaptažodis."
# -*- encoding : utf-8 -*-
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
namespace :deploy do
namespace :assets do
desc <<-DESC
Run the asset precompilation rake task. You can specify the full path \
to the rake executable by setting the rake variable. You can also \
@jpalumickas
jpalumickas / rails_admin.lt.yml
Created December 26, 2013 11:15
Rails Admin Lithuanian I18n (not full translated)
lt:
admin:
js:
true: Taip
false: Ne
is_present: Is present
is_blank: Is blank
date: Data ...
between_and_: Tarp ... ir ...
today: Today
@jpalumickas
jpalumickas / Capfile
Created October 25, 2013 07:02
Automatically skip assets precompiling if no changes were made.
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'deploy/assets'
Dir['config/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
require 'resque/errors'
class DatabaseBackupJob
def self.perform(id, foo, bar)
# do backup work
rescue Resque::TermException
# write failure to database
# re-enqueue the job so the job won't be lost when scaling down.
Resque.enqueue(DatabaseBackupJob, id, foo, bar)