Skip to content

Instantly share code, notes, and snippets.

View hibellm's full-sized avatar

Marcus hibellm

  • Roche
  • Basel
View GitHub Profile
@hibellm
hibellm / brython.html
Created April 26, 2020 06:49 — forked from bradtraversy/brython.html
Python in the browser with Brython
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.8.8/brython.js" integrity="sha256-rA89wPrTJJQFWJaZveKW8jpdmC3t5F9rRkPyBjz8G04=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.8.8/brython_stdlib.js" integrity="sha256-Gnrw9tIjrsXcZSCh/wos5Jrpn0bNVNFJuNJI9d71TDs=" crossorigin="anonymous"></script>
@hibellm
hibellm / 01-Learning-Python3.md
Created February 26, 2020 08:26 — forked from kenjyco/01-Learning-Python3.md
Learn Python 3 with Jupyter Notebook

Learning Python 3

This gist provides the learning-python3.ipynb notebook file, which can be viewed and edited in a Jupyter Notebook server to learn Python 3.

Once you load the notebook file to your local jupyter server, you can edit any

@hibellm
hibellm / 01_Readme.md
Created July 9, 2019 07:11 — forked from Wildcarde/01_Readme.md
Quick demo embedding a Bokeh chart inside a Flask application

This works in a python 3.6 environment with bokeh and flask installed. To use this you need the following directory structure:

app/
 - templates/
   - hello.html
 - bokeh-slider.py
 - hello.py

After that you need to open two terminals at app/, in the first one you need to run the bokeh server with the command:

@hibellm
hibellm / flask_job_scheduler.py
Created June 22, 2019 07:49 — forked from ivanleoncz/flask_job_scheduler.py
Demonstrating APScheduler feature for small Flask App.
#!/usr/bin/python3
""" Demonstrating APScheduler feature for small Flask App. """
from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask
def sensor():
""" Function for test purposes. """
print("Scheduler is alive!")
@hibellm
hibellm / RedisPythonPubSub1.py
Created April 14, 2018 21:53 — forked from jobliz/RedisPythonPubSub1.py
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@hibellm
hibellm / Logging to a web page
Created October 24, 2017 19:34 — forked from jhorneman/Logging to a web page
Some code snippets showing how one could send logging output to a web page in Python
# web_page_logger.py
import logging
class WebPageHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
self.messages = []
def emit(self, record):
@hibellm
hibellm / appsScript_ListFilesFolders_Mesgarpour.js
Created September 21, 2017 12:30 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/**
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet.
* - Main function 1: List all folders
* - Main function 2: List all files & folders
*
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field.
* The folder ID is everything after the 'folders/' portion of the URL.
*
* @version 1.0
* @see https://github.com/mesgarpour
@hibellm
hibellm / recursive_index.pl
Created April 1, 2017 20:39 — forked from Zverik/recursive_index.pl
Create index.html with a list of all files
#!/usr/bin/perl
# Create index.html with a list of all files.
# Written by Ilya Zverev, licensed WTFPL.
use strict;
use POSIX qw(strftime);
use HTML::Template;
use File::Basename;
use Getopt::Long;
@hibellm
hibellm / VCF.py
Created March 17, 2017 11:11 — forked from slowkow/VCF.py
VCF.py is a simple module for reading VCF files
"""
VCF.py
Kamil Slowikowski
October 30, 2013
Read VCF files. Works with gzip compressed files and pandas.
Note: This module ignores the genotype columns because
I didn't need them at the time of writing.
@hibellm
hibellm / app.js
Created March 7, 2017 19:22 — forked from clarle/app.js
Short tutorial on how to use Express and node-mysql
// Module dependencies
var express = require('express'),
mysql = require('mysql');
// Application initialization
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',