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 allMaze(x, y, maze) { | |
let validPaths = [] | |
if (y < 0 || x < 0 || y > maze.length - 1 || x > maze[y].length - 1) { | |
return false | |
} else if (maze[y][x] === "e") { | |
return [''] | |
} else if (maze[y][x] == "*") { | |
return false | |
} |
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
➜ Desktop python test.py | |
['H', ' ', ' ', '*', ' ', ' ', ' '] | |
['*', '*', ' ', '*', ' ', '*', ' '] | |
[' ', ' ', ' ', ' ', ' ', ' ', ' '] | |
[' ', '*', '*', '*', '*', '*', ' '] | |
[' ', ' ', ' ', ' ', ' ', ' ', 'e'] | |
['*', 'H', ' ', '*', ' ', ' ', ' '] |
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 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 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 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 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 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 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 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 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 |
NewerOlder