Skip to content

Instantly share code, notes, and snippets.

View spara's full-sized avatar

Sophia Parafina spara

View GitHub Profile
{
"place" : {
"properties" : {
"geometry": {
"properties": {
"coordinates": {
"type": "geo_point"
}
}
}
@spara
spara / gist:1117013
Created July 31, 2011 17:48
Elasticsearch, register multiple geo_point types to single index
# first geo_point mapping: map1.json
"place" : {
"properties" : {
"geometry": {
"properties": {
"coordinates": {
"type": "geo_point"
}
[
{
"category":"Administrative",
"category_id":"10100100",
"type":"Region",
"subcategory":"Consolidated City"
},
{
"category":"Administrative",
"category_id":"10100101",
@spara
spara / mysql2sqlite.sh
Created August 22, 2011 21:16 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@spara
spara / 2012_Conferences.txt
Created November 28, 2011 18:42
2012 Conferences
possible Shmoocon January 27-29 - no tickets
flight/hotel booked Strata February 28-March 1st - done
longshot SXSW Interactive March 9-13 - nope
flight/hotel booked WhereConf April 2-4 - presentation accepted
AR Standards Meeting March 19-20, Austing - purchased
flight/hotel booked FOSS4G North America April 10-12 - presentation accepte/moderating panel
definite ARE2012 May 8-9 - Ignite talk accepted
definite Google I/O June 27-29
flight/hotel booked HOPE Number Nine July 13-15
longshot FOSS4G Beijing??? August/Sept
@spara
spara / create_geo_header_staging_table.sql
Created January 10, 2012 20:27
Create staging table for geo_header data
CREATE TABLE geo_header_staging(data text);
copy geo_header_staging FROM '/path/to/dcgeo2010.sf1' DELIMITER AS '|';
@spara
spara / cut_paste_columns
Created January 11, 2012 02:28
cut and paste two columns from different files
paste <(awk '{print $1;}' gtemp) <(cut -f1 gfields)
@spara
spara / add_list_of_numbers.sh
Created January 18, 2012 01:41
add a list of numbers in a file
awk '{total+=$0}END{print total}' file
@spara
spara / add_list_of_numbers.sh
Created January 18, 2012 01:49
add a list of numbers in a file
awk '{total+=$0}END{print total}' file
@spara
spara / sed_on_osc
Created January 31, 2012 22:00
sed in-place edit on OSX
sed -i '' -e's/apples/oranges/' file.txt