Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View crivotz's full-sized avatar
🏠
Working from home

Mauro Locatelli crivotz

🏠
Working from home
View GitHub Profile
@crivotz
crivotz / _search_form
Created February 9, 2015 08:57
Filter form with simple_form base on filterable by Justin Weiss ( http://goo.gl/xr10rK )
<%= simple_form_for :user, :method => 'get', :url => users_path, :html => {:class => ''} do |f| %>
<div class="form-group form-group-sm col-xs-12 col-sm-4 col-md-4 col-lg-3">
<%= f.input :username_like, input_html: { name: 'username_like', :value => params[:username_like] }, label: t('fields.user.username'), :required => false %>
<%= f.input :is_active_check, input_html: { name: 'is_active_check' }, label: t('fields.user.is_active'), as: :select, checked_value: true, unchecked_value: false, :required => false, :selected => params[:is_active_check], :include_blank => '' %>
<%= f.input :acl_id_ref_check, collection: Acl.all, input_html: { name: 'acl_id_ref_check' }, as: :select, label_method: :description, label: t('fields.user.acl_id'), value_method: :id, :selected => params[:acl_id_ref_check], :include_blank => '', :required => false %>
<%= f.input :locale, :as => :hidden, :input_html => {:name => 'locale', :value => params[:locale] } %>
<%= f.button :submit, t('search'), class: "btn-suc
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@crivotz
crivotz / carrier_wave
Created June 11, 2015 09:41
Check if image? and do resize
version :thumb, :if => :image? do
process :resize_to_fit => [50, 50]
end
protected
def image?(new_file)
new_file.content_type.include? 'image'
end
/* Panel */
#cookieChoiceInfo {
background-color: #6a7ed5; /* Panel background color */
border-top: 4px solid #c8b13c; /* Border top color and type */
color: #FFFFFF; /* Font color */
padding: 10px;
opacity: .8; /* Opacity */
}
/*More info link*/
@crivotz
crivotz / xorg.conf
Created August 3, 2015 10:43
Xorg.conf for dual monitor
Section "ServerLayout"
Identifier "aticonfig Layout"
Screen 0 "aticonfig-Screen[0]-0" 0 0
Screen "aticonfig-Screen[0]-1" RightOf "aticonfig-Screen[0]-0"
EndSection
Section "Module"
EndSection
Section "ServerFlags"
@crivotz
crivotz / .conkyrc
Last active August 29, 2015 14:26
Aretes Conky theme .conkyrc (two monitors)
#avoid flicker
double_buffer yes
#own window to run simultanious 2 or more conkys
own_window yes
own_window_transparent no
own_window_type panel
own_window_hints undecorate,sticky,skip_taskbar,skip_pager
#borders
@crivotz
crivotz / themes.cfg
Created August 3, 2015 10:47
Aretes Theme.cfg for fluxbox
style.name: Aretes
style.author: Mauro Locatelli
style.date: August 3, 2015
style.credits:
style.comment:
toolbar: flat
toolbar.pixmap: toolbar.xpm
toolbar.textColor: #c0c0c0
toolbar.justify: center
@crivotz
crivotz / .Xmodmap
Created August 3, 2015 14:44
Change Caps_lock into Control left
!Turn Caps Lock into another Control key
keycode 66 = Control_L
clear Lock
add Control = Control_L
@crivotz
crivotz / .remap_caps_lock.sh
Created August 3, 2015 14:45
Launcher for xmodmap
#!/bin/sh
xmodmap ~/.Xmodmap
@crivotz
crivotz / vim_installation.md
Last active August 4, 2023 12:53
Vim installation

Clean from standard vim

sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common

Vim dependency

sudo apt-get install liblua5.4-dev luajit2 libluajit2-5.1-2 python3.11-dev libperl-dev python3 libncurses5-dev

Clean and prepare folders