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
| <script src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/0.2.1/trianglify.min.js"></script> | |
| <style> | |
| width:500px; | |
| height:500px; | |
| </style> | |
| <div id="main" class="main"> | |
| <script> | |
| function addTriangleTo(target) { |
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
| #SQL alchemy object to list method | |
| def to_dict(data): | |
| """ | |
| :param data: | |
| :returns objects list in dictionary : | |
| """ | |
| return [u.__dict__ for u in data] |
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 flask import Flask | |
| from flask.ext.testing import TestCase | |
| from mtportal.app import create_app | |
| class TestConfig(object): | |
| DEBUG = False | |
| TESTING = True |
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 random import randrange | |
| class Card(): | |
| def __init__(self, rank, suit): | |
| self.rank = rank | |
| self.suit = suit | |
| card_list = [Card("HEARTS", 4), |
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
| # first version | |
| def boo1(l=[]): | |
| l = list(l) | |
| l.append(1) | |
| return l | |
| # second version | |
| def boo2(l=[]): | |
| result = [] | |
| result.extend(l) |
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
| # | |
| # Daemon for Consul | |
| # | |
| # chkconfig: 345 99 20 | |
| # description: Daemon for vault | |
| # processname: vault | |
| ### BEGIN INIT INFO | |
| # Provides: consul | |
| # Required-Start: $network |
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
| # | |
| # Daemon for vault | |
| # | |
| # chkconfig: 345 99 20 | |
| # description: Daemon for vault | |
| # processname: vault | |
| ### BEGIN INIT INFO | |
| # Provides: vault | |
| # Required-Start: $network |
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
| var MenuCategories = React.createClass({ | |
| getInitialState: function() { | |
| return { | |
| data: [], | |
| temp : "beka tomashvili" | |
| }; | |
| }, | |
| componentDidMount: function() { | |
| this.serverRequest = $.get(this.props.source, function (result) { |
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
| /** | |
| * Created by beka on 4/10/16. | |
| */ | |
| module.exports = { | |
| base64_encode: function (file){ | |
| var fs = require('fs'); | |
| var bitmap = fs.readFileSync(file); | |
| return new Buffer(bitmap).toString('base64'); |
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
| function allowCrossDomain(req, res, next) { | |
| res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); | |
| res.header('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); | |
| res.header('Access-Control-Allow-Credentials', true); | |
| var origin = req.headers.origin; | |
| if (_.contains(config.allowed_origins, origin)) { | |
| res.setHeader('Access-Control-Allow-Origin', origin); |