Skip to content

Instantly share code, notes, and snippets.

View alanmaciel's full-sized avatar
Work and play, same thing, differing conditions. ~Mark Twain

Alan Maciel alanmaciel

Work and play, same thing, differing conditions. ~Mark Twain
View GitHub Profile
@jkotchoff
jkotchoff / emailed_zip_file_extractor.rb
Created November 29, 2016 00:23
Rails example of how to connect to the Gmail API using Ruby and download a Zip File attachment and then unzip contents from the zip archive
class EmailedZipFileExtractor
# This class downloads an email from gmail and extracts a file out of a .zip attachment
require 'google/apis/gmail_v1'
require 'googleauth'
require 'zip'
# These credentials come from creating an OAuth Web Application client ID
# in the Google developer console
#
@willurd
willurd / web-servers.md
Last active May 10, 2024 05:14
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@SamSamskies
SamSamskies / rails_jquery_ajax.md
Last active October 5, 2017 17:51
Rails: jQuery & AJAX Tutorial

jQuery and jQuery-ujs

When using Rails 3.0 and later we already get jquery-rails for free. Look in the gemfile and you'll see:

gem "jquery-rails"

You can view the full documentation here: source: https://github.com/indirect/jquery-rails

If you take a look in APP_DIR/app/assets/javascripts/application.js, you'll notice the following lines of code: