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 VERSION="3.7.1" | |
xcode-select --install | |
brew update | |
brew upgrade | |
brew install zlib | |
brew reinstall zlib | |
export LDFLAGS="-L/usr/local/opt/zlib/lib" | |
export CPPFLAGS="-I/usr/local/opt/zlib/include" | |
pyenv install $VERSION | |
pyenv global $VERSION |
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/env bash | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` |
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
from datetime import datetime | |
from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
from sqlalchemy.orm import relationship | |
from sqlalchemy.ext.declarative import declared_attr | |
from flask_security import current_user | |
class AuditMixin(object): | |
created_at = Column(DateTime, default=datetime.now) | |
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |
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
<div>{"<"} Less than, {">"} greater than </div> |
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
sudo apt-get update | |
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y | |
sudo apt-get install libfreetype6 libfreetype6-dev -y | |
sudo apt-get install libfontconfig1 libfontconfig1-dev -y | |
cd ~ | |
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" | |
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2 | |
sudo tar xvjf $PHANTOM_JS.tar.bz2 | |
sudo mv $PHANTOM_JS /usr/local/share | |
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin |
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
select * from table t1 | |
where (select count(*) from table t2 | |
where t1.field = t2.field) > 1 | |
order by field |
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
#sudo docker run --name openvpn-deluge --privileged --restart=always -v /home/nick/Dev/vpn:/vpn -v /home/deluge/.config/deluge:/deluged/config -v /disk1:/disk1 -i -t openvpn_deluge /bin/bash | |
FROM ubuntu:14.04 | |
MAINTAINER Nick Woodhams | |
RUN apt-get -y update | |
RUN apt-get install -y openvpn | |
RUN apt-get install -y deluged deluge-web deluge-console | |
COPY start.sh start.sh | |
CMD ["/start.sh"] |
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
# -*- coding:utf8 -*- | |
import re | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy as BaseSQLAlchemy | |
from flask_sqlalchemy import SignallingSession as BaseSignallingSession | |
from flask_sqlalchemy import orm, partial, get_state | |
from datetime import datetime |
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
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer | |
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D | |
sudo -s | |
apt-get -y install mdadm | |
apt-get -y install grub-efi-amd64 | |
sgdisk -z /dev/sda | |
sgdisk -z /dev/sdb | |
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda | |
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda |
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
def copy_row(model, row, ignored_columns=[]): | |
copy = model() | |
for col in row.__table__.columns: | |
if col.name not in ignored_columns: | |
try: | |
copy.__setattr__(col.name, getattr(row, col.name)) | |
except Exception as e: | |
print e | |
continue |
NewerOlder