Skip to content

Instantly share code, notes, and snippets.

View ronzalo's full-sized avatar
🎯
coding...

Gonzalo Moreno ronzalo

🎯
coding...
View GitHub Profile
@ronzalo
ronzalo / paperclip_has_destroyable_file.rb
Created October 6, 2016 14:47 — forked from sunny/paperclip_has_destroyable_file.rb
Rails Initializer to add destroyable attachments with Paperclip
# encoding: UTF-8
class ActiveRecord::Base
# Class method to add destroyable paperclip attachments.
#
# Example:
# has_attached_file :image
# has_destroyable_file :image
# attr_accessible :image_delete
#
@ronzalo
ronzalo / safe_merge.sh
Last active May 16, 2018 21:28 — forked from gonzalo-bulnes/safe_merge.sh
Some merging rules to make collaboration easier through repository order. Think of rebasing as updating the context in which you write your feature, see also: https://gonzalo-bulnes.github.io/blog/gardening_with_git/context-from-scratch.html
# safe merge
#
# merge the branch XXXXXXXX-add-example-feature into master
# make sure the feature is properly tested and
# doesn't break anything in its original context
git checkout XXXXXXXX-add-example-feature
rake # the test suite MUST NOT raise any error
# make sure your local copy of master is up-to-date
@ronzalo
ronzalo / Dockerfile
Created July 13, 2018 19:45 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@ronzalo
ronzalo / diff.rb
Created September 2, 2019 20:11 — forked from ecleel/diff.rb
SequenceMatcher class in ruby. credit to testunit folks.
# port of Python's difflib.
#
# Copyright (c) 2001-2008 Python Software Foundation; All Rights Reserved
# Copyright (c) 2008-2011 Kouhei Sutou; All Rights Reserved
#
# It is free software, and is distributed under the Ruby
# license and/or the PSF license. See the COPYING file and
# PSFL file.
# Carry this code from testunit/testunit project.