Skip to content

Instantly share code, notes, and snippets.

# Distributed under MIT License - See LICENSE
require 'family_tree_api/client'
# For session handling, if you have an active session,
# go ahead and insert it in here. Otherwise, set session = nil and
# it will use the ft.authenticate to authenticate you.
#session='USYS2AADBB47B3A6043209CBE16725938464.ptap009-035'
client = FamilyTreeApi::Client.new 'http://www.dev.usys.org', 'KEY'
export LSCOLORS=cxfxcxdxbxegedabagacad
alias ls="ls -G -F"
alias ll="ls -l"
alias la="ls -a"
[user]
name = Jimmy Zimmerman
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
[github]
user = jimmyz
token = [token]
@jimmyz
jimmyz / gist:74169
Created March 5, 2009 03:34
Mock up of what the API may look like
require 'fs-communicator'
require 'fs-identity-v1'
require 'fs-familytree-v1'
require 'fs-reservation-v1'
require 'fs-recordsearch-v1'
com = FsCommunicator.new :domain => 'https://api.familysearch.org', 'WCXY-BBPN-0TU53-X', "Application/0.1"
com.identity_v1.login 'username','password'
response = com.familytree_v1.person 'KWQS', :params => 'values'
response = com.familytree_v2.person ['KWQS','9652'], :hash => 'option', :other => 'option'
require 'rubygems'
require 'mechanize'
a = WWW::Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
def find_page_with_verses(agent, page)
if page.search("div.verse").size > 0
return page
Here's how to do a cp without requesting those stinkin' ._ (dot underscore) files (like if you are copying them to WebDAV or another network mounted drive).
cp -X [file] [destination]
This took me forever to find.
namespace :doc do
namespace :diagram do
task :models do
sh "railroad -i -l -a -m -M | dot -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' > doc/models.svg"
end
task :raw_models do
sh "railroad -i -l -a -m -M > doc/models.dot"
end
# Command for listing installed packages with Debian or Ubuntu
dpkg --get-selections
FS = Org::Familysearch::Ws::Familytree::V2::Schema
child = FS::Person.new
child.add_name "Jonathan /Hanson/"
child.add_gender "Male"
child.add_birth :date => "1850"
wife = FS::Person.new
wife.add_name "Rebecca /Wilson/"
wife.add_gender "Female"
@jimmyz
jimmyz / gist:1162900
Created August 22, 2011 16:58
sorting
@relationships.sort! do |p1,p2|
p1_birth = p1.birth.value.date.astro.earliest.to_i
p2_birth = p1.birth.value.date.astro.earliest.to_i
p1_birth <=> p2_birth
end