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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<style> | |
.display-table-cell { | |
display: table-cell; |
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
set "OLD_SQL_ALCHEMY_ECHO=%SQL_ALCHEMY_ECHO%" | |
set "SQL_ALCHEMY_ECHO=False" | |
set "OLD_CURRENT_ENV=%CURRENT_ENV%" | |
set "CURRENT_ENV=DEV" | |
mysqladmin -uroot -f drop knowstory && mysqladmin -uroot create knowstory | |
alembic upgrade head | |
python fake_data_db_generator\main.py | |
set "CURRENT_ENV=UNIT-TEST" |
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
''' | |
code is taken from | |
https://github.com/GoogleCloudPlatform/storage-file-transfer-json-python | |
''' | |
from server.settings import current_environment as env | |
from server.errors import InternalError | |
import httplib2 | |
from apiclient.discovery import build as discovery_build | |
from oauth2client.file import Storage as CredentialStorage |
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 re | |
from cgi import escape | |
def index(environ, start_response): | |
"""This function will be mounted on "/" and display a link | |
to the hello world page.""" | |
start_response('200 OK', [('Content-Type', 'text/html')]) | |
return ['''Hello World Application | |
This is the Hello World application: |
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
-- -------------------------------------------------------- | |
-- Host: 127.0.0.1 | |
-- Server version: 10.1.8-MariaDB - mariadb.org binary distribution | |
-- Server OS: Win32 | |
-- HeidiSQL Version: 9.3.0.4984 | |
-- -------------------------------------------------------- | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET NAMES utf8mb4 */; | |
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
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 sqlalchemy.orm import sessionmaker, Session | |
class DbSession(Session): | |
def get_old(self, attr): | |
''' gets all old(updated/deleted) values of attribute ''' | |
parent_class = attr.parent.class_ | |
# take all attr values from deleted entities | |
# and all changed attr values from dirty entities |
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 | |
/* Returns all properties og object including private/protected | |
* in [prop => value] array | |
*/ | |
function props($obj) { | |
$reflect = new \ReflectionClass($obj); | |
$props = $reflect->getProperties(); | |
$result = []; | |
foreach ($props as $prop) { |
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 | |
/* | |
PsySh config file (see http://psysh.org/#configure) | |
!!! | |
Copy this file to ~\.config\psysh\config.php, where ~ is your home dir | |
for example (Windows): C:\Users\MY_USER\.config\psysh\config.php | |
Result dump will look like http://www.qopy.me/D6R2fYEQSw6wjV7NDaPMxw | |
*/ | |
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 | |
/* | |
PsySh config file (see http://psysh.org/#configure) | |
!!! | |
Copy this file to ~\.config\psysh\config.php, where ~ is your home dir | |
for example (Windows): C:\Users\MY_USER\.config\psysh\config.php | |
Result dump will look like http://www.qopy.me/D6R2fYEQSw6wjV7NDaPMxw | |
*/ | |