Skip to content

Instantly share code, notes, and snippets.

View Gubio's full-sized avatar
🌴
On vacation

Paulo Gúbio Gubio

🌴
On vacation
View GitHub Profile
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active November 14, 2024 18:04
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
require 'json'
require 'pp'
Query = Struct.new(:attributes, :conditions)
Condition = Struct.new(:query, :operator, :arg)
class Parser
attr_reader :query
module MassInsertUniq
extend ActiveSupport::Concern
included do
include PluckHash
end
module ClassMethods
def mass_insert_uniq(attributes, insert_scope: -> { self })
return if attributes.blank?
@marcoonroad
marcoonroad / DocLinks.md
Last active November 5, 2022 18:28
Links sobre documentações de algumas linguagens...
@yustam
yustam / redis.config
Last active September 12, 2024 07:33
Install Redis on Elastic Beanstalk
packages:
yum:
gcc-c++: []
make: []
sources:
/home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz
commands:
redis_build:
command: make
cwd: /home/ec2-user/redis-2.8.4
@eliotk
eliotk / gist:7744806
Last active October 6, 2020 13:00
A ruby script to parse My Tracks kml files and aggregate the summary data into one CSV file to chart changes in time series (or otherwise)
require 'nokogiri'
require 'csv'
kml_path = '/path/to/Google Drive/My Tracks/'
def kml_file_paths path
Dir.glob(path + "*.kml")
end
csv = CSV.open('mytracks.csv', "wb")