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
import arcpy | |
# Parameter 0, whatever the name, should have type "Feature Layer". | |
obj = arcpy.GetParameter(0) | |
# This prints out all of the properties and methods on the object that gets | |
# passed in as Parameter(0). I haven't looked closely, but we should be able | |
# to pass this directly to | |
arcpy.AddMessage('obj = %r' % (repr(dir(obj)),)) |
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
from contextlib import closing | |
def db_exists(cxn, db_name): | |
"""\ | |
This takes a connection to a Postgres object and db name and tests whether it | |
exists or not. | |
""" | |
with closing(cxn.cursor()) as c: | |
c.execute('SELECT COUNT(*) FROM pg_database WHERE datname=%s;', [db_name]) | |
(count,) = c.fetchone() |
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
# http://jashkenas.github.com/coffee-script/ | |
# https://developer.mozilla.org/en/JavaScript/Reference/ | |
# http://docs.jquery.com/Main_Page | |
# http://mbostock.github.com/d3/ | |
# 1. | |
# | |
# Alert! | |
alert('Danger, Will Robinson!') | |
# 2. |
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
desc = arcpy.Describe('poly_landmarks') | |
ext = desc.extent | |
ext.upperRight.x, ext.upperRight.y | |
# (-73.907820000000001, 40.882078) | |
ext.lowerRight.x, ext.lowerRight.y | |
# (-73.907820000000001, 40.679648) | |
ext.upperLeft.x, ext.upperLeft.y | |
# (-74.047184999999999, 40.882078) | |
ext.lowerLeft.x, ext.lowerLeft.y | |
# (-74.047184999999999, 40.679648) |
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
" Run PHP Unit tests. | |
nmap \Tu :w<CR>:call Send_to_Tmux("rake php:unit\n")<CR> | |
" Run Cucumber, vanilla. | |
nmap \Tc :w<CR>:call Send_to_Tmux("rake cucumber:default\n")<CR> | |
" Re-run Cucumber. | |
nmap \Tr :w<CR>:call Send_to_Tmux("rake cucumber:rerun\n")<CR> |
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/sh | |
# pandoc -f markdown+lhs -t html5 --smart --css https://raw.github.com/richleland/pygments-css/master/default.css s5topdf.lhs | |
# pandoc -f markdown+lhs -t html5 --smart --css s5topdf.css s5topdf.lhs | |
pandoc -f markdown+lhs -t html5 --smart s5topdf.lhs |
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
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>' |
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
protected function _addFacetMappings() | |
{ | |
$sql = <<<SQL | |
INSERT INTO `{$this->_db->prefix}solr_search_facets` | |
(element_id, name, element_set_id, is_facet, is_displayed, is_sortable) | |
VALUES (?, ?, ?, ?, ?, ?); | |
SQL; | |
$stmt = $this->_db->prepare($sql); | |
// These get inserted fine. |
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
[Exhibits] | |
id-column=eid | |
result-type=Exhibits | |
table={$prefix}_exhibits | |
flag=public | |
tagged=yes | |
[Exhibits.title] | |
[Exhibits.description] |
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
user=> (defn test-m [stemmer] [stemmer (m stemmer) (m2 stemmer)]) | |
#'user/test-m | |
user=> (-> (make-stemmer "ba") test-m) | |
[{:word [\b \a], :index 1} 0 0] | |
user=> (-> (make-stemmer "bava") test-m) | |
[{:word [\b \a \v \a], :index 3} 1 0] | |
user=> (-> (make-stemmer "baba") test-m) | |
[{:word [\b \a \b \a], :index 3} 1 0] | |
user=> (-> (make-stemmer "bababa") test-m) |