Skip to content

Instantly share code, notes, and snippets.

View alepore's full-sized avatar

Alessandro Lepore alepore

View GitHub Profile
{
:createTransactionModel=>{
:code=>"R646641903",
:date=>"2022-06-15",
:discount=>0.0,
:commit=>false,
:type=>"SalesOrder",
:lines=>[
{
:number=>"69-LI",
@alepore
alepore / select2-bootstrap4.scss
Created March 1, 2017 07:21
Select2 Bootstrap 4 scss theme
//
// Variables
// --------------------------------------------------
// Variables directly translating Bootstrap variables
// -------------------------
$s2bs-border-radius-base: $border-radius !default;
$s2bs-border-radius-large: $border-radius-lg !default;
$s2bs-border-radius-small: $border-radius-sm !default;
module Sablon
module Redcarpet
module Render
class ImprovedWordML < WordML
LIST_PATTERN = <<-XML.gsub("\n", "")
<w:p>
<w:pPr>
<w:pStyle w:val="%s" />
<w:numPr>
<w:ilvl w:val="%s"/>
@alepore
alepore / bundle
Created March 26, 2015 09:10
better bundler completion
#! bash
# bash completion for the `bundle` command.
#
# Copyright (c) 2011-2013 Daniel Luz <dev at mernen dot com>.
# Distributed under the MIT license.
# http://mernen.com/projects/completion-ruby
#
# To use, source this file on bash:
# . completion-bundle

Keybase proof

I hereby claim:

  • I am alepore on github.
  • I am alepore (https://keybase.io/alepore) on keybase.
  • I have a public key whose fingerprint is D952 7C7D 4D24 D20B ACCC CCE2 D711 43FB 126E 0509

To claim this, I am signing this object:

@alepore
alepore / capistrano3_puma.rb
Last active January 1, 2016 03:09
Capistrano 3 recipe for Puma. Put in lib/capistrano/tasks/puma.cap . Expects the use of bundle and a complete Puma config file in config/puma/<environment>.rb . RVM compatible (gem 'capistrano-rvm').
commands = %w(start stop restart phased-restart status stats halt)
namespace :deploy do
desc 'Puma web server Start'
task :start do
on roles(:app), in: :sequence, wait: 5 do
within current_path do
execute :bundle, "exec puma -C #{config_file}"
end
end
@alepore
alepore / gist:6850998
Created October 6, 2013 08:07
Gemfile.lock
GIT
remote: git://github.com/elia/activeadmin-mongoid.git
revision: bba338aa2225b393f6fe0018ddf16224a4c5c628
specs:
activeadmin-mongoid (0.2.0)
activeadmin (~> 0.6)
jquery-rails (>= 3.0.0)
jquery-ui-rails (>= 4.0.0)
mongoid (> 3.0, < 5.0)
sass-rails (>= 3.1.4, < 5.0)
@alepore
alepore / after_cd_ctags
Last active December 18, 2015 04:49
RVM hook for ctags and gemtags auto generation.put in ~/.rvm/hooks/, remember to chmod +x it
#!/usr/bin/env bash
function generate_tags {
(ctags -R -f .tags 2> /dev/null &)
}
function generate_gemtags {
(bundle show --paths | xargs ctags -R -f .gemtags 2> /dev/null &)
}
@alepore
alepore / gist:4640973
Created January 26, 2013 08:12
Obfuscated ruby
#date: 03/24/2005
#title: Pretty numbers
#author: Vincent Foley
#email: vfoley at gmail dot com
#comments: Usage: ruby entry.rb []. If character
#is specified, it must be a single character; don't forget to escape
#characters such as * or .. Non-digits in integer will be treated as
#0.
#code:
d=[30644250780,9003106878,
@alepore
alepore / gist:3780504
Created September 25, 2012 07:49
refinery + forem error
NoMethodError in Refinery/pages#home
Showing /Users/user/workspace-aptana/cms/app/views/refinery/_content_page.html.erb where line #1 raised:
undefined method `render_content_page' for #<#<Class:0x00000102c8fca0>:0x0000010133d6a8>
Extracted source (around line #1):
1: <%= render_content_page(@page, {
2: :hide_sections => local_assigns[:hide_sections],
3: :can_use_fallback => !local_assigns[:show_empty_sections] && !local_assigns[:remove_automatic_sections]