Skip to content

Instantly share code, notes, and snippets.

View mireq's full-sized avatar
😼

Miroslav Bendík mireq

😼
View GitHub Profile
\set QUIET ON
\timing on
\encoding unicode
\x auto
\pset null ∅
\pset linestyle unicode
\pset border 2
--\pset pager always
@mireq
mireq / userChrome.css
Last active October 19, 2023 11:59
Compact responsive oneliner for Firefox
*|*:root:not([customizing]) {
--new-tab-height: 29px;
}
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
*|*:root:not([customizing]) .tabbrowser-tab {
min-height: var(--new-tab-height) !important;
}
@mireq
mireq / install_bip_skin.sh
Last active March 24, 2019 15:01
Script to install amazfit bip watch face from amazfitwatchfaces.com
#!/bin/bash
# USAGE: bash install_bip_skin.sh https://amazfitwatchfaces.com/bip/view/id [version]
# bash install_bip_skin.sh https://amazfitwatchfaces.com/bip/view/8992 5b32bd
watchface_dir=/sdcard/Android/data/com.xiaomi.hm.health/files/watch_skin_local
mkdir -p tmp
curl $1 > tmp/amazfit.html 2> /dev/null
preview=`cat tmp/amazfit.html|grep '<meta property="og:image"'|head -n 1|tr -d '\r'|sed -e 's/.*content="\([^"]*\)".*/\1/g'`
@mireq
mireq / django_add_common_files.sh
Last active September 17, 2020 06:17
Utility for creating new django project
#!/bin/bash
if [ -e manage.py ]
then
echo "Installing"
else
echo "Not django directory"
exit
fi
@mireq
mireq / material_preview.py
Created October 22, 2016 11:52
Blender material preview in node editor
import bpy
class PreviewPanel(bpy.types.Panel):
bl_label = "Material preview"
bl_space_type = "NODE_EDITOR"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
@mireq
mireq / run-django.py
Last active September 29, 2022 04:27
Django uwsgi runner with reloader
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import atexit
import collections
import itertools
import os
import signal
bgcolor=0
silentpic=images/background-1280x800.jpg
tx=0
ty=100
tw=1280
th=700
text_x=800
text_y=450
@mireq
mireq / time_series.py
Last active August 11, 2020 15:33
Django ORM time series
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import namedtuple
from datetime import datetime, date, time, timedelta
from functools import partial
from django.db import models
from django.db.models.expressions import DateTime, Date
from django.utils import timezone
@mireq
mireq / reactor.js
Created September 26, 2015 11:00
Reactor.js
;(function (){
"use strict";
var el = document.createElement('DIV');
if (Array.prototype.forEach) {
var coreForEach = Array.prototype.forEach;
var forEach = function(collection, fn) {
coreForEach.call(collection, fn);
@mireq
mireq / etree.js
Last active August 29, 2015 14:26
Simple javascript template
var E = (function () {
var P = function(name, value) {
var name = name.split('=');
this.name = name[0];
this.propname = name[1];
this.value = value;
};
return function(name, propname, value) {
return new P(name, propname, value);