I hereby claim:
- I am giannafusaro on github.
- I am gianna (https://keybase.io/gianna) on keybase.
- I have a public key whose fingerprint is 4EAA D6C7 7856 D19B 7200 1E58 28F8 2FD0 D02D 874A
To claim this, I am signing this object:
#!/bin/bash | |
brew install ffmpeg \ | |
--with-chromaprint \ | |
--with-fdk-aac \ | |
--with-fontconfig \ | |
--with-freetype \ | |
--with-frei0r \ | |
--with-game-music-emu \ | |
--with-libass \ | |
--with-libbluray \ |
class PaperclipReprocessWorker | |
include Sidekiq::Worker | |
sidekiq_options retry: true | |
def perform(klass, group) | |
group.each do |id| | |
klass.constantize.attachment_definitions.keys.each do |attachment| | |
begin | |
klass.constantize.find(id).send(attachment).reprocess! |
namespace :paperclip do | |
desc "Reprocesses all attachments for given class" | |
# rake paperclip:reprocess[User,800,'where','some_sort_of_scope_or_filter IS true'] | |
task :reprocess, [:class, :batch_size, :where, :clause] => :environment do |t, args| | |
klass = args[:class].constantize | |
batch_size = args[:batch_size]&.to_i || 100 | |
records = klass.all | |
records = klass.send(args[:where], args[:clause]) if args[:where] && args[:clause] | |
records.find_in_batches(batch_size: batch_size) do |group| |
I hereby claim:
To claim this, I am signing this object:
require 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => 'benchmark.db' | |
) | |
# ActiveRecord::Migration.class_eval do | |
# create_table :users do |t| | |
# t.string :email | |
# t.string :name |
source "https://rubygems.org" | |
gem "rails", "4.2.5.2" | |
gem "sqlite3" |
require 'capybara' | |
require 'capybara/poltergeist' | |
class Scraper | |
include Capybara::DSL | |
attr_accessor :text, :document, :metas, :title, :session, :globals, :globals_script | |
# settings for poltergeist driver | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new app, | |
js_errors: false, |
# # # # # # # # # # # # # # # # # # # | |
# HeapNode | |
# # # # # # # # # # # # # # # # # # # | |
@HeapNode = class HeapNode | |
constructor: (trie_node, heap_index) -> | |
@trie_node = trie_node | |
@trie_node.heap_index = heap_index | |
@frequency = trie_node.data['frequency'] | |
@word = trie_node.data['word'] |
############################################################################# | |
# title: erlang_program_in_ruby.rb | |
# desc: translation of erlang_program.prompt.erl to ruby | |
# author: gianna fusaro | |
# date: october 20, 2015 | |
############################################################################# | |
# WeightItem: item with label, weight, and unit | |
class WeightItem |
<!DOCTYPE html> | |
<html> | |
<meta charset="utf-8"> | |
<title>San Francisco Street Sweep Routes</title> | |
<head> | |
<link rel="stylesheet" href="sf-sweep.css" /> | |
<script src="javascript/d3.v3.min.js"></script> | |
<script src="javascript/topojson.js"></script> | |
<script src="javascript/queue.v1.min.js"></script> |