Skip to content

Instantly share code, notes, and snippets.

View sagzy's full-sized avatar
🚲

Sag sagzy

🚲
View GitHub Profile
@sagzy
sagzy / factory_girl_debugging.rb
Created November 16, 2018 16:15 — forked from dolzenko/factory_girl_debugging.rb
Commands to debug Factory Girl from console
require 'factory_girl_rails'
require 'rspec'
require 'rspec-rails'
require 'rspec/mocks/standalone' # => if factories need stubs (for remote services for example)
include FactoryGirl::Syntax::Methods # make FG methods available at top level, so you can do `> create :user`
def reload_factories!
FactoryGirl.instance_variable_set(:@factories, nil) # => clear loaded factories/sequences
# FactoryGirl.instance_variable_set(:@sequences, nil)
@sagzy
sagzy / linkedin_skills.rb
Created April 16, 2016 10:23
Scrap skills from a Linkedin profile
require 'rubygems'
require 'nokogiri'
require 'rest-client'
# Get skills listed in a Linkedin profile
# HTML structure specific, to be maintained. Last check on the 16/04/2016
def get_skills_for_a_profile(profile)
skills = []
profile.css('li.skill').each do |attr|
skills << "#{attr.text}"
#!/bin/bash
# This script does the following:
# 1/ capture and download the latest backup
# 2/ load it to your local database
# Just replace any uppercase string with your own data
#
# CAPTURE