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
FOLDER=$1 | |
sudo chown -R www-data:www-data $FOLDER | |
sudo chmod -R 644 $FOLDER | |
sudo chgrp www-data $FOLDER | |
sudo chmod g+s $FOLDER |
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
cd /var/www/ | |
sudo mkdir -p /var/www/$1/public_html | |
sudo ./perms.sh $1 | |
echo "Success!" >> /var/www/$1/public_html/index.html | |
vHostFile=/etc/apache2/sites-available/$1.conf | |
sudo echo "<VirtualHost *:80>" >> $vHostFile | |
sudo echo -e "\tServerName $1" >> $vHostFile | |
sudo echo -e "\tServerAlias www.$1" >> $vHostFile |
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
# Update Debian and installed packages | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y dist-upgrade | |
# Install curl, etckeeper, and LAMP | |
apt-get install -y curl etckeeper apache2 mariadb-server mariadb-client mariadb-common php php-dev php-mysqli python-certbot-apache sendmail | |
# Configure apache2 | |
a2enmod rewrite headers |
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
class Goal(object): | |
name = 'Generic Goal' | |
@classmethod | |
def getConcreteClasses(cls): | |
for c in cls.__subclasses__(): | |
yield c | |
for c2 in c.getConcreteClasses(): | |
yield c2 |
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 requests | |
def _url(path): | |
return 'https://api.pandapay.io/v1' + path | |
def _auth(pandapay_secret): | |
return (pandapay_secret) |
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
<?php | |
/* | |
Add My Account endpoints | |
*/ | |
function custom_endpoints() { | |
add_rewrite_endpoint('page1', EP_ROOT | EP_PAGES); | |
add_rewrite_endpoint('page2', EP_ROOT | EP_PAGES); | |
} |
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 React from 'react'; | |
import { | |
StyleSheet, | |
View, | |
StatusBar | |
} from 'react-native'; | |
import { Provider } from 'react-redux'; | |
import RootNavigator from './src/navigation/RootNavigator'; | |
import store from './src/store'; |
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
{ | |
"rule-restraints": { | |
"stength": { | |
"min": null, | |
"max": null | |
} | |
}, | |
"match-restraints": { | |
"min-rules-matched": null, | |
"max-rules-matched": null |
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
from django.conf import settings | |
from templated_mail.mail import BaseEmailMessage | |
class VerificationEmail(BaseEmailMessage): | |
template_name = 'email/email_verification.html' | |
def get_context_data(self): | |
# Get context and user |
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
➜ Desktop python test.py | |
['H', ' ', ' ', '*', ' ', ' ', ' '] | |
['*', '*', ' ', '*', ' ', '*', ' '] | |
[' ', ' ', ' ', ' ', ' ', ' ', ' '] | |
[' ', '*', '*', '*', '*', '*', ' '] | |
[' ', ' ', ' ', ' ', ' ', ' ', 'e'] | |
['*', 'H', ' ', '*', ' ', ' ', ' '] |
OlderNewer