This is a Terraria Server Setup Guide for Digital Ocean
This guide might not do everything the right way, but it works.
No bullshit. Straight up what I did to get it working. (Ubuntu 16.04 64bit)
ssh into your droplet
Update your shit
add_filter('woocommerce_get_price_html', "xa_only_sale_price", 99, 2); | |
function xa_only_sale_price($price, $product) | |
{ | |
if(!is_cart() && !is_checkout() && !is_ajax()){ | |
if ($product->is_type('simple') || $product->is_type('variation')) { | |
return regularPriceHTML_for_simple_and_variation_product($price, $product); | |
} | |
} | |
return $price; |
from os import environ | |
from logging.config import dictConfig | |
from werkzeug.security import generate_password_hash | |
class BaseConfig(object): | |
def _config_logger(self): | |
""" |
This is a Terraria Server Setup Guide for Digital Ocean
This guide might not do everything the right way, but it works.
No bullshit. Straight up what I did to get it working. (Ubuntu 16.04 64bit)
ssh into your droplet
Update your shit
from datetime import date | |
from sqlalchemy import cast, DATE | |
Match.query.filter(cast(Match.date_time_field, DATE)==date.today()).all() |
#!/usr/bin/env ruby | |
# | |
# This code snippet shows how to enable SSL in Sinatra. | |
# | |
require 'sinatra/base' | |
class Application < Sinatra::Base | |
configure do | |
set :bind, '0.0.0.0' |
Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.
source :rubygems | |
gem 'sinatra' | |
gem 'json' | |
gem 'omniauth' | |
gem 'omniauth-oauth2' | |
gem 'omniauth-github' | |
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__) | |
gem 'thin' |
from functools import wraps | |
from flask import Flask, g, session, request, abort, jsonify | |
from flask_migrate import MigrateCommand, Migrate | |
from flask_script import Manager | |
from flask_sqlalchemy import SQLAlchemy | |
flask_app = Flask(__name__, static_folder='./static') | |
db = SQLAlchemy() | |
migrate = Migrate() |
An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.
Where:
REGION
: AWS region.ACCOUNT_ID
: AWS account ID.APPLICATION_NAME
: Desired target Elastic Beanstalk application name(space).IAM_INSTANCE_PROFILE_ROLE
: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.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) |