| Key/Command | Description |
|---|---|
| Tab | Auto-complete files and folder names |
| Ctrl + A | Go to the beginning of the line you are currently typing on |
| Ctrl + E | Go to the end of the line you are currently typing on |
| Ctrl + U | Clear the line before the cursor |
| Ctrl + K | Clear the line after the cursor |
| Ctrl + W | Delete the word before the cursor |
| Ctrl + T | Swap the last two characters before the cursor |
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 polygon = ee.Geometry.Polygon([[ | |
| [-119.33364769821117, 46.05123532178373], | |
| [-119.3233620672313, 45.869732769408905], | |
| [-119.04111088542663, 45.873079023065166], | |
| [-119.0396574679861, 46.045448840018565] | |
| ]]); | |
| var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA_FMASK"); | |
| // | |
| // Masking Clouds with Fmask |
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
| # Create directories | |
| mkdir c:\mongo\db | |
| mkdir c:\mongo\config | |
| mkdir c:\mongo\log | |
| # Create a configuration file | |
| # in c:\mongo\config\ as | |
| # 'mongod.cfg' and paste: | |
| #|==================================| | |
| #| logpath=C:\mongo\log\mongodb.log | |
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
| brew install python3 | |
| pip install argparse (optional) | |
| pip install virtualenv | |
| mkdir <your_fancy_project> | |
| cd <your_fancy_project> | |
| mkdir <your_fancy_repo> | |
| virtualenv -p /usr/local/bin/python3 env | |
| source env/bin/activate | |
| source activate | |
| *source deactivate |
To create a database, you need to first ensure that the database's role exists first. Role and User are synonymous
in PostgreSQL. Once you create the ROLE, you can create the Database and set the OWNER as the ROLE.
Create Role
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
| create schema shard_1; | |
| create sequence shard_1.global_id_sequence; | |
| CREATE OR REPLACE FUNCTION shard_1.id_generator(OUT result bigint) AS $$ | |
| DECLARE | |
| our_epoch bigint := 1314220021721; | |
| seq_id bigint; | |
| now_millis bigint; | |
| -- the id of this DB shard, must be set for each | |
| -- schema shard you have - you could pass this as a parameter too |
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
| DROP TABLE IF EXISTS test_table; | |
| CREATE TABLE test_table( | |
| id bigserial NOT NULL, | |
| latitude double precision, | |
| longitude double precision, | |
| geom geometry, | |
| geog geography, | |
| updated_ts double precision, | |
| CONSTRAINT test_table_unique_key UNIQUE (id) | |
| ); |
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 select | |
| import datetime | |
| import psycopg2 | |
| import psycopg2.extensions | |
| conn = psycopg2.connect(database="postgres", user="vagrant") | |
| #conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
| curs = conn.cursor() |
Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions