Skip to content

Instantly share code, notes, and snippets.

View ricardodovalle's full-sized avatar

Ricardo do Valle ricardodovalle

  • São Paulo, Brazil
View GitHub Profile
@ricardodovalle
ricardodovalle / DefaultKeyBinding.dict
Created February 24, 2022 02:06
mac: binding home/end keys
source:
https://medium.com/@elhayefrat/how-to-fix-the-home-and-end-buttons-for-an-external-keyboard-in-mac-4da773a0d3a2
https://www.maketecheasier.com/fix-home-end-button-for-external-keyboard-mac/
sudo bash
mkdir -p ~/Library/KeyBindings ; cd ~/Library/KeyBindings
vim DefaultKeyBinding.dict
{
@ricardodovalle
ricardodovalle / cards.js.coffee
Last active November 15, 2018 01:22
Rails and jQuery Datatables i18n
jQuery ->
tableContainer = $('#cards_datatable')
tableContainer.dataTable
sDom: "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
sPaginationType: "bootstrap"
bProcessing: true
bServerSide: true
bAutoWidth: false
bStateSave: true
sWrapper: "dataTables_wrapper form-inline"
@ricardodovalle
ricardodovalle / 1 setup vps
Created September 26, 2017 00:32 — forked from alekpopovic/1 setup vps
Deploy Rails 5.1.1 to VPS(Ubuntu 16.04.2 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 9.6, RVM, Certbot
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev \
libpcre3-dev unzip
// Node.js v7
root# curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
@ricardodovalle
ricardodovalle / QT - Monokai Color Scheme - monokai.xml
Created July 5, 2013 03:44
Color scheme for QT Creator based on Sublime Text 2 default color scheme. Tested on QT Creator v2.7.2.
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="Monokai">
<style name="AddedLine" foreground="#3875d7"/>
<style name="RemovedLine" foreground="#ff0000"/>
<style name="Comment" foreground="#808080"/>
<style name="CurrentLine" background="#3e3d32"/>
<style name="CurrentLineNumber" foreground="#a0a19c" background="#3e3d32"/>
<style name="DiffFile" foreground="#a6e22e"/>
<style name="DiffLocation" foreground="#0000ff"/>
<style name="DisabledCode"/>
.bs-header
.container
= render_breadcrumbs :builder => ::BootstrapBreadcrumbsBuilder
#include <QApplication>
#include <QDebug>
void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
QByteArray localMsg = msg.toUtf8();
switch (type) {
case QtDebugMsg:
fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
break;
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# email :string(255) default(""), not null
# encrypted_password :string(255) default("")
# reset_password_token :string(255)
# reset_password_sent_at :datetime
# remember_created_at :datetime
class VehiclesController < ApplicationController
def index
@vehicles = current_tenant.vehicles
respond_to do |format|
format.html
format.json { render json: VehiclesDatatable.new(view_context) }
end
end
def show
source 'https://rubygems.org'
ruby "2.1.0", engine: 'rbx', engine_version: '2.1.1'
gem 'rails', '4.0.1'
# Essential gems
# ------------------------------------------------------------------------------
gem 'capistrano'
gem 'coffee-rails', '~> 4.0.0'
gem 'compass-rails', '~> 2.0.alpha.0'
gem 'figaro'
Unable to load Sass. Please install it with one of the following commands:
gem install sass --pre
An exception occurred running bin/rails:
no such file to load -- enumerator (LoadError)
Backtrace:
Rubinius::CodeLoader#load_error at kernel/common/code_loader.rb:439
Rubinius::CodeLoader#resolve_require_path at kernel/common/code_loader.rb:423