Skip to content

Instantly share code, notes, and snippets.

@kubajecminek
kubajecminek / .gnus.el
Last active February 23, 2024 12:32
Gnus RSS config
(setq my-feeds '(("Richard Stallman" "https://stallman.org/rss/rss.xml" "Chief GNUisance of the GNU Project")
;; Define other feeds right here (title url description)
))
;; This function mimics `gnus-group-make-rss-group' behaviour
(defun my-subscribe-rss-feeds (feeds)
(require 'nnrss)
(dolist (feed feeds)
(let* ((title (nth 0 feed))
(href (nth 1 feed))
@7468696e6b
7468696e6b / okular-appleSilicon.md
Last active July 2, 2024 05:30
how to install Okular viewer on macOS Big Sur, using M1/Apple Silicon/arm64
  1. Install homebrew from https://brew.sh/ (follow the instructions there)
  2. tap the https://invent.kde.org/packaging/homebrew-kde/ repo, brew tap kde-mac/kde https://invent.kde.org/packaging/homebrew-kde.git
  3. brew edit okular, workaround now is to comment out or delete the line depends_on "chmlib" (won't compile on macos arm64 for now as of 2021-08-18), then save (if using vim you need to first press i to insert/type, when saving then <esc> then :wq then <enter>.
  4. brew install okular, wait for stuff to compile and/or install
  5. It may ask for keychain credentials (to sign the binaries? because of mac arm64 security policy https://eclecticlight.co/2021/01/26/when-you-dont-have-permission-to-run-an-app-on-an-m1-mac/)
  6. $(brew --repo kde-mac/kde)/tools/do-caveats.sh
  7. Now okular is in your $HOME/Applications/KDE folder, and will show up in Launchpad! You can view pdf, djvu, etc documents.
@julio-kim
julio-kim / CovidStat.js
Last active February 27, 2021 06:34
[Scriptable] 코로나 확진자 현황
const source = 'http://ncov.mohw.go.kr'
let webView = new WebView()
await webView.loadURL(source)
let covid = await webView.evaluateJavaScript(`
const baseSelector = 'div.mainlive_container div.liveboard_layout '
let date = document.querySelector(baseSelector + 'h2 span.livedate').innerText
let domestic = document.querySelector(baseSelector + 'div.liveNum_today_new ul li:nth-child(1) span.data').innerText
let overseas = document.querySelector(baseSelector + 'div.liveNum_today_new ul li:nth-child(2) span.data').innerText
@alphapapa
alphapapa / dired.sh
Last active April 4, 2021 09:37
Standalone Dired launcher
#!/bin/bash
# Launch Dired in a plain Emacs configuration.
# Arguments are passed to Emacs, e.g. "-nw" works as expected.
emacs -q "$@" \
--eval "(dired default-directory)" \
--eval "(defun kill-window-or-emacs () (interactive) (if (one-window-p) (kill-emacs) (delete-window)))" \
--eval "(setq dired-dwim-target t delete-by-moving-to-trash t)" \
@baby-bird
baby-bird / Time_Timer.py
Last active March 8, 2024 21:48
Time_Timer.py
'''
A simple Time Timer app made of ShapeNodes.
<Change Line 120 for seconds or minutes counting>
<Uncomment Line 126 and fill in your shortcut name to
automatically run other shortcut you defined
after timer stopped>
Odd touch attemps will start the timer
Even touch attemps will stop the timer
Stops automatically when the set times passed
'''
@anotherdirtbag
anotherdirtbag / epub_to_tts.py
Last active September 26, 2023 02:28
A python 3 script to read the text from an epub file using either online(google wavenet) or offline (sapi) tts and save as a series of opus files.
import os
import sys
import zipfile
import time
import re
import urllib3
from dataclasses import dataclass
from bs4 import BeautifulSoup
@sinkingsugar
sinkingsugar / halide.nim
Created July 2, 2019 05:52
Nim and Haldie
import nimline
import os
static:
let
halideDist = getenv("HALIDE_DIST")
assert halideDist != "" , "HALIDE_DIST environment variables not set!"
when defined windows:
use std::thread;
use std::sync::mpsc;
use std::sync::Arc;
use std::sync::Mutex;
enum Message {
NewJob(Job),
Terminate,
}
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Update a simple plot as rapidly as possible to measure speed.
"""
## Add path to library (just for examples; you do not need this)
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
@CharlesHolbrow
CharlesHolbrow / ffmpeg-hls.html
Created September 13, 2018 22:44
Example of ffmpeg for live hls streaming with hls.js
<!DOCTYPE html>
<html lang='`en'>
<head>
<meta charset='utf-8'/>
<title>Audio only stream example</title>
<script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script>
<style>
video {
width: 640px;
height: 360px;