This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'etc' | |
require 'fileutils' | |
require 'peach' | |
require 'vagrant' | |
DUMP_DIR = 'dumps/todo' | |
GIS_ARCHIVE = 'data/geoserver1-20110908-1547.tar.gz' | |
ROLE_FILE = 'roles' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pg_restore(dbname) | |
filename = "#{DUMP_DIR}/#{dbname}.dump" | |
vm_dump_file = "/vagrant/#{DUMP_DIR}/#{dbname}.dump" | |
log_file = "/vagrant/#{DUMP_DIR}/#{dbname}.log" | |
puts "Restoring/Upgrading #{filename} (#{vm_dump_file}) => #{dbname}" | |
start = Time.now | |
env = Vagrant::Environment.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_subm(name, &block) | |
puts "Updating submodules for '#{name}'...." | |
if block.nil? | |
sh %{cd #{name} ; #{GIT_SM_UP}} | |
else | |
sh %{cd #{name} ; #{GIT_SM_UP}} do |o, r| | |
block.call(o, r) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_item_page.form_with(:method => 'POST') do |item_form| | |
item_form['public'] = 1 | |
item_form['Elements[50][0][text]'] = line[:address] | |
# This should really be KML, but it will recognize WKT too. | |
item_form['Elements[38][0][geo]'] = line[:point] | |
item_form['Elements[38][0][zoom]'] = 10 | |
item_form['Elements[38][0][mapon]'] = 1 | |
item_form['Elements[38][0][center_lon]'] = line[:lon] | |
item_form['Elements[38][0][center_lat]'] = line[:lat] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update omeka_element_texts | |
set text=concat('POINT(', insert(text, instr(text, '/'), 0, ')')) | |
where element_id=38 and text not like 'POINT(%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <leader><leader> <c-^> | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" OPEN FILES IN DIRECTORY OF CURRENT FILE | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
cnoremap %% <C-R>=expand('%:h').'/'<cr> | |
map <leader>e :edit %% | |
map <leader>v :view %% | |
" Apparently, he no longer uses the trick where the window heights jump around, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./sub_exit.bash | |
ec1=$? | |
./sub_exit.bash | |
ec2=$? | |
[[ "$ec1" -eq "0" && "$ec2" -eq "0" ]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _this = this; | |
var Map = OpenLayers.Map; | |
if (jQuery.browser.webkit) { | |
Map = OpenLayers.Class(OpenLayers.Map, { | |
updateSize: function() { | |
OpenLayers.Map.prototype.updateSize.apply(this, arguments); | |
var mapHeight = _this.element.height(), | |
mapWidth = _this.element.width(); | |
_this.element.find('svg').each(function (i, el) { | |
jQuery(el).height(mapHeight).width(mapWidth); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /System/Library/Frameworks/Python.frameworks/Versions | |
sudo mv Current Current26 | |
sudo ln -s /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7 Current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import sys | |
def fix_pre(match): | |
buffer = ['\n[sourcecode'] | |
if match.group(1) and match.group(2): | |
buffer.append('{0}"{1}"'.format(match.group(1), match.group(2))) |