Skip to content

Instantly share code, notes, and snippets.

View glutanimate's full-sized avatar
🎯
Focusing

Aristotelis glutanimate

🎯
Focusing
View GitHub Profile
@eshapard
eshapard / deadline.py
Last active November 30, 2023 19:49
Anki Deadline
# Anki Deadline
# Anki 2 plugin
# Author: EJS
# Version 0.1
# Description: Adjusts 'New Cards per Day' setting of options group to ensure all cards
# are seen by deadline.
# License: GNU GPL v3 <www.gnu.org/licenses/gpl.html>
from __future__ import division
import datetime, time, math
from anki.hooks import wrap, addHook
@asfaltboy
asfaltboy / mousemap_wrapper.py
Last active January 28, 2019 21:21
A simply SublimeText plugin to run a command if matches a selector
"""
A simply SublimeText plugin to run a command if matches a selector.
Usage example - my `Default (OSX).sublime-mousemap`:
[
// for Python we use Anaconda's goto command, for go we use go_guru,
// for others we use built-in goto command
{ "button": "button1", "modifiers": ["ctrl"], "command": "mousemap_wrap",
"press_command": "drag_select", "args": { "commands": [
{
function DummyStore() {
var instance;
return instance =
{ store: {}
, setItem: function (key, val) {
instance.store[key] = val;
return val;
}
, getItem: function (key, def) {
var val = instance.store[key];
@kmonsoor
kmonsoor / get_yt_video_id.py
Last active February 15, 2024 17:15
Extract Video-ID from a Youtube url
# initial version: http://stackoverflow.com/a/7936523/617185 \
# by Mikhail Kashkin(http://stackoverflow.com/users/85739/mikhail-kashkin)
def get_yt_video_id(url):
"""Returns Video_ID extracting from the given url of Youtube
Examples of URLs:
Valid:
'http://youtu.be/_lOT2p_FCvA',
'www.youtube.com/watch?v=_lOT2p_FCvA&feature=feedu',
@redoPop
redoPop / anki_mobile_card.html
Created February 7, 2015 19:22
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);
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@wandernauta
wandernauta / sp
Last active May 14, 2024 16:49
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@sartak
sartak / a.md
Last active March 22, 2024 22:16
Anki 2 annotated schema
@michalfapso
michalfapso / speak.pl
Last active January 10, 2024 00:52
Google Text-to-Speech script for processing longer texts
#!/usr/bin/perl
#--------------------------------------------------
# Usage:
# ./speak.pl en input.txt output.mp3
#
# Prerequisites:
# sudo apt-get install libwww-perl libhtml-tree-perl sox libsox-fmt-mp3
#
# Compiling sox:
@febuiles
febuiles / songs.md
Last active July 1, 2022 03:45
Fetching lyrics in Unix

Fetching lyrics in the command line

Objective: Print the lyrics for the current playing song.

How: We'll create a small bash script to do the fetching for us (using curl) and then we'll display it either in the terminal or in our $EDITOR

Get the current song

First we'll need to get the name of the current song and its artist: