Skip to content

Instantly share code, notes, and snippets.

View miclovich's full-sized avatar
😇
Semper fidelis

Victor miclovich

😇
Semper fidelis
View GitHub Profile

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb

Massive file upload using JQueryUpload + Nginx + Rails + Sidekiq

The goal: Upload several files (virtually big files) to a Rails application without compromising the user experience.

Architecture

jQuery File Upload + Nginx + Rails (Carrierwave) + Sidekiq

  1. jQuery File Upload (http://blueimp.github.io/jQuery-File-Upload/)
"""
slidingPuzzle.py
Emily Johnston
4/26/2014
A command-line, single-player sliding puzzle game of customizable size and difficulty.
"""
import sys
from random import choice
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
private :resource_params
end

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

@miclovich
miclovich / osx_lion_rail_setup.md
Created February 16, 2012 08:41 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@miclovich
miclovich / DashboardLayout.java
Created August 16, 2011 11:29 — forked from romannurik/DashboardLayout.java
A custom Android layout class that arranges children in a grid-like manner, optimizing for even horizontal and vertical whitespace.
/*
* ATTENTION:
*
* This layout is now maintained in the `iosched' code.google.com project:
*
* http://code.google.com/p/iosched/source/browse/android/src/com/google/android/apps/iosched/ui/widget/DashboardLayout.java
*
*/
/*
# Другие переводы на http://github.com/plataformatec/devise/wiki/I18n
ru:
errors:
messages:
not_found: "не найдена"
already_confirmed: "уже подтверждена. Пожалуйста, попробуйте войти в систему"
not_locked: "не заблокирована"
not_saved:
one: '%{resource}: сохранение не удалось из-за %{count} ошибки'