Skip to content

Instantly share code, notes, and snippets.

View zvlex's full-sized avatar

Aleksandre Zutikov zvlex

View GitHub Profile
@zvlex
zvlex / paginate_helper.rb
Created April 7, 2016 10:20 — forked from maximum-pixels/paginate_helper.rb
This is a custom link renderer that will format the pagination bar with Bootstrap4 as well as AJAX (i.e. data-remote="true") to use jquery-ujs rails
module PaginateHelper
class PaginateJSLinkRenderer < WillPaginate::ActionView::LinkRenderer
def prepare(collection, options, template)
options[:params] ||= {}
options[:params]['_'] = nil
super(collection, options, template)
end
protected
def html_container(html)
@zvlex
zvlex / install.conf
Created February 29, 2016 19:33 — forked from Lh4cKg/install.conf
arch linux install configuration
1. select keymap
2. disk partitions
3. configure mirror list
4. base system install
5. configure fstab
6. configure hostname
7. configure locale | configure timezone
8. configure hardclock
9. configure network
10. configure pacman
@zvlex
zvlex / gist:84e31e9dbe2805c1cce6
Last active September 20, 2015 15:49 — forked from somebody32/gist:5232120
Список литературы для ознакомления с concurrent programming и реализацией этих принципов и подходов на ruby. Огромное спасибо @brainopia за составление.

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

doctype html
/[if lt IE 7]
| <html class="ie6">
/[if IE 7]
| <html class="ie7">
/[if IE 8]
| <html class="ie8">
/[if IE 9]
| <html class="ie9">
| <!--[if (gte IE 9)|!(IE)]<!--> <html> <!--<![endif]-->
# This snippet shows how TokenAuthenticatable works in Devise today.
# In case you want to maintain backwards compatibility, you can ditch
# devise's token mechanism in favor of this hand-rolled one. If not,
# it is recommended to migrate to the mechanism defined in the following
# snippet (2_safe_token_authenticatable.rb).
#
# In both snippets, we are assuming the User is the Devise model.
class User < ActiveRecord::Base
# You likely have this before callback set up for the token.
before_save :ensure_authentication_token