Skip to content

Instantly share code, notes, and snippets.


Gonzalo Moreno ronzalo

  • Desafio Latam
  • Santiago, Chile
Block or report user

Report or block ronzalo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
briankung /
Last active Nov 7, 2019
Using pry-rails with Docker

First, add pry-rails to your Gemfile:

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

remarkablemark / Dockerfile
Last active Nov 2, 2019
Install node and npm with nvm using Docker.
View Dockerfile
# set the base image to 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 \
airblade / copy_attachments.rb
Created Nov 10, 2015
Copies S3-stored Paperclip attachments from one AR model to another
View copy_attachments.rb
# lib/paperclip/copy_attachments.rb
# Copies S3-stored Paperclip attachments from one AR model to another.
# This module should be mixed into the target AR model.
if >=
raise NotImplementedError, 'coded for aws-sdk v1'
gonzalo-bulnes /
Last active May 4, 2018
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:
# 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
ecleel / diff.rb
Created Jun 5, 2014
SequenceMatcher class in ruby. credit to testunit folks.
View diff.rb
# 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.
tadast /
Last active Nov 4, 2019 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
sinfante / migration.rb
Created Dec 4, 2013
Ruby on Rails seed for regions and counties ("comunas") of Chile with the required migrations.
View migration.rb
class Migration < ActiveRecord::Migration
def change
create_table :countries do |t|
t.string :name
create_table :regions do |t|
t.string :short_name
sunny / paperclip_has_destroyable_file.rb
Created Oct 25, 2012
Rails Initializer to add destroyable attachments with Paperclip
View paperclip_has_destroyable_file.rb
# 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
dinnouti / _form.html.erb
Created Oct 15, 2012
Typeahead / Autocomplete with Twitter Bootstrap, Rails, simple_form
View _form.html.erb
<%= f.input :nome, :collection => get_schools_name, :include_blank => false, :input_html => {:rel => 'autocomplete', :data_default => @school.nome} %>
View 1_Twitter autoresponder

Twitter autoresponder bot

By Daniel15 ( This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post -

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

You can’t perform that action at this time.