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
CREATE TABLE city | |
(name varchar (35), | |
country varchar (35), | |
pop real, | |
capital boolean, | |
shape char(15), | |
primary key (name)) | |
; |
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
# postgres / docker | |
# first install docker on your mac, and start it. you should see the whale widget in task bar | |
# pull the docker postgres image (for more info see, https://hub.docker.com/_/postgres/ ) | |
docker pull postgres | |
# run your new sql container | |
docker run --name tricker-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres | |
# see the active docker containers |
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
#!/usr/local/bin/python | |
import argparse | |
import sys | |
import time | |
from selenium import webdriver | |
parser = argparse.ArgumentParser(description='email ire reducer') | |
parser.add_argument('-u','--username', help='your user.name', required=True) |
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 | |
NOW=$(date +"%m/%d/%Y %H:%M") | |
THIS_PATH="/home/pi/src" | |
CITY="NYC" | |
raspistill -o $THIS_PATH/$CITY-cam-in.jpg -q 50 -w 1000 -h 700 | |
convert $THIS_PATH/$CITY-cam-in.jpg -background black -fill white label:"$CITY Raspberry Pi Cam - $NOW" \ | |
+swap -gravity Center -append $THIS_PATH/$CITY-cam.jpg |
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
[color] | |
ui = auto | |
[user] | |
name = Me | |
email = [email protected] | |
[alias] | |
br = branch | |
ci = commit | |
co = checkout | |
st = status |
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
[color] | |
ui = auto | |
[user] | |
name = Todd | |
email = [email protected] | |
[alias] | |
br = branch | |
ci = commit | |
co = checkout | |
st = status |
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
s/^.+DATABASECHANGELOG.+$//; |
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
#!/usr/bin/perl | |
open INFILE, "input.sql" or die $!; | |
open OUTFILE, ">output.sql" or die $!; | |
while (<INFILE>) { | |
if (/^(?:(?!\s+\);).)*$/s) { | |
s/;/\//; | |
} | |
print OUTFILE; |
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
#!/usr/bin/perl | |
open INFILE, "fin2_tran.csv" or die $!; | |
open OUTFILE, ">fin2_out.csv" or die $!; | |
while (<INFILE>) { | |
s/,(\d{4}-\d{2}-\d{2})(,[^,]+$)/,"$1 11:00:00"$2/; | |
print OUTFILE; | |
} |
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
# export data to file | |
mysqldump -uroot -ppassword hornet > hornet-dump.sql | |
# Drop database schema | |
mysqladmin -uroot -ppassword –f drop hornet | |
# create empty database schema | |
mysqladmin –uroot –ppassword create hornet | |
# push dump file into new database schema |
NewerOlder