Skip to content

Instantly share code, notes, and snippets.

.thin-icon {
width: 1em;
height: 1em;
position: relative;
display: inline-block;
z-index: 1;
&:before, &:after {
content: "";
display: block;
/**************************************************
* The Talbe
**************************************************/
.the-table {
display: table;
width: 100%;
}
.tr {
img {
bottom: 0;
left: 0;
position: absolute;
right: 0;
margin: auto;
text-align: center;
top: 0;
width: auto;
/**************************************************************
:: Line Splitters
.splitter
.dotted
.dotted-middle
**************************************************************/
.splitter {
$('.sm-menu').click(function(event) {
var parent = $(this).parent();
parent = parent[0];
$('.sp-mrtop').each(function(index, el) {
if( this == parent){
$(this).toggleClass('open');
} else {
$(this).removeClass('open');
}
$('#uploadLogo').click(function(e) {
e.preventDefault();
//If the uploader object has already been created, reopen the dialog
if (custom_uploader) {
custom_uploader.open();
return;
}
$('[data-ajax=modal]').each(function(index, el) {
var this_el = $(this);
var form_el = $('form', this_el);
this_el.on('hide.bs.modal', function(){
var next_el = $('.modal-header', this_el).next();
if( next_el.hasClass('alert') )
next_el.remove();
var bodyRect = document.body.getBoundingClientRect(),
elemRect = document.getElementById('keroro').getBoundingClientRect(),
offset = elemRect.top - bodyRect.top;
alert('Element is ' + offset + ' vertical pixels from <body>');
@aviogreen
aviogreen / qt_and_tornado.py
Created November 15, 2016 20:02 — forked from maartenbreddels/qt_and_tornado.py
Combining Qt and tornado, both which want to have their own event loop.
__author__ = 'breddels'
"""
Demonstrates combining Qt and tornado, both which want to have their own event loop.
The solution is to run tornado in a thread, the issue is that callbacks will then also be executed in this thread, and Qt doesn't like that.
To fix this, I show how to use execute the callback in the main thread, using a Qt signal/event in combination with Promises.
The output of the program is:
fetch page, we are in thread <_MainThread(MainThread, started 47200787479520)>
response is 191548 bytes, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
the other thread should fulfil the result to this promise, we are in thread <Thread(Thread-1, started daemon 47201018689280)>