Skip to content

Instantly share code, notes, and snippets.

View glutanimate's full-sized avatar
🎯
Focusing

Aristotelis glutanimate

🎯
Focusing
View GitHub Profile
@glutanimate
glutanimate / __init__.py
Last active October 9, 2018 20:28
Quick proof-of-concept add-on for Anki web view hooks PR. Please copy into subfolder in addons21 directory to test.
# Quick proof-of-concept add-on for Anki PR:
from anki.hooks import addHook
def addCSS(head, instance):
print(head, instance)
return head + "<style>.addition1{color:green;}</style>"
def addCSS2(head, instance):
print(head, instance)
#!/usr/bin/env python
# touchbar_demo.py
# [email protected]
# PyObjC proof of concept NSTouchBar implementation.
# Note that exceptions in the delegates will crash with "Illegal instruction: 4"
# rather than printing helpful stack traces; look in CrashReporter for the
# exception string.
import objc
from AppKit import \
#!/usr/bin/env python
# touchbar_demo.py
# [email protected]
# PyObjC proof of concept NSTouchBar implementation.
# Note that exceptions in the delegates will crash with "Illegal instruction: 4"
# rather than printing helpful stack traces; look in CrashReporter for the
# exception string.
import objc
from AppKit import \
@glutanimate
glutanimate / anki21_editor_btns.py
Created August 23, 2017 21:59
Small test add-on for a few pull requests
# -*- coding: utf-8 -*-
import os
from aqt.qt import *
from anki.hooks import addHook
from aqt.utils import shortcut
from aqt.editor import Editor
def _addButton(self, icon, cmd, tip="", label="", id=None, toggleable=False):
@glutanimate
glutanimate / anki_mobile_card.html
Created November 12, 2016 14:04 — forked from redoPop/anki_mobile_card.html
HTML used by AnkiMobile to render card templates; a reference for creating advanced Anki card templates with special HTML/CSS. When used by AnkiMobile, the card's HTML replaces the `<!-- (Card contents) -->` comment in this gist, with the shared styles dropped inline inside a `<style>` tag.
<!doctype html>
<html class=" webkit safari mobile iphone js">
<head>
<meta name="viewport" content="width=device-width;">
<style id="ss"></style>
<style>
body {
text-align: center;
font-size: 1em;
-webkit-transform: translate3d(0,0,0);
@glutanimate
glutanimate / TaskerFlashlightButton.prj.xml
Last active October 14, 2021 03:12
Toggle flashlight on Android via power button press sequence
<TaskerData sr="" dvi="1" tv="4.6u3m">
<Profile sr="prof92" ve="2">
<cdate>1426618335190</cdate>
<clp>true</clp>
<edate>1427251395506</edate>
<id>92</id>
<mid0>93</mid0>
<nme>FlashlightButton</nme>
<Event sr="con0" ve="2">
<code>208</code>
@glutanimate
glutanimate / toggle_ppa.sh
Last active December 29, 2015 20:19
Simple script to enable/disable PPAs
#!/bin/bash
#
# toggle_ppa.sh
#
# created by souravc (http://askubuntu.com/users/127327/)
# modified by Glutanimate (http://askubuntu.com/users/81372/)
#
# originally released at http://askubuntu.com/q/383605/81372
#
# DESCRIPTION: Detects if PPA is active/inactive and deactivates/activates it