Skip to content

Instantly share code, notes, and snippets.

View gpamfilis's full-sized avatar
🎯
Focusing

George Pamfilis gpamfilis

🎯
Focusing
  • Greece
View GitHub Profile
@gpamfilis
gpamfilis / datatable.css
Created August 3, 2023 16:28
Make dash datatable full screen.
/*
Place this file in your assets folder and finito.
*/
/* https://stackoverflow.com/questions/57293843/adjusting-the-maxheight-of-a-table-in-dash-tables-python */
/* высота таблицы Dash DataTable*/
.dash-spreadsheet.dash-freeze-top, .dash-spreadsheet.dash-virtualized
{ max-height: inherit !important; }
.dash-table-container {max-height: calc(100vh - 10px);}
/*makes the height of the DashTable 10 pix less then the 100% screen */
@gpamfilis
gpamfilis / views.py
Created August 20, 2018 20:32
gallery snipet
def gallery(location='static/img/gallery'):
gallery_categories = os.path.join(os.path.sep, basedir, 'app', *location.split('/'))
categories = os.listdir(gallery_categories)
images_full_path = []
for category in categories:
images = os.path.join(os.path.sep, basedir, 'app', *location.split('/'), category)
for image in os.listdir(images):
image_path = os.path.join(*location.split('/'), category, image)
images_full_path.append([category, image_path])
return categories, images_full_path
@gpamfilis
gpamfilis / projects.html
Created August 20, 2018 20:31
gallery snipet
<div class="container-fluid">
<div class="gallery-pt">
<div class="row">
<div class="col-md-12">
<h1 class="text-center">Project Gallery</h1>
</div>
</div>
<div class="row">
<div class="col-md-12 gallery-pt--filter-container">
<ul class="list-inline filters">
@gpamfilis
gpamfilis / views.py
Created August 20, 2018 14:36
carousel images
@main.route('/', methods=['GET', 'POST'])
def index():
assets_img = os.path.join(os.path.sep, basedir, 'app', 'static', 'assets', 'img')
image_urls = os.listdir(assets_img)
im = [os.path.join(os.path.sep, 'static', 'assets', 'img', img) for img in image_urls]
return render_template('index.html',
image_urls=im)
@gpamfilis
gpamfilis / index.html
Created August 15, 2018 17:20
Datatables javascript version 1
<script type="text/javascript">
$(document).ready(function() {
table = $('#example').DataTable({
"ajax":{
"url": "/get_data",
"dataSrc" :"items"}
});
<div>
<div class="container">
<div class="row">
<div class="col-md-6">
<div><H1>{{title1}}</H1>
<form action="/plot">
<select name="feature_name1">
{% for feature in feature_names1 %}
{% if feature == current_feature_name1 %}
__author__ = 'George Pamfilis'
import numpy as np
from itertools import combinations
from scipy.misc import comb
class Coupon(object):
def __init__(self, game_odds, game_system):