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 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 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
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 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
<!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 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
<iframe width="100%" height="300" src="//jsfiddle.net/aPv9H/626/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>My project</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 type="text/css"> | |
.navbar-avatar { | |
padding-top: 7px !important; | |
padding-bottom: 7px !important; |
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
/* Grid system */ | |
* { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.container:after, .container:before, .row:after, .row:before { | |
content: " "; display: table; | |
} |
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
// checks that all files in <input type="file"> have valid mime type (according to 'accept' attribute) | |
$.fn.filesHaveValidType = function() { | |
// this validation works for: | |
// 1. simple 'accept' values like 'image/*' | |
// 2. combined 'accept' values like accept="image/png, audio/mp3" | |
var elem = this[0]; | |
var accept = this.attr('accept'); | |
if (accept) { | |
var acceptTypes = accept.split(',').map(function(s) { return s.trim() }); | |
// iterate over all files and return false if some file is of invalid type |
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
{ | |
"require": { | |
"illuminate/validation": "~4.2.9" | |
}, | |
} |
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
@echo off | |
set "VIRTUAL_ENV=E:\Web.LOCAL\Python\projects\knowstory\env" | |
set "ROOT_DIR=E:\Web.LOCAL\Python\projects\knowstory" | |
if defined _OLD_VIRTUAL_PROMPT ( | |
set "PROMPT=%_OLD_VIRTUAL_PROMPT%" | |
) else ( | |
if not defined PROMPT ( | |
set "PROMPT=$P$G" | |
) |