This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILTER_FILES_REGEX = [ | |
/Thumbs\.db/, # omit OSX thumbs | |
/\~\$/, # omit temp office files | |
/\/\z/, # omit directories | |
] | |
def download_file_edition_and_add_to_zip(file_edition, dst_zip) | |
open(file_edition.download_url) do |tf| | |
if file_edition.download_file_name.ends_with?('.zip') | |
Rails.logger.debug "Unpacking file edition: #{file_edition.download_file_name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILTER_FILES_REGEX = [ | |
/Thumbs\.db/, # omit OSX thumbs | |
/\~\$/, # omit temp office files | |
/\/\z/, # omit directories | |
] | |
def filtered_paths(zip) | |
zip.paths.delete_if do |path| | |
FILTER_FILES_REGEX.any?{|regex| regex === path} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILTER_FILES_REGEX = [ | |
/Thumbs\.db/, # omit OSX thumbs | |
/\~\$/, # omit temp office files | |
/\/\z/, # omit directories | |
] | |
def filtered_paths(zip) | |
zip.paths.delete_if do |path| | |
FILTER_FILES_REGEX.any?{|regex| regex === path} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is a sample webhook server that listens for webhook | |
* callbacks coming from Trello, and updates any cards that are | |
* added or modified so everyone knows they are "PRIORITY" | |
* | |
* To get started | |
* * Add your key and token below | |
* * Install dependencies via `npm install express request body-parser` | |
* * Run `node app.js` on a publicly visible IP | |
* * Register your webhook and point to http://<ip or domain>:3123/priority |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.poi.ss.usermodel.* | |
import org.apache.poi.hssf.usermodel.* | |
import org.apache.poi.xssf.usermodel.* | |
import org.apache.poi.ss.util.* | |
import org.apache.poi.ss.usermodel.* | |
import java.io.* | |
class GroovyExcelParser { | |
//http://poi.apache.org/spreadsheet/quick-guide.html#Iterator |