Skip to content

Instantly share code, notes, and snippets.

View pablojimeno's full-sized avatar
🔬
learning

Pablo Jimeno pablojimeno

🔬
learning
View GitHub Profile
@pablojimeno
pablojimeno / gibbon.rb
Created January 10, 2018 12:06 — forked from apeckham/gibbon.rb
Create and send a Mailchimp campaign with gibbon, using content sections from ActionView templates
gibbon = Gibbon::API.new
view = ActionView::Base.new('app/views/', {instance_variable_for_templates: 5324}, ActionController::Base.new)
campaign = gibbon.campaigns.create(
type: "regular",
options: {
list_id: 'xxxy',
from_email: 'you@example.com',
from_name: 'Your From',
subject: "the subject",
@pablojimeno
pablojimeno / docx_to_markdown.xslt
Created December 2, 2016 18:01 — forked from PLTGit/docx_to_markdown.xslt
Super Rudimentary DOCX -> Markdown XSL Template - not full featured, and very MSWord specific
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
>
<xsl:output method="text"/>
<xsl:template match="//w:p">
@pablojimeno
pablojimeno / ml-ruby.md
Created May 16, 2016 16:00 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

@pablojimeno
pablojimeno / irb3.rb
Created January 13, 2014 21:18 — forked from peterc/irb3.rb
#!/usr/bin/env ruby
# encoding: utf-8
# irb3 - Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple
# versions of Ruby at once (using RVM)
#
# By Peter Cooper, BSD licensed
#
# Main dependency is term-ansicolor for each impl:
# rvm exec gem install term-ansicolor
# This is a basic example how to create an import from csv data. This could
# be called in a rake task:
namespace :db do
namespace :import do
desc "Import customer of old shop from csv"
task :customer => :environment do
csv_file = 'db/customer_data.csv'
importer = Import::ImportCustomer.new(IO.read(csv_file))
importer.import
namespace :db do
desc "Download the a full dump of the production database into the development database"
task :pull do
config = YAML::load(File.open(File.join('config', 'database.yml')))
dump_database_remotely(config['production'], remote_file)
compress_backup_remotely(remote_file)
download_backup(remote_file(:compressed), local_file(:compressed))
@pablojimeno
pablojimeno / README.md
Created September 13, 2013 07:28 — forked from netmute/README.md

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

source "http://rubygems.org"
gem "cucumber"
gem "capybara"
gem "capybara-webkit", :platforms => [:ruby], :require => false, :git => "git://github.com/thoughtbot/capybara-webkit.git"
gem "capybara-mechanize", :git => "git://github.com/jeroenvandijk/capybara-mechanize.git"
gem "rspec"
gem "rake"
@pablojimeno
pablojimeno / clickable-element.html
Created October 17, 2015 13:56 — forked from scottmagdalein/clickable-element.html
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>
@pablojimeno
pablojimeno / template.rb
Created September 29, 2011 10:31 — forked from BinaryMuse/template.rb
My Rails application template - under development! See comments for info.
# ============================================================================
# Info class
# ============================================================================
class ApplicationInfo < Rails::Generators::AppGenerator
attr_reader :notices, :errors, :options, :data
def initialize
@notices = [] # Array of notices to display to the user at the end
@errors = [] # Array of errors to display to the user at the end
@options = [] # Array of options selected throughout the template