This file contains 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 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 wof | |
SET body = substring(body, '(?<=geometry": ).*$'); |
This file contains 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
### =delete overlapping buffers= ### | |
options("scipen"=100) | |
require(varhandle) | |
require(data.table) | |
require(tidyr) | |
require(tidyverse) | |
require(dplyr) | |
require(DBI) |
This file contains 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(raster) | |
require(sf) | |
require(dplyr) | |
require(data.table) | |
shiftReduceRaster = function (x, y) { | |
r <- raster::shift(r, x*xres(r), y*yres(r)) | |
# get cell numbers | |
cells <- cellFromXY(r, pts) | |
# pick one point per cell |
This file contains 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 | |
# create new user | |
adduser -m --disabled-password --gecos "" bluehat | |
usermod -aG sudo bluehat | |
#usermod -aG wheel bluehat | |
echo "bluehat ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
su bluehat | |
mkdir ~/.ssh | |
touch ~/.ssh/authorized_keys | |
#generate your RSA keys: ssh-keygen -t rsa -b 4096 -f cinsects |
This file contains 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
function fish_greeting | |
cat /proc/loadavg | cut -d' ' -f 2 | |
shuf -n 4 ~/mdrive/notes/(ls -p ~/mdrive/notes/ |grep -v / | shuf -n 1) | cowsay -W 52 -f tux | |
end |
This file contains 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
function sponge | |
/usr/bin/mkdir -p (dirname "$argv") | |
/usr/bin/sponge "$argv" | |
end | |
function tee | |
/usr/bin/mkdir -p (dirname "$argv") | |
/usr/bin/tee "$argv" | |
end |
This file contains 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 Html | |
import Html.Attributes as Attributes | |
--Tags | |
Html.a [ Attributes.href "http://www-db.stanford.edu/~evtimov/midas/demos.html", Attributes.target "_blank" ] [ text "Open in a new window!" ] | |
<a href="http://www-db.stanford.edu/~evtimov/midas/demos.html" target="_blank">Hello World!</a> | |
This file contains 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
largestDivisible : Maybe Int | |
largestDivisible divideBy maxInt = | |
let | |
p x = x % divideBy == 0 | |
in | |
List.head (List.filter p List.reverse (List.range 0 maxInt)) |
This file contains 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
// function | |
(() => 0)() | |
((room, board) => room + board)(800, 150) | |
// function/block | |
(() => {})() | |
((room, board) => {return room + board})(800, 150) |
OlderNewer