Skip to content

Instantly share code, notes, and snippets.

🎯
coding...

Gonzalo Moreno ronzalo

🎯
coding...
  • 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
briankung / docker-pry-rails.md
Last active Nov 7, 2019
Using pry-rails with Docker
View docker-pry-rails.md

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

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

@remarkablemark
remarkablemark / Dockerfile
Last active Nov 2, 2019
Install node and npm with nvm using Docker.
View Dockerfile
# 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 \
@airblade
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 Gem::Version.new(::AWS::VERSION) >= Gem::Version.new(2)
raise NotImplementedError, 'coded for aws-sdk v1'
end
@gonzalo-bulnes
gonzalo-bulnes / safe_merge.sh
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: https://gonzalo-bulnes.github.io/blog/gardening_with_git/context-from-scratch.html
View safe_merge.sh
# 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
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
tadast / ssl_puma.sh
Last active Nov 4, 2019 — forked from trcarden/gist:3295935
localhost SSL with puma
View ssl_puma.sh
# 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
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
t.timestamps
end
create_table :regions do |t|
t.string :short_name
@sunny
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
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 bot.md

Twitter autoresponder bot

By Daniel15 (dan.cx) 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 - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

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.