Skip to content

Instantly share code, notes, and snippets.

@basicxman
basicxman / update-all.rb
Created May 25, 2011 13:42
Update Vim plugins via Git repositories specified in config.json. For use with Pathogen
#!/usr/bin/env ruby
# Update Vim plugins via Git repositories specificed in config.json.
# For use with Pathogen.
require 'json/pure'
pipe = "> /dev/null 2>&1" if ARGV[0].nil?
cur_dir = File.dirname(__FILE__) + "/"
repos = JSON.parse(File.read(cur_dir + "config.json"))
@basicxman
basicxman / config.json
Created May 25, 2011 13:42
For Vim plugin updating.
[
{
"repo-url": "git://github.com/altercation/vim-colors-solarized.git",
"folder": "vim-colors-solarized"
},
{
"repo-url": "git://github.com/rson/vim-conque.git",
"folder": "vim-conque"
},
{
@basicxman
basicxman / clean.rb
Created May 25, 2011 14:53
Deletes any Vim plugins that aren't in config.json.
#!/usr/bin/env ruby
# Deletes any Vim plugins that aren't in config.json.
# For use with Pathogen.
require 'json/pure'
cur_dir = File.dirname(__FILE__) + "/"
repos = JSON.parse(File.read(cur_dir + "config.json"))
folders = repos.map { |r| r["folder"] }
" Vim configuration - Andrew Horsman [basicxman]
" Operating system dependent options
if has("win32") || has("unix")
source $VIMRUNTIME/mswin.vim
behave mswin
endif
if has("win32")
:cd C:\Users\Andrew
Andrew-Horsmans-iMac:ExtendedMind basicxman$ ruby run.rb Robotics
http://wikipedia.org/wiki/Robotics
http://wikipedia.org/wiki/Isaac_Asimov
http://wikipedia.org/wiki/Biochemistry
http://wikipedia.org/wiki/Protein
http://wikipedia.org/wiki/Chemical_compound
http://wikipedia.org/wiki/Ionic_bond
http://wikipedia.org/wiki/Polar_covalent_bond
http://wikipedia.org/wiki/Electron
http://wikipedia.org/wiki/Reduced_Planck_constant
Andrew-Horsmans-iMac:ExtendedMind basicxman$ ruby run.rb Robotics
http://wikipedia.org/wiki/Robotics
http://wikipedia.org/wiki/Isaac_Asimov
http://wikipedia.org/wiki/Biochemistry
http://wikipedia.org/wiki/Protein
http://wikipedia.org/wiki/Chemical_compound
http://wikipedia.org/wiki/Ionic_bond
http://wikipedia.org/wiki/Polar_covalent_bond
http://wikipedia.org/wiki/Electron
http://wikipedia.org/wiki/Reduced_Planck_constant
@basicxman
basicxman / run.rb
Created May 27, 2011 03:51
Extended Mind, Wikipedia Philosophy Checker inspired by http://xkcd.com/903 alt text
#!/usr/bin/env ruby
# Extended Mind
# Wikipedia checker, the concept is that for any Wikipedia article you can
# eventually get to the article on Philosophy if you click the first link
# on the article.
# http://xkcd.com/903 (see alt text)
require 'open-uri'
require 'nokogiri'
Out of 3034 trails generated:
2422 out of 3034 pages reached Philosophy without recursing.
609 out of 3034 pages recursed before reaching Philosophy.
79.83% of pages reached Philosophy.
Zekoi survived the longest with 32 clicks before reaching Philosophy.
Cedar_bark_textile got to Philosophy the quickest with 4 clicks.
14.81 is the average number of clicks to reach Philosophy.
63 pages when clicked on will doom the trail to recursion.
Positivism caused recursion 329 times.
---
http://wikipedia.org/wiki/Mount_Campbell: /wiki/Prince_Olav_Mountains
http://wikipedia.org/wiki/Prince_Olav_Mountains: /wiki/Mountain_range
http://wikipedia.org/wiki/Mountain_range: /wiki/Mountain
http://wikipedia.org/wiki/Mountain: /wiki/Landform
http://wikipedia.org/wiki/Landform: /wiki/Earth_sciences
http://wikipedia.org/wiki/Earth_sciences: /wiki/Science
http://wikipedia.org/wiki/Science: /wiki/Mathematics
http://wikipedia.org/wiki/Mathematics: /wiki/Quantity
http://wikipedia.org/wiki/Quantity: /wiki/Property_(philosophy)
#!/usr/bin/env ruby
# Extended Mind
# Now I want to graph the data, luckily we can just use the YAML cache as a data source.
require 'yaml'
require 'ap'
class Graph